简体   繁体   English

如何在bing map wpf c#上绘制贝塞尔曲线折线?

[英]How can I draw a bezier curve polyline on a bing map wpf c#?

Bing maps library for wpf seems not to include any helper to draw a bezier curve. WPF的Bing地图库似乎不包含任何帮助绘制bezier曲线的工具。 It has MapPolyLine which can be used to draw straight lines between n points. 它具有MapPolyLine,可用于在n个点之间绘制直线。 Any solution? 有什么办法吗?

Thanks 谢谢

Bing Maps does not support curved geometries directly, so instead can approximate the shape of a curved line by creating a polyline containing several small segments. Bing Maps不直接支持弯曲的几何图形,因此可以通过创建包含多个小段的折线来近似曲线的形状。

Hope this article will help https://alastaira.wordpress.com/2011/06/27/geodesics-on-bing-maps-v7/ 希望本文对https://alastaira.wordpress.com/2011/06/27/geodesics-on-bing-maps-v7/有帮助

Alternatively to using geodesic, if you don't care about being spatially accurate you can take your coordinates, convert them to pixel coordinates at zoom level 19 using the code here: https://msdn.microsoft.com/en-us/library/bb259689.aspx 除了使用测地线之外,如果您不关心空间精确度,可以获取坐标,并使用以下代码将其转换为缩放级别19的像素坐标: https : //msdn.microsoft.com/zh-cn/library /bb259689.aspx

Then pass the pixel coordinates through a standard Bezier curve algorithm. 然后,通过标准的贝塞尔曲线算法传递像素坐标。 Take the resulting values and convert them back to locations. 取结果值并将其转换回位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM