-
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
Fix bug where yellow icon is shown when icon tag is empty #5819 #5821
Merged
hpinkos
merged 35 commits into
CesiumGS:master
from
josh-bernstein:5819_fix_for_empty_icon_tag
Oct 23, 2017
Merged
Changes from 10 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
1fdc621
Fix bug where yellow icon is shown when icon tag is empty #5819
b59cba1
Revert "Fix bug where yellow icon is shown when icon tag is empty #5819"
13a6606
Fix bug with placemarks in imported KML, where placemarks with no spe…
ab50ab5
Add unit test and supporting KML file #5819
135d396
Revert "Add unit test and supporting KML file #5819"
8898faf
Add KML file to be used in test #5819
515de90
Add unit test for icon tag with no image #5819
35d690f
Merge pull request #1 from AnalyticalGraphicsInc/master
983ffa6
Resolve merge conflict #5819
b9dfceb
Merge branch 'master' into 5819_fix_for_empty_icon_tag
0bf2659
Add my name to contributors file #5819
f373ebe
Merge branch 'master' into 5819_fix_for_empty_icon_tag
5518ba9
Add test KML file with no style #5819
31efd9d
Include company name in CONTRIBUTORS.md #5819
00aefcc
Merge branch '5819_fix_for_empty_icon_tag' of github.com:josh-bernste…
848e6af
Fix URL for company #5819
b60dc73
Fix case with no style tag, and add test #5819
90dbfd5
Add additional test #5819
9ee14ae
Use === instead of == #5819
cd9c061
Remove extra space #5819
b5ffdff
Merge branch 'master' into 5819_fix_for_empty_icon_tag
6c40ecb
Add tag number to change in CHANGES.md #5819
b0a3834
Pull and resolve merge conflict #5819
be26845
Merge branch 'master' into 5819_fix_for_empty_icon_tag
470810d
Cover edge case where IconStyle tag is empty #5819
395dc5d
Fix unit tests to use toEqual #5819
5f5cb33
Update Changes.md to include change in next release #5819
650066a
Merge branch 'master' into 5819_fix_for_empty_icon_tag
df09819
Revert "Cover edge case where IconStyle tag is empty #5819"
f6154ca
Merge branch 'master' into 5819_fix_for_empty_icon_tag
cb773a6
Simplify code and cover all cases correctly #5819
fa1e73e
Merge branch 'master' into 5819_fix_for_empty_icon_tag
9758800
Merge remote-tracking branch 'upstream/master'
6b6f55c
Merge branch 'master' into 5819_fix_for_empty_icon_tag
4b0b03a
Avoid using == #5819
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<kml xmlns="http://www.opengis.net/kml/2.2"> | ||
<Document> | ||
<Placemark> | ||
<Style> | ||
<IconStyle> | ||
<Icon> | ||
</Icon> | ||
</IconStyle> | ||
</Style> | ||
<description><![CDATA[image.png <a href="./image.png">image.png</a><img src="image.png"/>]]></description> | ||
<Point> | ||
<coordinates>1,2,3</coordinates> | ||
</Point> | ||
</Placemark> | ||
</Document> | ||
</kml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -263,6 +263,18 @@ defineSuite([ | |
}); | ||
}); | ||
|
||
it('if load contains <icon> tag with no image included, no image is added', function() { | ||
var dataSource = new KmlDataSource(options); | ||
return loadBlob('Data/KML/simpleNoIcon.kml').then(function(blob) { | ||
return dataSource.load(blob); | ||
}).then(function(source) { | ||
expect(source.entities); | ||
expect(source.entities.values.length).toEqual(1); | ||
expect(source.entities._entities._array.length).toEqual(1); | ||
expect(!source.entities._entities._array[0]._billboard._image); | ||
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. You need to expect it to be something. This would probably be Also add a test for the other case where no icon style is specified at all, to verify there is the default push pin. |
||
}); | ||
}); | ||
|
||
it('sets DataSource name from Document', function() { | ||
var kml = '<?xml version="1.0" encoding="UTF-8"?>\ | ||
<Document>\ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
By doing this, it fixes your case, but breaks the case where there isn't an icon style at all. In that case Google Earth does show a yellow push pin.
Changing the if to something like
will only set the default image if an icon style wasn't defined, which I believe is the correct behavior in both cases.