Skip to content

Commit cb773a6

Browse files
author
Josh Bernstein
committed
Simplify code and cover all cases correctly CesiumGS#5819
1 parent f6154ca commit cb773a6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Source/DataSources/KmlDataSource.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,12 @@ define([
729729

730730
var iconNode = queryFirstNode(node, 'Icon', namespaces.kml);
731731
var icon = getIconHref(iconNode, dataSource, sourceUri, uriResolver, false, query);
732+
733+
// If icon tags are present but blank, we do not want to show an icon
734+
if (defined(iconNode) && !defined(icon)) {
735+
icon = false;
736+
}
737+
732738
var x = queryNumericValue(iconNode, 'x', namespaces.gx);
733739
var y = queryNumericValue(iconNode, 'y', namespaces.gx);
734740
var w = queryNumericValue(iconNode, 'w', namespaces.gx);
@@ -1138,8 +1144,10 @@ define([
11381144
entity.billboard = billboard;
11391145
}
11401146

1141-
if (!defined(styleEntity.billboard) && !defined(billboard.image)) {
1147+
if (!defined(billboard.image)) {
11421148
billboard.image = dataSource._pinBuilder.fromColor(Color.YELLOW, 64);
1149+
} else if (billboard.image == false) {
1150+
billboard.image = undefined;
11431151
}
11441152

11451153
var scale = 1.0;

0 commit comments

Comments
 (0)