setStyle or equivalent

34 views
Skip to first unread message

Gordon King

unread,
Jan 15, 2014, 4:57:11 AM1/15/14
to leaflet-ve...@googlegroups.com
Am using mouseHover event on a vector layer and passing the feature and layer into a function.

Is there any mechanism to change the style of the feature?  I see a lot of examples based around geojson vector layer but any of the methods setStyle etc don't seem to work.

I see in the code (layer.js  _processFeatures) that the setStyle method is being used in the initial rendering of the layer, so it must be available somewhere.

thanks for any help you can offer

Gordon

Bryan McBride

unread,
Jan 16, 2014, 10:00:24 AM1/16/14
to leaflet-ve...@googlegroups.com
The Interactive Choropleth example does just that: http://leafletjs.com/examples/choropleth.html. Just do a search for setStyle and you should be able to figure it out.

BRYAN


--
You received this message because you are subscribed to the Google Groups "Leaflet Vector Layers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leaflet-vector-l...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Bryan R. McBride, GISP
bryanmcbride.com

Marco Barbieri

unread,
Feb 9, 2015, 6:44:23 AM2/9/15
to leaflet-ve...@googlegroups.com
Hi Gordon, did you manage to solve the problem?

Thanks,
Marco
Reply all
Reply to author
Forward
0 new messages