kml styling problem- external StyleMap

We have a customer who is using KML like the following. If they load EVENT.KML, everything works properly. However if they use MAIN.KML which references an external stylemap, it cannot find the style(entity) and it uses the default yellow bubble icon.

This seems to be because it’s looking for the style as “#explosionRollover” but the entity is stored as “http://localhost/Cesium1.12/Apps/SampleData/kml/event.kml#explosionRollover”. Is this a known issue? Any tips on how to best resolve this issue? Thanks!

MAIN.KML

<?xml version="1.0" encoding="utf-8"?> Aggregate Events KML 1 KML of selected events from wIDOw HIGH EXPLOSIVE at (2004) test data http://localhost/Cesium1.12/Apps/SampleData/kml/event.kml#explosionRollover 2004-01 2004-02 absolute -118.5067466258564,40.78430432128623,10000

``

EVENT.KML

<?xml version="1.0" encoding="utf-8"?>

HIGH EXPLOSIVE

1

Detail for Event

0.7 http://maps.google.com/mapfiles/kml/shapes/volcano.png

normal #explosionNormal

highlight #explosionHighlight

HIGH EXPLOSIVE at (2004) test data #explosionRollover 2004-01 2004-02 absolute -118.5067466258564,40.78430432128623,10000

``

My hacky fix for this is:

var styleUrl = queryStringValue(pair, ‘styleUrl’, namespaces.kml);

if (defined(styleUrl)) {

///////////////////////////////////////////////////////////FIX start
var base = undefined;

if(styleCollection.getById(styleUrl)){

base = styleCollection.getById(styleUrl);

}else if(styleCollection.getById(sourceUri + styleUrl)){

base = styleCollection.getById(sourceUri + styleUrl)

}else{

base = styleCollection.getOrCreateEntity(styleUrl);

}
///////////////////////////////////////////////////////////FIX end

if (defined(base)) {

console.dir(base._billboard._image._value);

styleEntity.merge(base);

}

} else {

node = queryFirstNode(pair, ‘Style’, namespaces.kml);

applyStyle(dataSource, node, styleEntity, sourceUri, uriResolver);

}

``

Ashley -
IS that working for you ?

Can you share code with me please?
Thanks

This issue should be fixed once https://github.com/AnalyticalGraphicsInc/cesium/pull/3774 is merged.