在Bing地图中更改多边形的颜色 [英] Change polygon's color in Bing Maps

查看:101
本文介绍了在Bing地图中更改多边形的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在悬停或选择时将地图上绘制的多边形的默认颜色更改为其他颜色。如何在悬停时更改它以突出显示所选多边形?

I want to change the default color of polygon which plotted on map to other color on hover or select. How can I change it on hover to highlight the selected polygon?

我可以选择在绘制地图之前更改多边形的颜色。但是我想在悬停/选择时更改绘制多边形的颜色。

I am getting option to change the polygon's color before plotting it on map. However I want to change the color of plotted polygon on hover/select.

谢谢!

推荐答案

以下是如何为图钉执行此操作的示例:  http://bingmapsv8samples.azurewebsites.net/#Pushpin_HoverStyle

此样本还会将悬停的形状置于顶部,以防它位于地图上的其他形状下方。 

This sample also brings the hovered shape to the top in case it is below other shapes on the map. 

您可以执行此操作多边形完全相同,但根据需要更改传入fillColor和strokeColor的选项。

You can do the exact same thing for polygons, but change the options you pass in to fillColor and strokeColor as desired.


这篇关于在Bing地图中更改多边形的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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