javascript Google Map V3 - 显示来自 XML 提要的标记

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4591129/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 14:14:36  来源:igfitidea点击:

Google Map V3 - Displaying markers from XML feed

javascriptgoogle-maps

提问by user547794

I have an XML feed of marker data that I want to plot on a Google map. The XML data I have is in this format:

我有一个标记数据的 XML 提要,我想在 Google 地图上绘制它。我拥有的 XML 数据采用以下格式:

<markers>
<marker  uid="2" filesUploaded="" lat="101.00000000000" lng="112.00000000000"/>
<marker  uid="2" filesUploaded="" lat="132.00000000000" lng="112.00000000000"/>
<marker  uid="2" filesUploaded="" lat="143.00000000000" lng="111.00000000000"/>
<marker  uid="2" filesUploaded="" lat="134.00000000000" lng="112.00000000000"/>
</markers>

I had this working in V2 but am not sure for V3.

我在 V2 中使用过这个,但不确定 V3。

回答by free_easy

回答by Argiropoulos Stavros

First of parse the xmland for each marker in your xml create a marker

首先解析 xml并为xml中的每个标记创建一个标记