Draw order (zIndex) of OpenLayers polygons and points in the same layer

المشرف العام

Administrator
طاقم الإدارة
My question is similar but slightly different from this one: http://stackoverflow.com/questions/5003349/openlayers-vector-features-z-indexing

I have an OpenLayers Vector layer which contains polygons and points from PostGIS. I do not want to create a separate table for each entity. I have a StyleMap set for the layer and have zIndexing set to true. My points are using an external graphic and my polygons just a normal style.

Problem: I cannot get the external graphic to render above the the polygons. If I used a normal point then it does render above the polygons. I believe I've tried all combinations of graphicZIndex and zIndex for the point and polygon layers. Help?

Layer def:

var lyrJamoats = new OpenLayers.Layer.Vector("Jamoats", { strategies : [new OpenLayers.Strategy.Fixed()], styleMap : Styles.styleJamoat, rendererOptions : { zIndexing : true }, protocol: {protocol stuff} });Style def:

styleJamoat : new OpenLayers.StyleMap({ "default" : new OpenLayers.Style(null, { rules : [new OpenLayers.Rule({ symbolizer : { "Point" : { fillColor : "#ffcc66", strokeColor : "#ff9933", strokeWidth : 2, graphicZIndex : 1000, //zIndex: 99999999, externalGraphic : "./img/jamoat_pin.png", pointRadius : 30 }, "Polygon" : { strokeWidth : 2, strokeOpacity : 1, strokeColor : "#FFFFFF", fillColor : "#002776", fillOpacity : 0.75, zIndex: 0 //graphicZIndex: 0, } } })] }),Cheers,James@geo_james



أكثر...
 
أعلى