[Users] Map center inkorrekt

Juan Rapoport juanrapoport at suremptec.com.ar
Mon Jul 2 14:29:19 CEST 2012


The map is in EPSG:900913 coordinate system, and you are trying to set the
map center in EPSG:4326 coordinate system (lat /lon).
You can transform coordinates like this:

var point = new OpenLayers.Geometry.Point(8.5315623, 49.4100709);
var EPSG4326 = new OpenLayers.Projection('EPSG:4326');
var EPSG900913 = new OpenLayers.Projection('EPSG:900913');
point.transform(EPSG4326, EPSG900913);

and then center the map:

center: [point.x, point.y]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20120702/c6b9c96b/attachment.htm 


More information about the Users mailing list