[OpenLayers-Users] Lon Lat Coordinates set to 0,
0 after change layer from google to osm
stash
steffen.schwarz85 at googlemail.com
Mon Mar 14 05:58:57 EDT 2011
Hello,
I'm using the LayerSwitcher in OpenLayers to change between an OSM Layer and
a Google Layer. This works fine. But the problem is, that the lon lat
coordinates are changed after changing the layer. This means, that I don't
get the same view ot my map after changing the layer. I looked up the
example of the openlayers homepage
http://openlayers.org/dev/examples/osm-google.html
http://openlayers.org/dev/examples/osm-google.html
Here it is working fine. The Layer is changed and the map doesn't move. I
used the same source code but every time i change the layer the position of
the map is changed to lon,lat 0,0. for example, when my map currently
displays australia and i change my layer from google to osm (from osm to
google it is the same) the position of the map is changed and my map is
displaying a position in the ocean south of africa (position 0,0).
what can i do that the position doesn't change after changing the layer?
I already tried one thing. I defined a 'changelayer' event, saved the
coordinates of my map and set this coordinates with map.setCenter,
furthermore I did an map.updateSize();
this is working, when i change the layer from osm to goole, but when i
change the layer from google to osm, the position still changes to 0,0.
I hope someone can help me to solve this problem.
Thank you.
Best Regards
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Lon-Lat-Coordinates-set-to-0-0-after-change-layer-from-google-to-osm-tp6168415p6168415.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list