Google Map上许多点的边界 [英] The boundary of many points on Google Map

查看:107
本文介绍了Google Map上许多点的边界的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家。最近,我们遇到了有关Google Map边界的问题。

我们收到了很多关于google.maps.LatLng(lat,lng)的对象。然后,如何绘制或制作这个块的边界。或者如何找到边界上的点(LatLng,用于绘制多边形),是否有任何JS算法?

就像一个故事:我们收到许多羊(点)作为礼物,那么如何为他们建立一个边界清晰的羊圈呢?



非常感谢您的回复!!! 你要找的是凸包算法。以下是一个示例(您需要查看源代码):



http://www.geocodezip.com/v3_map-markers_ConvexHull.asp



这里还有一个关于这个问题的问题:



如何在Javascript中查找/创建GPS点的凸面壳体


everyone. Recently, we have encountered a problem about the boundary on Google Map.

We have received lots of points which are the objects as 'new google.maps.LatLng(lat,lng)'. Then, how to draw or make the boundary of this chunk. Or how to find the points (LatLng, used to draw the polygon) on the boundary, is there any JS arithmetic ?

Just like one story: we receive many sheep(points) as presents, so how to build the sheepfold with clear boundary for them ?

Thank you very much for any reply !!!

解决方案

What you're looking for is a "convex hull" algorithm. Here's an example of one (you'll need to view source):

http://www.geocodezip.com/v3_map-markers_ConvexHull.asp

Here's a previous question about this as well:

How to find/create Convex hull of GPS points in Javascript

这篇关于Google Map上许多点的边界的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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