I’m trying to create an overlay from a file I have hosted on a server. I’ve been looking at the Google Maps API v3 documentation but I am stuck right now. As I understand from this part of the documentation, I can use new KmlLayer(url: "http://www.mydomain.com/kmllayer.txt");
to call the layer file. When I open the page, I get an error in the console stating: “Uncaught ReferenceError: KmlLayer is not defined”
I have been able to use this layer by going to maps.google.com and entering the url where the kml layer file is located into the search bar and it shows up fine so I know the issue is not with the layer itself.
Any ideas?
There are a couple possibilities:
You are calling the wrong function. The correct syntax is:
new google.maps.KmlLayer(“http://my.public.server/file.kml”, options);