Dynamic change of marker based on value in KML file

南楼画角 提交于 2019-12-24 09:26:50

问题


I am using KML file to overlay my data on google map . Actually I want to change the marker color based on some value which in the KML file .

How can I do that .


回答1:


First of all: KML supports the styling of icons, but the <color>-element is not supported for <iconStyle> by the Maps-API, so you cannot change the color of an Icon(see https://developers.google.com/kml/documentation/kmlelementsinmaps for more details).

What you can do is use different icon-images with the desired colors.

But afaik there is no "dynamic" way to change the <href> of an <icon>.

However, you may create a serverside script that parses the original KML and delivers a modified KML to google.



来源:https://stackoverflow.com/questions/13494175/dynamic-change-of-marker-based-on-value-in-kml-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!