Ticket #2610 (new bug)

Opened 3 years ago

highlight/select styles dont work with styled KML(vector) files

Reported by: scaddenp Owned by: crschmidt
Priority: major Milestone: 2.13 Release
Component: Layer.Vector Version: 2.9
Keywords: Feature highlight Cc:
State:

Description

Basics. Create add a KML layer with extractstyles true so layer is symbolized by the KML. Add a selectfeature control (either highlight only, or a select or both). Set option renderIntent to "temporary" if using highlight only.

The feature is not highlighted. Problem is in drawFeature method in Vector.js

if (typeof style != "object") {

if(!style && feature.state === OpenLayers.State.DELETE) {

style = "delete";

}

var renderIntent = style feature.renderIntent;

style = feature.style this.style; if (!style) {

style = this.styleMap.createSymbolizer(feature, renderIntent);

}

}

Incoming style is null for ordinary drawing and "temporary" or "select" when highlighting or selecting.. However, feature.style is an object so style will ALWAYS be feature.style by the logic above.

A code which works for me is:

if (typeof style != "object") {

if(!style && feature.state === OpenLayers.State.DELETE) {

style = "delete";

}

var renderIntent = style feature.renderIntent; if (!style) {

style = feature.style this.style

} else {

style = this.styleMap.createSymbolizer(feature, renderIntent);

} if (!style) {

style = this.styleMap.createSymbolizer(feature, renderIntent);

}

}

Note: See TracTickets for help on using tickets.