Openlayers stylemap label not working wfs

المشرف العام

Administrator
طاقم الإدارة
I have created a style map like following:

var scadaPointStyle = new OpenLayers.StyleMap({ "default": new OpenLayers.Style("null", { "rules": [ new OpenLayers.Rule({ "symbolizer": { "Point": { pointRadius: 15, fillColor: "#3DCDE0", fillOpacity: 0.9, strokeColor: "white", label: "${point_id}", fontColor: "white", cursor: "pointer" } } }) ] }), "select": new OpenLayers.Style("null", { "rules": [ new OpenLayers.Rule({ "symbolizer": { "Point": { pointRadius: 15, fillColor: "#323D34", fillOpacity: 0.9, strokeColor: "white", label: "${point_id}", fontColor: "white", cursor: "pointer" } } }) ] })});And my vector layer is like this:

var vector = new OpenLayers.Layer.Vector(null, { "protocol": new OpenLayers.Protocol.WFS({ featureType: featureType, version: "1.1.0", url: myurl, featurePrefix: myeaturePrefix, geometryName: myGeometryName, srsName: mysrs, isBaseLayer: false }), "styleMap": scadaPointStyle, "strategies": [new OpenLayers.Strategy.BBOX(), new OpenLayers.Strategy.Cluster()], "eventListeners": { "featureselected": onSelected, "featureunselected": onUnselected, "loadstart": onLoadStarted, "loadend": onLoadEnd } });Point style is working and appearing on map. But label text is undefined.

I added contecxt to style like this:

context:function(feature){ return faeture.attributes.point_id;}but didn't worked.

May be about cluster strategy?

I removed cluster strategy but this time pint style didn't appear.



أكثر...
 
أعلى