PHP Noob PHP Noob - 1 year ago 325
HTML Question

Google Maps API: TypeError: a is undefined

I have searched this problem all over the web and none of them seem to give me any resolution. I have a simple script to just display the map of South Africa.

<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge, chrome=1" />
<title>Map Test</title>
<script language="javascript" src=""></script>
#map-canvas {
height: 300px;
width: 980px;
margin: 0;
padding: 0;
margin-top: 10px;
<div id="map-canvas" class="map_canvas"></div>
<script type="text/javascript">
function initialize()
var mapOptions = {
center: new google.maps.LatLng(-29.09958,26.18434),
zoom: 5,
mapTypeControlOptions: {
position: google.maps.ControlPosition.TOP_LEFT
map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions);
google.maps.event.addDomListener(window, 'load', initialize);

But I keep on getting the same error over and over. I have even tried on a different server.

enter image description here

Please help

Answer Source

I've also seen this error often in the last days, there seems to be an issue with the experimental API-version.

Load the release-version instead(basically you should always load the release-version in production)

<script language="javascript" src=""></script>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download