1

I have an OpenLayers app to plot point features, but need to read in a very detailed multipolygon vector layer to plot an accurate location.

I'm currently loading the polygon layer via TinyOWS. I've set maxZoom to 2000 in OpenLayers and am using BBOX strategy. When I zoom in the first load is ok, but the whole layer gets loaded and I can see it when I zoom out despite the maxZoom.

The application now runs too slowly.

I'm new to this and wondered if someone could point me in the right direction. I got some pointers here: Different level of detail(layers) on different zoom level at OpenLayers map and here: OpenLayers GML Polygon Performance

Here's the WFS call for the polygon layer:

pos_skotsel = new OpenLayers.Layer.Vector("Pos_Skötsel", {
    strategies : [new OpenLayers.Strategy.BBOX()],
    projection: new OpenLayers.Projection("EPSG:4326"),
    protocol: new OpenLayers.Protocol.WFS({
        version: "1.1.0",
        srsName: "EPSG:4326",
        url: "http://XX.XXX.XXX.XXX/cgi-bin/tinyows",
        featurePrefix: "tows",
        featureNS :  "http://www.tinyows.org/",
        featureType: "XXXX",
        maxScale: 2500,
        geometryName: "geom"
    })
}); 

map.addLayers([gphy, wfs, pos_skotsel]);
2

I've worked out I need to serve this polygon layer as WMS - which I've done with geoserver - now loading reasonably quickly. Mini

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.