Why GLatLng() doesn't receive variables?

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-04-28T19:17:35Z Indexed on 2010/04/28 19:27 UTC
Read the original article Hit count: 294

Filed under:
|

Hi, i have the following code to update a google map:

function updateit(c1,c2){
alert(c1+"-"+c2); // This works
map.setCenter(new GLatLng(c1, c2), 13); // But this doesn't
}

updateit(37.4419, -122.1419);

The alert is working and show the two coordinations, but i think the GLatLng() doesn't receive them, so the map is not updated unless i directly declare them as strings :

function updateit(c1,c2){
map.setCenter(new GLatLng(37.4419, -122.1419), 13); // This works
}

How to fix this problem?

Thanks

© Stack Overflow or respective owner

Related posts about google-maps

Related posts about JavaScript