Thank you for the info about that page! I found there very interesting stuff.
I was trying to update my code, and make it work...but unfortunately I have
not succeed. My code looks like that now:
var map = new OpenLayers.Map("map", {
projection: new OpenLayers.Projection("EPSG:900913"),
});
var myBaseLayer = new OpenLayers.Layer.Google("Google",
{'sphericalMercator': true,
'maxExtent': new
OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34)
});
map.addLayer(myBaseLayer);
var geom ="LINESTRING(15.535221 51.938251,15.534851
51.938159,15.53443
51.938121,15.533781 51.938148,15.533221 51.938159,15.53292
51.938179,15.53286 51.937881)";
var options1 = {projection: "EPSG:4326"};
var vectorLayer = new OpenLayers.Layer.Vector("Vector
Layer",options1);
map.addLayer(vectorLayer);
var streetGeom = new OpenLayers.Geometry.fromWKT(geom);
var streetFeature = new
OpenLayers.Feature.Vector(streetGeom);
vectorLayer.addFeatures([streetFeature]);
var bounds1 = streetFeature.geometry.getBounds();
map.zoomToExtent(bounds1);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new
OpenLayers.Control.MousePosition({numDigits:6}));
Zooming go in the middle of ocean - not good at all... Can anyone see any
error in code?
Regards,
Paul
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Google-Maps-layer-with-vector-layer-wrong-position-of-geometry-tp5886431p5886987.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users