问题描述
我试图弄清楚如何使用Google Maps API v3标记最初在ArcGIS Desktop中创建的kml折线.不幸的是,到目前为止,我遇到的示例似乎都不适用于kml文件,链接无效,或者是有关如何创建弹出窗口的示例.
I am trying to figure out how to use Google Maps API v3 to label a kml polyline that was originally created in ArcGIS Desktop. Unfortunately, the examples that I came across thus far either don't seem to apply to kml files, had dead links, or were examples on how to create pop-ups.
如果有人举了一个如何从kml文件创建标签(而不是弹出窗口)的示例,请告诉我.
If anyone has an example of how to create labels (not popups) from a kml file let me know.
侧面问题:
**在ArcGIS中,我可以使用图层"->属性"->"HTML弹出窗口"为kml配置弹出窗口.我需要在ArcGIS中做什么来指定要用作标签的属性?
*In ArcGIS I can use Layer->Properties->HTML Popup to configure the popup for kml. What do I need to do in ArcGIS to specify what attribute I want to use as my label?
*我可以使标签仅在某些分辨率下显示吗?
*Can I make labels appear only at certain resolutions?
推荐答案
您不能使用 Google Maps Javascript API KmlLayer ,如果您的KML不太复杂,则可以使用第三方解析器(例如 geoxml3 或 geoxml-v3 )将您的KML呈现为原生Google Maps Javascript API v3折线,并在其中添加标签.
You can't add labels using the Google Maps Javascript API KmlLayer, if your KML isn't too complicated, you can use a third party parser (like geoxml3 or geoxml-v3) to render your KML as native Google Maps Javascript API v3 Polylines, and add labels to those.
标签选项:
- polyline with label in javascript
- MapLabel
- InfoBox
这篇关于在Google Maps API v3中标记kml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!