-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaces backslashes with forward slashes in KML files #8533
Changes from 7 commits
ed19f5b
f48ca09
9f45c90
a3ac7a7
670cbbb
e78fafc
57efcf2
7fa8c0b
d8eb2ff
15e66df
74d6bb9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -595,6 +595,8 @@ import WallGraphics from './WallGraphics.js'; | |
|
||
var resource; | ||
if (defined(uriResolver)) { | ||
// To resolve issues with KML sources defined in Windows style paths. | ||
href = href.replace(/\\/g, '/'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's worth adding a short inline comment explaining why backslashes need to be converted here. |
||
var blob = uriResolver[href]; | ||
if (defined(blob)) { | ||
resource = new Resource({ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -227,6 +227,14 @@ describe('DataSources/KmlDataSource', function() { | |
}); | ||
}); | ||
|
||
it('load works with a KMZ URL with Windows-style paths', function() { | ||
var dataSource = new KmlDataSource(options); | ||
return dataSource.load('Data/KML/backslash.kmz').then(function(source) { | ||
expect(source).toBe(dataSource); | ||
expect(source.entities.values[0]._billboard._image._value).toBeDefined(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test also passes on master so it will need to be tweaked. I noticed that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This issue was resolved by using |
||
}); | ||
}); | ||
|
||
it('load works with a KMZ Resource', function() { | ||
var dataSource = new KmlDataSource(options); | ||
var resource = new Resource({ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove empty line