谷歌地图显示KML数据

Google Maps display KML data

本文关键字:数据 KML 显示 谷歌地图      更新时间:2023-09-26

我有KML字符串,我想在谷歌地图上显示它。我有字符串,而不是文件。这是因为我在Fusion表中有我的KML数据,我需要做一些类似的事情:https://developers.google.com/fusiontables/docs/samples/custom_markers

我只有KML数据,没有坐标,所以我不确定如何显示。

我试过了,但没用:

var marker = new google.maps.Marker({
      map: map,
      position: '<polygon>....</polygon>',
      icon: new google.maps.MarkerImage('https://developers.google.com/fusiontables/docs/samples/images/fusion_tables-32.png')
 });

非常感谢您的帮助!

谢谢!

看看这些

geoxml3项目致力于开发一个用于Google Maps JavaScript API版本3的KML处理器,它现在允许访问从KML渲染的单个标记、多段线和多边形。

KML 的一些有用演示

我看到了这条线:https://developers.google.com/fusiontables/docs/samples/change_infowindow_content

它回答了我的问题!