[OpenLayers-Users] problem with overlay and baselayer position
giuseppe naponiello
beppenapo at gmail.com
Mon Feb 27 05:25:43 EST 2012
Hi all,
I have a map with google satellite as base layer and 4 overlay (wms and
wfs-t).
At max extent the overlay position it's ok, but when I zoom (in or out)
or pan my overlay shift from the correct position, and more I move or
zoom and more they shift.
Below a snippet of my code:
"
... map = new OpenLayers.Map ("map", {
controls:[
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PanZoom(),
new
OpenLayers.Control.MousePosition({div:document.getElementById("coord")}),
],
maxResolution: 'auto',
restrictedExtent: new OpenLayers.Bounds(1371582.407, 5713434.5,
1549436.723, 5884793.979),
maxExtent: new OpenLayers.Bounds (1371582.407, 5713434.5, 1549436.723,
5884793.979),
units: 'm',
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326")
});
gsat = new OpenLayers.Layer.Google("Satellite", {type:
google.maps.MapTypeId.SATELLITE, numZoomLevels: 22});
map.addLayer(gsat);
var prova = new OpenLayers.Layer.Vector("Prova", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
version: "1.0.0",
url: "http://localhost:8080/geoserver/wfs",
featureType: "prova",
srsName: "EPSG:900913",
featureNS: "http://www.geoserver.org/test",
geometryName: "the_geom",
schema:
"http://www.geoserver.org/test?service=WFS&version=1.0.0&request=DescribeFeatureType&TypeName=test:prova"
})
});
map.addLayer(prova);
var centuriazioni = new OpenLayers.Layer.WMS(
"Centuriazioni",
"http://localhost:8080/geoserver/wms",
{srs: 'EPSG:900913',
layers:
'localhost:fvg_centurie_pn,localhost:fvg_centurie',
format: 'image/png',
tiled: 'true',
transparent: true
},{isBaseLayer: false, visibility: false}
);
map.addLayer(centuriazioni);
... "
I don't know where is the problem but I know it is really annoying and I
need to resolve it as soon as possible.
thanx a lot ;)
-beppe-
More information about the Users
mailing list