Skip to content

Commit

Permalink
Simplify code and cover all cases correctly CesiumGS#5819
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Bernstein committed Oct 20, 2017
1 parent f6154ca commit cb773a6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Source/DataSources/KmlDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,12 @@ define([

var iconNode = queryFirstNode(node, 'Icon', namespaces.kml);
var icon = getIconHref(iconNode, dataSource, sourceUri, uriResolver, false, query);

// If icon tags are present but blank, we do not want to show an icon
if (defined(iconNode) && !defined(icon)) {
icon = false;
}

var x = queryNumericValue(iconNode, 'x', namespaces.gx);
var y = queryNumericValue(iconNode, 'y', namespaces.gx);
var w = queryNumericValue(iconNode, 'w', namespaces.gx);
Expand Down Expand Up @@ -1138,8 +1144,10 @@ define([
entity.billboard = billboard;
}

if (!defined(styleEntity.billboard) && !defined(billboard.image)) {
if (!defined(billboard.image)) {
billboard.image = dataSource._pinBuilder.fromColor(Color.YELLOW, 64);
} else if (billboard.image == false) {
billboard.image = undefined;
}

var scale = 1.0;
Expand Down

0 comments on commit cb773a6

Please sign in to comment.