如何在bing地图中旋转图钉图像?

问题描述 投票:0回答:1

我正在尝试根据例如“ 120”的角度旋转图钉图像,以显示其前进的方向。

 var pushpin = new Microsoft.Maps.Pushpin(curlocation, {
                icon: '/images/Airplane_icon.png',
                anchor: new Microsoft.Maps.Point(20, 20),
                color: 'red'
            });
image bing-maps pushpin
1个回答
0
投票

可以在Bing Maps中旋转图钉,但需要一些代码才能实现。这里有一个代码示例:https://bingmapsv8samples.azurewebsites.net/#Pushpin_RotatedImage这种方法对几个图钉都适用,但是如果您有很多图钉的旋转都不同,或者图钉的旋转频繁更新,则此解决方案可能不会是最好的选择。

[另一个考虑因素是看一下Azure Maps,这是另一个Microsoft映射平台,它确实支持旋转地图上的图标。这是一个示例:https://azuremapscodesamples.azurewebsites.net/index.html?sample=Symbol%20Layer%20Options(单击图标选项选项卡并移动旋转滑块)。 Azure Maps可以轻松处理大型数据集上的动态旋转值。以下是几个相关示例:https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20a%20Symbol%20along%20a%20Path

https://azuremapscodesamples.azurewebsites.net/index.html?sample=Add%20Arrow%20along%20a%20Path

© www.soinside.com 2019 - 2024. All rights reserved.