Gmap3 - Forum

Gmap3 exchange platform

You are not logged in.

Ads
(server costs 27.50€ per month)

#1 2011-11-23 16:18:34

alex
Member
Registered: 2011-11-23
Posts: 3

panToBounds

Hello,

I'm having issues using this code:

var southWest = new google.maps.LatLng(d3,d4);
var northEast = new google.maps.LatLng(d1,d2);
var bounds = new google.maps.LatLngBounds(southWest,northEast);

$("#divmap").gmap3({
     action:'panToBounds',
     LatLngBounds:bounds					  	
});	

i have this result :

Error: panToBounds: latLngBounds must be of type LatLngBounds
Source File: http://maps.gstatic.com/intl/en_gb/mapf … /2/main.js Line: 123

A little help with this, please.

Thanks in advance,

Alex

Offline

Ads
(server costs 27.50€ per month)

#2 2011-11-24 20:19:25

jbdemonte
Administrator
From: Pourrières, France
Registered: 2011-11-21
Posts: 472

Re: panToBounds

Hum,

In fact, your are trying to use gmap3 by the transparancy way ...

I mean, of course, i didn't wrote all the google api smile

You are trying to use functions from the google.maps.Map

So two ways to do that :

I recommand to get the pure google.maps.Map object using the get function, and then call these you want

$("#divmap").gmap3("get").panToBounds(bounds);

Else, through gmap3 using args array:

$("#divmap").gmap3({
     action:'panToBounds',
     args:[bounds]
});	

The second way is not my prefered but it should works to smile

Offline

#3 2011-11-28 11:44:37

alex
Member
Registered: 2011-11-23
Posts: 3

Re: panToBounds

indeed, that's solving my problem.

Merci

Offline

Board footer

Powered by FluxBB