基于KML文件中的值的标记的动态变化 [英] Dynamic change of marker based on value in KML file

查看:99
本文介绍了基于KML文件中的值的标记的动态变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用KML文件在Google地图上覆盖我的数据。实际上,我想根据KML文件中的某些值更改标记颜色。



我该怎么做。首先,KML支持图标的样式,但是< color> 对于< iconStyle> ,Maps-API不支持code> -element,因此您无法更改图标的颜色(请参阅 https://developers.google.com/kml/documentation/kmlelementsinmaps 了解更多详情)。



你可以做的是使用不同的图标图像与所需的颜色。



但afaik没有动态方式更改<图标> < href> 。然而,您可能会创建一个服务器端脚本来解析原始KML并将修改后的KML提供给Google。




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 .

解决方案

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.

这篇关于基于KML文件中的值的标记的动态变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆