I have a layer showing buildings in Singapore. I have it set up as a WMS
layer, but as I wanted to learn more about vector layers, am trying to add
the same data as a vector layer just as an experiment.
At the initial zoom level, there are about 20 simple polygons, which
shouldn't be too large for the map.
However, the vector version of the layer is very slow to load, and when I
checked Fiddler and Firebug, found that is returning almost 3MB of data.
Checking the node count in the results against the database confirmed that
it's returning the entire layer.
The code for the vector layer was mostly taken from the OL demo pages. (I
found I had to add the geometryName parameter.)
var lyrBuildingsVector = new OpenLayers.Layer.Vector("Buildings Vec", {
styleMap: ocStyleMap,
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
url: GeoServerWFSAddress,
featureType: "building_3414",
featureNS:"http://mynamespace/demo",
geometryName: 'geom_3414'
})
});
//Singapore's projection:
var options = {projection: 'EPSG:3414',
displayProjection: 'EPSG:4326',
numZoomLevels: 10,
maxExtent: new OpenLayers.Bounds(0, 14482.03459,
54313.2955286349, 60381.0195956435),
units: 'm'
}
This is the base layer:
var ags_map_service = new OpenLayers.Layer.ArcGIS93Rest(
"SNG",
SNG_Server,
{
LAYERS: 'all:0',
IMAGESR: '3414',
BBOXSR: '3414',
FORMAT: 'jpg',
TRANSPARENT: false
},
{
maxExtent: new OpenLayers.Bounds(0, 14482.03459,
54313.2955286349, 60381.0195956435),
units:'m',
maxScale: 255104,
minScale: 498,
projection: proSNG,
buffer: 1
}
);
The data is in a PostGIS database and runs on GeoServer. However, I was
using SHP files previously, and had the same problem.
Rohan Parkes
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users