Ext and Openlayers problem color layer

المشرف العام

Administrator
طاقم الإدارة
I had symbolized different layers as you can see here:

if (vector_layer.name == "Buffer"){ vector_layer.style = {fillColor: "blue", pointRadius: 7, fillOpacity: 0.3, strokeColor:"#F2F2F2"}; vector_layer.addFeatures(geojson_format.read(result.getData()));legend.loadLayer(vector_layer);It works fine, but the problem is when I try to change the color with Ext JS Library 3.4.0. The fact is with this type of layers, they are results from turf operation and ext js don't allow me to change the color. I try to choose a different color one but I doesn't work.

Code:

var cp = new Ext.ColorPalette({value:'993300', "renderTo" : cpid}); cp.on("select", function(palette, selColor){ console.log("selected: "+selColor); colorPicker.hide(); var newStyle = new OpenLayers.Style( {"fillColor" : "#"+selColor, "strokeColor" :"#"+selColor, "fillOpacity" : 0.4, "strokeOpacity" : 1, "strokeWidth" : 1, "strokeLinecap" : "round", "pointRadius" : 6}); layer.styleMap.styles["default"] = newStyle; layer.redraw(); Any idea how to solve it?Thanks



أكثر...
 
أعلى