[OpenLayers-Users] Vector layer and multiple symbolizers
Xavier Mamano (jorix)
xavier.mamano at gmail.com
Wed Feb 6 11:46:16 PST 2013
Hi Yves,
It's not pretty, but could create a slave layer as:
var mySlaveLayer = new OpenLayers.Layer.Vector("slave", {
displayInLayerSwitcher: false,
style: myOtherStyle
});
myLayer.events.on({
'featuresadded': function(evt) {
mySlaveLayer.addFeatures(evt.features.slice());
},
'featuresremoved': function(evt) {
mySlaveLayer.removeFeatures(evt.features.slice());
},
'visibilitychanged': ....
});
with two layers be sufficient, the numbers can be labels.
You have a few hours of work for adjust this...
Regards,
Xavier Mamano
Yves G wrote
> Hi there,
> thanks for your input.
>
> But if you look my image mockup of what I m trying to display , I want to
> style the station along with some of its attributes (sort of symbols
> composition, not just the point one) .
> I'd be glad if you could update my example here
> http://jsfiddle.net/jLEYS/3/ to
> show me how I could achieve that using the StyleMap
>
> Regards,
> Yves
>
>
>
> 2013/2/5 Sergeant_york <
> electronicpanda@
> >
>
>> var style = new OpenLayers.Style({
>> externalGraphic: '${graphicFunction}',
>> graphicYOffset: '${graphicYOffsetFunction}',
>> graphicXOffset: '${graphicXOffsetFunction}',
>> /* etc... */
>> }, {
>> context: {
>> graphicFunction: function(feature) {
>> if(feature.attributes.type=='bike') return '/bike.png';
>> else if(feature.attributes.type=='hospital') return
>> '/hospital.png';
>> /*etc...*/
>> },
>> graphicYOffsetFunction: function(feature){
>> if(feature.attributes.type=='bike') return 10;
>> else if(feature.attributes.type=='hospital') return -10;
>> /*etc...*/
>> }, /*etc...*/
>> }
>> });
>>
>>
>>
>> --
>> View this message in context:
>> http://osgeo-org.1560.n6.nabble.com/Vector-layer-and-multiple-symbolizers-tp5032127p5032322.html
>> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>> _______________________________________________
>> Users mailing list
>>
> Users at .osgeo
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>
> _______________________________________________
> Users mailing list
> Users at .osgeo
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Vector-layer-and-multiple-symbolizers-tp5032127p5032582.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list