javascript - OpenLayers 3 FeatureOverlay override feature style -


i have web map written using openlayers 3.0, trying upgrade openlayers 3.6. featureoverlay seems behave differently. have kml layers styles defined each feature, , want use featureoverlay style override highlight features mouse moves on them. in ol3.0 worked fine, in ol3.6, feature style takes preference on featureoverlay style, hover highlight not show up. functionality changes seems defeat point of having featureoverlay class - may temporarily change feature style.

is there way override feature style when adding features featureoverlay?

define kml layer:

var layer = new ol.layer.vector({     source: new ol.source.vector({         url: layerurl,         format: new ol.format.kml({             extractstyles: true         })     }) }); 

define featureoverlay:

var hoveroverlay = new ol.featureoverlay({     map: map,     style: new ol.style.style({         stroke: new ol.style.stroke({             color: "orange",             width: 3         })     }) }); 

add feature hoveroverlay in pointermove event:

hoveroverlay.addfeature(feature); 

if set extractstyles: false in ol.format.kml constructor, highlight works, lose original kml styles. featureoverlay work did in ol3.0. possible? or should forget featureoverlay , temporarily change style of feature highlight it?

thanks,

chris


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -