samedi 28 février 2015

Unable to style features in my layer


I have this vector layer



<!-- OVERLAY WFS LAYER WITH KOMVUS FROM GEOSERVER -->
wfs_layer_komvoi = new OpenLayers.Layer.Vector("Κόμβοι", {
styleMap: myStyles,
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
url: "http://localhost:8080/geoserver/wfs",
featurePrefix: "rural", //workspace from geoserver
featureType: "komvoi_real", //layer name from geoserver
featureNS : "http://ift.tt/1t6n1TB", //namespace from geoserver
//styles: "point"
})
})


And I am trying to add style on the point features but I am facing problems. This is the code I use for the features:



var myStyles = new OpenLayers.StyleMap({
"default": new OpenLayers.Style({

fillColor: "#ffcc66",
strokeColor: "#ff9933",
strokeWidth: 2,
graphicZIndex: 1
}),
"select": new OpenLayers.Style({
fillColor: "#66ccff",
strokeColor: "#3399ff",
graphicZIndex: 2
})
});


What am I missing here?





Aucun commentaire:

Enregistrer un commentaire