开发者

Getting KML layer to work locally (e.g. the Google TooManyMarkers Example)

开发者 https://www.devze.com 2023-03-09 01:05 出处:网络
I have copied all of the files for the Google example http://gmaps-samples-v3.googlecode.com/svn/trunk/toomanymarkers/toomanymarkers.html to my PC, but the KML layer does not appear when I tick the ch

I have copied all of the files for the Google example http://gmaps-samples-v3.googlecode.com/svn/trunk/toomanymarkers/toomanymarkers.html to my PC, but the KML layer does not appear when I tick the checkbox.

The files I copied are:

  • functions.js
  • markers.js
  • markers.kml
  • toomanymarkers.html

I have also copied these 开发者_JS百科to http://www.performit.co.uk/misc/maps/toomanymarkers/toomanymarkers.html and it doesn't work there either.

Am I missing something? Do I need to have an environment set up for the files to load?


The KML file must be publicly accessible via the web, so this will not work if you are developing locally. Google accesses and processes the file, returning that data as location, zoom level, markers, polylines, polygons, etc.

What is the actual URL to your KML file? Copy that, and past it into the Search Maps box of GoogleMaps. If it's valid KML, GM will process it and display your KML data.


It appears to be a web server configuration issue. When I try to access http://www.performit.co.uk/misc/maps/toomanymarkers/markers.kml, I get a 500 server error. It appears to me that functions.js tries to access that URL. So, I'd look into that. By comparison, http://gmaps-samples-v3.googlecode.com/svn/trunk/toomanymarkers/toomanymarkers.html happily serves up the KML file.

0

精彩评论

暂无评论...
验证码 换一张
取 消