I'm looking to integrate Google Maps into my program, but I've encountered an error stating that 'a is null' when using a variable in the Google Maps API. Below is my current implementation:
//Creates a new center location for the google map
var latlng = new google.maps.LatLng(centerLatitude, centerLongitude);
//The options for the google map
var myOptions = {
zoom: 7,
maxZoom: 12,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
//Creates the new map
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
Here is the corresponding HTML tag:
<div id = "map_canvas"></div>
The latitude and longitude values are correctly passed through the URL on page load, so that's not the issue. I suspect it may be related to the
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
line. Any insights?
EDIT: Error message received:
a is null fromLatLngToPoint(a=null) yg(a=null, b=Object { zoom=7, maxZoom=12, more...}) d(d=Document Default.aspx?lat=30.346317&lng=105.46313, f=[function()]) d(a=undefined) d() [Break On This Error] function Qf(a){a=a.f[9];return a:...);function sg(a){a[ic]&&a[ic]Vb}