You can style your features by attributes

see
 
http://openlayers.org/dev/examples/styles-context.html


// create the layer styleMap by giving the default style a context
var colors = ["red", "green", "blue"];
var context = {
    getColor: function(feature) {
        var region = parseInt((feature.geometry.x + 180) / 120);
        return colors[region];
    },
    getSize: function(feature) {
        return feature.attributes["type"] / map.getResolution() * ..703125;
    }
};
var template = {
    pointRadius: "${getSize}", // using context.getSize(feature)
    fillColor: "${getColor}" // using context.getColor(feature)
};
var style = new OpenLayers.Style(template, {context: context});

var layer2 = new OpenLayers.Layer.Vector('Points', {
    styleMap: new OpenLayers.StyleMap(style),
    renderers: renderer
});

Gruß,
Arnd

-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von sulu
Gesendet: Donnerstag, 7. August 2014 16:54
An: [email protected]
Betreff: Re: [OpenLayers-Users] Display WFS-Points as markers

Uh! That looks very promising!

Thanks again Arnd!

Now im wondering if there is a feature like "getElementsByTagName" (found in
an example for GeoRSS)?

That would allow for a dynamic construction for the features (e.g tooltip or
externalGraphic)


Regards,
Andy



--
View this message in context:
http://osgeo-org.1560.x6.nabble.com/Display-WFS-Points-as-markers-tp5154974p
5155439.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users


---
Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz 
ist aktiv.
http://www.avast.com

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to