Reputation: 46
I am having an issue with google maps api v3. Up until this point a lot of what I could not work out was easily solved with a quick search and with 9 out 10 solutions found on here. Unfortunatly I've been unable to find anything on the errors below.
The map was working fine this morning but work I've done since has somehow started producing errors even though it continues to work. When I zoom in and out there errors below begin to display in the console output.
Uncaught TypeError: Cannot read property 'Fa' of undefined Uncaught TypeError: Cannot read property 'x' of undefined
I've checked and double checked my code. I cannot see where and why this error is produced. I am new to JS and html but not new to coding.
Could someone have a look at my page and see if there is anything that stands out which would produce these errors?
Here is the link to the page I am working on. http://scotflash.co.uk/html52014/pages/guestbook/guestbook.html
Upvotes: 0
Views: 1647
Reputation: 117344
There are guestbook-entries with an empty img
-attribute, the error occurs when you try to create the marker with the empty img
. You need a fallback for this case, e.g.:
var marker = new google.maps.Marker({
position: latLng,
icon: (guestbookData[i][4])?pin:'http://www.google.com/mapfiles/marker.png',
shadow:(guestbookData[i][4])?pinBackground:null,
id:guestbookData[i][0],
con:gbID,
title: "@"+name+" .::. "+guestbookData[i][0]
});
Upvotes: 1