image - 如何在必应地图中旋转图钉图像?
问题描述
我正在尝试根据度数旋转图钉图像,例如“120”以显示它的方向。
var pushpin = new Microsoft.Maps.Pushpin(curlocation, {
icon: '/images/Airplane_icon.png',
anchor: new Microsoft.Maps.Point(20, 20),
color: 'red'
});
解决方案
可以在 Bing 地图中旋转图钉,但需要一些代码来实现。这里有一个代码示例: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
推荐阅读
- python - python Matplotlib tight_layout() 永远无法正常工作
- python - 使用 axhline 时 xmin 位置未按预期定位
- azure - 请求中指定的回复 URL 与回复 URL 不匹配
- docker - OPA Envoy - 带有 http.send 的策略在负载下失败
- python - post_list() 缺少 1 个必需的位置参数:“请求”
- arrays - C 标准的 `&`-exception 对数组到指针类型转换规则的目的是什么?
- flutter - 在颤振 sdk 中向类添加方法的最佳方法是什么?
- c# - System.IO.FileNotFoundException:无法加载文件或程序集'FluentAssertions,版本 = 5.10.3.0
- angular - 在 RadCalendar 年视图上显示事件
- android - 如何在 Kotlin 中编写一个从 Firestore 返回字符串的方法?