让 KML 图层在本地工作(例如 Google TooManyMarkers 示例)
我已复制 Google 示例的所有文件 http:// gmaps-samples-v3.googlecode.com/svn/trunk/toomanymarkers/toomanymarkers.html 到我的电脑,但当我勾选复选框。
我复制的文件是:
- functions.jsmarkers.jsmarkers.kmltomanymarkers.html
- =
- http://www.performit.co.uk/misc/maps/tooomanymarkers/toomanymarkers.html
- "
我还将这些复制到http://www.performit.co.uk/misc/maps/tooomymarkers/tooomymarkers.html 那里也不起作用。
我错过了什么吗?我需要设置环境来加载文件吗?
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 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
KML 文件必须可通过网络公开访问,因此如果您在本地进行开发,这将不起作用。 Google 访问并处理该文件,以位置、缩放级别、标记、折线、多边形等形式返回该数据。KML
文件的实际 URL 是什么?复制该内容,并将其粘贴到 GoogleMaps 的搜索地图框中。如果它是有效的 KML,GM 将对其进行处理并显示您的 KML 数据。
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.
这似乎是网络服务器配置问题。当我尝试访问 http://www.performit.co.uk/ Misc/maps/tooomymarkers/markers.kml,我收到 500 服务器错误。在我看来,functions.js 尝试访问该 URL。所以,我会调查一下。相比之下,http://gmaps-samples-v3.googlecode。 com/svn/trunk/tooomanymarkers/tooomymarkers.html 愉快地提供 KML 文件。
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.