View Full Version : Use PanTo for recenter a map

30 Nov 2011, 7:08 AM

I have a problem with a map
I don't know why the panTo function don't work in my code...
The application don't want to go to my map panel with this code:

addMap: function(latitude, longitude) {
var center = new google.maps.LatLng(latitude, longitude);
var map = new Ext.Map ({
mapOptions : {
center: center,
zoom : App.config._MapMapZoom,
mapTypeId: App.config._MapMapTypeId,
navigationControlOptions: {
style: App.config._MapNavigationStyle
map.panTo(new google.maps.LatLng(latitude, longitude));
return map;

I think for recenter the map each time i call the function addMap with different longitude / latitude but panTo don't work ...

Can you help me please ?

30 Nov 2011, 11:30 AM
This forum is for Sencha Touch discussion, not google maps.