Tenaciousmug Posted October 18, 2012 Share Posted October 18, 2012 $(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?? Quote Link to comment https://forums.phpfreaks.com/topic/269649-google-maps-help-long-and-lat-not-working/ Share on other sites More sharing options...
requinix Posted October 18, 2012 Share Posted October 18, 2012 Unless I'm forgetting something really important, those latitude and longitude numbers you're providing are way out of range. Quote Link to comment https://forums.phpfreaks.com/topic/269649-google-maps-help-long-and-lat-not-working/#findComment-1386155 Share on other sites More sharing options...
codefossa Posted October 18, 2012 Share Posted October 18, 2012 Requinix is correct. Latitude goes from -90 to 90 and longitude goes from -180 to 180. Quote Link to comment https://forums.phpfreaks.com/topic/269649-google-maps-help-long-and-lat-not-working/#findComment-1386181 Share on other sites More sharing options...
Tenaciousmug Posted October 19, 2012 Author Share Posted October 19, 2012 Hmm okay, thanks everyone. Let me ask my client that I'm doing this project for. All of the coordinates are out of range then.. Hopefully I just have to convert them to something use a mathematical equation or something! Quote Link to comment https://forums.phpfreaks.com/topic/269649-google-maps-help-long-and-lat-not-working/#findComment-1386292 Share on other sites More sharing options...
JustLikeIcarus Posted October 24, 2012 Share Posted October 24, 2012 For example, this is what I'm passing to the URL right now : long=2277103.99355757&lat=421953.402769517 I dont belive those coordinates exist on the planet... Could be the issue you are seeing. Quote Link to comment https://forums.phpfreaks.com/topic/269649-google-maps-help-long-and-lat-not-working/#findComment-1387421 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.