[OpenLayers-Users] Problem with WFS layer on map.setCenter()

Nils Weinander nils.weinander at curalia.se
Fri Apr 24 07:15:30 EDT 2009


Hi all

I have a WFS layer, with a BBOX strategy, created like:

var platsr_wfs = new OpenLayers.Layer.WFS(
     "PlatsR",
     wfsUrl,
     {
         typename: "PLATSR:PLATSR_WMS"
     },
     {
         strategies: [
             new OpenLayers.Strategy.BBOX()
         ],
         protocol: new OpenLayers.Protocol.HTTP(
             {
                 url: wfsUrl,
                 params: {
                     format: "WFS",
                     service: "WFS",
                     request: "GetFeature",
                     version: "1.0.0",
                     srs: "EPSG:2400",
                     typename: "PLATSR:PLATSR_WMS"
                 },
                 format: new OpenLayers.Format.GML(
                     {
                         geometryName: 'GEOMETRI'
                     }
                 )
             }
         ),			
         geometry_column: "GEOMETRY",
         maxExtent: bounds,
         projection: "EPSG:2400",
         scales: [4000000, 2000000, 
1000000,750000,500000,250000,150000,100000,75000,50000,25000,20000,15000,10000,5000,2500],
         styleMap: new OpenLayers.StyleMap(
             {
                 "default": placeStyle
             }
         )
     }
);
map.addLayer(platsr_wfs);

This works fine when I pan and zoom the map manually. But, on

map.setCenter(new OpenLayers.LonLat(x, y), 5, true, true);

I get an error in Bounds.intersectsBounds because the WFS layer's
renderer has extent==null.

Any obvious mistakes? Any ideas where to look further?

Oh, OL version is 2.7.

-- 
Nils Weinander  |  Systems Designer
Phone +46 (0)8 4100 6456
Mobile +46 (0)709 78 28 37
--
Mogul | f.d. Curalia AB  |  www.mogul.com
Hudiksvallsgatan 4, 113 30 Stockholm, Sweden
--



More information about the Users mailing list