Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use drawFeature by passing render intent #562

Open
drnextgis opened this Issue · 2 comments

2 participants

@drnextgis

It looks like now impossible to draw feature with drawFeature function by passing renderIntent if feature itself have own style https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Layer/Vector.js#L798. For example, I would like to draw feature with "select" render intent: drawFeature(feature, "select"). Is it expected behaviour?

@ahocevar
Owner

If your layer is configured with a styleMap and not a style, and your feature does not have a style as well, you should be able to call drawFeature with a renderIntent that is defined in the layer's styleMap. Note that the order of precedence is feature.style -> layer.style -> renderIntent. So depending on how your layer and features are configured, this can well be expected behavior.

@drnextgis

Andreas, thanks for answer. That make sense. But it looks a little bit confusing. In my case I have layer configured with styleMap (without lyer.style) and would like to draw particular feature which have own style using one of render intent. And it not obviously why feature.style is used instead styleMap.styles['render intent'] while I perform drawFeature(feature, "select").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.