如何获取导入的谷歌地图地标的描述

How to get descriptions of imported Google maps landmarks?

本文关键字:谷歌地图 描述 导入 何获取 获取      更新时间:2023-12-25

简单地说:我在Mymaps中创建了一个地图,保存了位置(点击地标,"保存到.."),我自定义了图标并保存了。这是我的地图。然后,我导出了kml文件,并使用GeoXMLV3和带有javasctipt的GoogleMapsneneneba API V3将其导入到一个网页中,以便有一个漂亮的侧边栏。正如你所看到的,点击我在GMaps中的地标,我可以获得地址,"更多信息",网站和描述,相反,在我的网页中,所有这些信息都不可用。使用选项"可点击:true"。我不知道使用Google Maps API或解析器GeoXML v3中的一些选项是否可以解决问题。有人能帮我吗?非常感谢。

<script type="text/javascript">
        var Tenuta=new google.maps.LatLng(43.246266,11.295608);
        var mapDiv = document.getElementById('map-canvas');
        var map = new google.maps.Map(mapDiv, {center: new google.maps.LatLng(43.246266,11.295608),zoom: 10,mapTypeId:google.maps.MapTypeId.TERRAIN,clickableLabels:true});

        ...

        var base = "../../content/siena/map/example.kml"
        var path = base;
        var myParser = new GeoXml("myParser", map, path, {nozoom:true, titlestyle: 'id="infowindowsTitle" ',sidebarid: "the_side_bar",allfoldersopen:true,iwwidth:1, iwheight:1});
        myParser.parse("Point of interest next to Tenuta la Santissima");

</script>

您可以使用DomParser通过代码读取KML。请看一下https://stackoverflow.com/a/53183890/2360310.