Style Rule: Invalid pointer error

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Style Rule: Invalid pointer error

ashukla
This post has NOT been accepted by the mailing list yet.
Hi,

I'm using Geoserver V2.1.3 with Openlayers V2.12 to implement rule based style. This is working with <=10 rules smoothly but when I try to increase rules more than 10 it starts giving "invalid pointer error". I've tried to figure it out by changing the various Openlayers version but it couldn't worked. Is it a limitation of Openlayers or something else?


Has someone faced same problem? Any help or suggestions are most welcome.

Below is the code snippet:


OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
var map;
var saveStrategy;
var CurrentFeature = null;
var featureType = '';
OpenLayers.Feature.Vector.style['default']['strokeWidth'] = '2';
function init() {
    var bounds = new OpenLayers.Bounds(180400.66, 328735.739, 185428.586, 333465.375);
    var options = { controls:[], maxExtent:bounds, maxResolution:19.4, projection:"EPSG:28992", units:'m', allOverlays:true };
    map = new OpenLayers.Map('map', options);
    var strSld = new OpenLayers.Format.SLD().write({ namedLayers:[
        { name:"ws_GISServer:_V_WEG", userStyles:[ new OpenLayers.Style("MyStyle",
            { rules:[ new OpenLayers.Rule({
                filter:new OpenLayers.Filter.Comparison({
                    type:OpenLayers.Filter.Comparison.EQUAL_TO, property:"ONDERDEEL", value:"Rijbaan" }),
                symbolizer:{"Polygon":{ strokeColor:"#FF0000", fillColor:"#FF0000" }} }),
                new OpenLayers.Rule({ filter:new OpenLayers.Filter.Comparison({
                    type:OpenLayers.Filter.Comparison.EQUAL_TO, property:"ONDERDEEL", value:"Parkeerstrook" }),
                    symbolizer:{"Polygon":{ strokeColor:"#00FF00", fillColor:"#00FF00" }} }),
                new OpenLayers.Rule({ filter:new OpenLayers.Filter.Comparison({
                    type:OpenLayers.Filter.Comparison.EQUAL_TO, property:"ONDERDEEL", value:"Voetpad L" }),
                    symbolizer:{"Polygon":{ strokeColor:"#0000FF", fillColor:"#0000FF" }} }),
                new OpenLayers.Rule({ filter:new OpenLayers.Filter.Comparison({
                    type:OpenLayers.Filter.Comparison.EQUAL_TO, property:"ONDERDEEL", value:"Voetpad R" }),
                    symbolizer:{"Polygon":{ strokeColor:"#0000FF", fillColor:"#0000FF" }} }),
                new OpenLayers.Rule({ filter:new OpenLayers.Filter.Comparison({
                    type:OpenLayers.Filter.Comparison.EQUAL_TO, property:"ONDERDEEL", value:"Fietspad" }),
                    symbolizer:{"Polygon":{ strokeColor:"#FFFF00", fillColor:"#FFFF00" }} }),
                new OpenLayers.Rule({ filter:new OpenLayers.Filter.Comparison({
                    type:OpenLayers.Filter.Comparison.EQUAL_TO, property:"ONDERDEEL", value:"Voetpad" }),
                    symbolizer:{"Polygon":{ strokeColor:"#FF0000", fillColor:"#FF0000" }} }),
                new OpenLayers.Rule({ filter:new OpenLayers.Filter.Comparison({
                    type:OpenLayers.Filter.Comparison.EQUAL_TO, property:"ONDERDEEL", value:"Drempel" }),
                    symbolizer:{"Polygon":{ strokeColor:"#00FF00", fillColor:"#00FF00" }} }),
                new OpenLayers.Rule({ filter:new OpenLayers.Filter.Comparison({
                    type:OpenLayers.Filter.Comparison.EQUAL_TO, property:"ONDERDEEL", value:"Fietspad R" }),
                    symbolizer:{"Polygon":{ strokeColor:"#0000FF", fillColor:"#0000FF" }} }),
                new OpenLayers.Rule({ filter:new OpenLayers.Filter.Comparison({
                    type:OpenLayers.Filter.Comparison.EQUAL_TO, property:"ONDERDEEL", value:"Fietspad L" }),
                    symbolizer:{"Polygon":{ strokeColor:"#0000FF", fillColor:"#0000FF" }} }),
                new OpenLayers.Rule({ filter:new OpenLayers.Filter.Comparison({
                    type:OpenLayers.Filter.Comparison.EQUAL_TO, property:"ONDERDEEL", value:"Inrit L" }),
                    symbolizer:{"Polygon":{ strokeColor:"#FFFF00", fillColor:"#FFFF00" }} }),
                new OpenLayers.Rule({ filter:new OpenLayers.Filter.Comparison({
                    type:OpenLayers.Filter.Comparison.EQUAL_TO, property:"ONDERDEEL", value:"Plein" }),
                    symbolizer:{"Polygon":{ strokeColor:"#FF0000", fillColor:"#FF0000" }} }) ,
                new OpenLayers.Rule({ filter:new OpenLayers.Filter.Comparison({
                    type:OpenLayers.Filter.Comparison.EQUAL_TO, property:"ONDERDEEL", value:"Parkeerstrook L" }),
                    symbolizer:{"Polygon":{ strokeColor:"#00FF00", fillColor:"#00FF00" }} }) ,
                new OpenLayers.Rule({ filter:new OpenLayers.Filter.Comparison({
                    type:OpenLayers.Filter.Comparison.EQUAL_TO, property:"ONDERDEEL", value:"Parkeerstrook M" }),
                    symbolizer:{"Polygon":{ strokeColor:"#0000FF", fillColor:"#0000FF" }} })
            ]
            })
        ] }

    ] });

    var Wegvvakonderdeel = new OpenLayers.Layer.WMS("Wegvvakonderdeel", "/geoserver/wms",
        {layers:'ws_GISServer:_V_WEG', format:'image/jpeg', sld_body:strSld, transparent:true },
        { singleTile:false, ratio:1, yx:{'EPSG:28992':false} });
    map.addLayers([Wegvvakonderdeel]);
    map.addControl(new OpenLayers.Control.LayerSwitcher());
    map.addControl(new OpenLayers.Control.MousePosition());
    map.addControl(new OpenLayers.Control.PanZoomBar({position:new OpenLayers.Pixel(2, 15)}));
    map.zoomToExtent(new OpenLayers.Bounds(180400.66, 328735.739, 185428.586, 333465.375));
}