Hi Rohan
1) include the Singapore’s projection proj4js definition :
<script src="proj4js/lib/proj4js.js
<view-source:http://mapakrakow.pl/%7Ebbarni/mk4/proj4js/lib/proj4js.js>"></script>
<script src="proj4js/lib/defs/EPSG3414.js
<view-source:http://mapakrakow.pl/%7Ebbarni/mk4/proj4js/lib/defs/EPSG2180.js>"></script>
2) Configure proxy server:
OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";
(geoserver work on port 8080)
3) featureNS - it should be the same URL you provided to GeoServer when you
created the namespace.
4) check your stylemap object
5) don't use the namespace prefix in the featuretype.
(http://comments.gmane.org/gmane.comp.gis.openlayers.user/12319)
{
url: "/MyApp/Proxy.ashx",
featureType: "boundary",
featurePrefix: "mystore",
version: "1.1.0"
})
6) use:
srsName: "EPSG:3414",
in Your protocol: new OpenLayers.Protocol.WFS
7) try to add: featurePrefix: and schema: parameters to OpenLayers.Protocol.WFS
BR
Bartek
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
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users
_______________________________________________
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users