如何使用 Google Maps API 获取一个粗糙的多边形并使其成为贝塞尔曲线?
假设我有一个构成多边形的 LatLng 点数组。有没有办法让它看起来更平滑,看起来更像曲线。
我想这需要某种处理来将点插入到数组中,并带有某种阈值以防止点变得太多。
Let's say I have an array of LatLng points which make up a polygon. Is there anyway to smooth it out to look more curve like.
I imagine it would require some kind of processing to insert points into the array with some some sort of threshold to prevent the points from getting too numerous.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您能做的最好的事情就是使用曲线在每个 LatLng 点之间绘制曲线。没有内置算法来添加积分等。您必须自己在后端执行此操作。
其他人可能已经在后端自己完成了,所以我建议在自己重新发明轮子之前进行搜索。
抱歉,这确实是您正在寻找的答案......
The best you could do is use the curve to draw the curve between each of your LatLng points. There isn't a built in algorithm to add in points etc. You would have to do that on the backend yourself.
Somebody else may have already done it themselves on the backend so I would suggest doing a search before reinventing the wheel yourself.
Sorry its the really the answer you were looking for....