Consider the following code:
$('.stores').click(function() {
console.log($(this).data('latitude')); // -1754.26265626
console.log($(this).data('longitude')); // 65.262518
console.log(themap); // Properly a Google Map instance.
themap.setCenter(new LatLng($(this).data('latitude'), $(this).data('longitude')));
});
According to the documentation, I can use the setCenter method and easily center the map, but I don’t understand the notation the docs are using.
See:
LatLng(lat:number, lng:number, noWrap?:boolean)
How exactly do I use this?
I’m getting the error:
Uncaught ReferenceError: LatLng is not defined
You have to use
All Google Maps javascript classes are referenced with the
google.maps.ClassName()notation