[OpenLayers-Dev] [OpenLayers-Trac] [OpenLayers] #1260: SelectFeature and OpenLayers.Feature.Vector.style["select"]

Andreas Hocevar andreas.hocevar at gmail.com
Fri Jan 11 05:39:12 EST 2008


Hi Roald,

Roald de Wit wrote:
> How can I store a parsed StyleMap (prob within my KML format) in such 
> a way that OL can automatically select the correct render intent from 
> the Styles and paint the feature accordingly? You have written 
> 'select' and 'drawFeature' methods. Are they going to be part of the 
> trunk?

Take as an example a style map with styles ["default", "select"]. In 
that case, you would have two OL.Style objects, say myDefaultStyle and 
mySelectStyle. For the drawFeature and select methods proposed on the 
wiki to work, you would have to use an object looking like this as 
layer.style or feature.style:

style = {
    'default': /*OL.Style*/ myDefaultStyle,
    'select': /*OL.Style*/ mySelectStyle
}

Plus, you would have to set the default selectStyle of the SelectFeature 
control to null.

There was no broad discussion yet on how and if this should make it into 
trunk, but if it proves to be a good concept, it would IMO make sense.

> If so, maybe we can work together to get your changes in and me using 
> them.  If not, can you give me an idea how i can make it work in order 
> to have my KML being styled properly?

I will give you the help you need to get this up and running. If it 
proves successful, we can work together to discuss it on the list and 
make it part of the trunk.


Regards,
Andreas.



More information about the Dev mailing list