Usuario anónimo  |  Ingresar  |  Regístrate
Mensaje dentro Bugs and Improvements

setCenter doesn't work when the map is not visible

Responder 
#1 - 28/05/2009 19:58:23 Reporta abuso | Link permanente
btbowden
Fecha de registro: 20/05/2009
5 posts en todos los foros
setCenter doesn't work when the map is not visible

Responder Citar
I have a map in a tab control with the active tab not set to the map.  Therefore after the page loads you have to click the map tab to view the map.  The problem is that setCenter doesn't work properly or unless i have the map tab selected when setCenter method is called.  If the map tab isn't selected then it is always off about 10 degrees in both directions.
I have also simulated the same behavior by just making the control's style "display:hidden" and then showing it via javascript after the setCenter method is called.
Here is the code on page load to center the map to the US.

gmap.reset();
gmap.setCenter(new GLatLng(45, -95), 4);
Volver arriba

Respuestas
De en 15
#2 - 15/06/2009 8:49:08 Reporta abuso | Link permanente
subgurim
Fecha de registro: 18/10/2006
2003 posts en todos los foros
RE: setCenter doesn't work when the map is not visible

Responder Citar
Please, take a look here: http://googlemaps.subgurim.net/ejemplos/ejemplo_999999_Basico_3.aspx
Volver arriba
De en 15

Powered by Subgurim.NET