2

I have several points on a layer and all might have different styles associated with them. So I'm doing

VectorFeature pointFeature = new VectorFeature(point,pointStyle)

It all works fine until I do the select(i.e. click the point). When I do a select, the points are not highlighting. The point highlighlights if I remove the pointStyle from the VectorFeature, i.e.,

VectorFeature pointFeature = new VectorFeature(point)

I tried using StyleMap on the layer but ended up getting the same result.

What could possibly be the solution to this problem?

pratZ
  • 3,078
  • 2
  • 20
  • 29
  • Have you used the 'select' part of the styleMap? var sm = new OpenLayers.StyleMap({ 'default': sty, 'select': { strokeColor: "red", fillColor: "red" }, 'delete': { strokeOpacity: "0.2" } }); I don't get your problem, could you, pls, provide a jsfiddle example? Because I use styling and selecting all the time and had no problem ever... – Mochi Apr 02 '14 at 09:10
  • @Mochi I'm sorry. I'm not into js. I use a java wrapper for using OpenLayers. I can still provide you the outline for my problem. And yes, I used the `select` part of `StyleMap`. I'm using a StyleMap for the layer. But later I'm adding points to the layer which have different styles(colors). The points are getting rendered with the updated style(as expected,with different styles) but when I select the point its not highlighting. In short, I have a single layer with several point of different color which do not highlight on click. – pratZ Apr 02 '14 at 20:26

0 Answers0