Jump to content

Google Maps Help (Long And Lat Not Working)


Tenaciousmug

Recommended Posts

$(document).ready(function() {
var lng = get_url_parameter('long');
var lat = get_url_parameter('lat');
if(lng==null && lat==null) {
 var mapOptions = {
  zoom: 8,
  center: new google.maps.LatLng(-34.397, 150.644),
  mapTypeId: google.maps.MapTypeId.ROADMAP
 };
} else {
 var mapOptions = {
  zoom: 8,
  center: new google.maps.LatLng(lat, lng),
  mapTypeId: google.maps.MapTypeId.ROADMAP
 };
}
var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
});

 

Now when the long and lat parameters in the URL are null, the map loads fine with the preset coordinates. But when the long and lat parameters are passed. For example, this is what I'm passing to the URL right now : long=2277103.99355757&lat=421953.402769517

It's grabbing the parameters as I did the whole alert(lat); and it alerts the appropriate value.

However, it won't load the map. It's just a grey block.

Anyone know the issue here??

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.