[OpenLayers-Users] Change colors on a selected polygon (feature)
Swärd Mårten
marten.sward at smhi.se
Tue Jan 22 06:47:38 EST 2008
Ok, thanks! But the system this will be used in is a production system for forecasting thunderstorms and sending warnings with SMS so I have to wait for an official release..
I'll have to figure out something else.. But thanks for you answer!
Regards, Mårten
************************************************************************
Mvh:
Mårten Swärd
Systemutvecklare/Webbutvecklare, ITs
SMHI, Sveriges Meteorologiska och Hydrologiska Institut
Tel: +46 11 495 8469
-----Ursprungligt meddelande-----
Från: Andreas Hocevar [mailto:andreas.hocevar at gmail.com]
Skickat: den 22 januari 2008 11:33
Till: Swärd Mårten
Kopia: users at openlayers.org
Ämne: Re: [OpenLayers-Users] Change colors on a selected polygon (feature)
Hi,
Swärd Mårten wrote:
>
> How do I do to change the fill-color of a selected feature (polygon)
> from the default blue one? I just want a border around the selected
> feature but with the original fill-color...
>
You have to set the selectStyle property of
OpenLayers.Control.SelectFeature. Currently, the selectStyle is a
separate style and does not extend the feature style. So your
requirement can only be fulfilled if you have the same fill-color for
all features of your layer.
See http://trac.openlayers.org/ticket/1260 for a patch if you want to
have your feature style extended by the selectStyle.
Regards,
Andreas.
More information about the Users
mailing list