开发者

PHP Geolocation/Maths/GoogleMaps class?

I've been working with Google Maps API v3 and created a map which allows me to plot multiple markers on a map and then join them together. I then have another collection of functions that allow me to calculate the distance between a defined point and a line (in meters). You can see an example of this bellow:

PHP Geolocation/Maths/GoogleMaps class?

(excuse the MS Paint, I shouldn't have saved it as a gif)

This is all obviously done on client side - I'm wondering if there is a pre-made class that would allow me to achieve this on the server side (using PHP if possible). It is worth noting that the length in meters is NOT from a marker, but the line at any point.

Edit:

I am looking for the ability to provide two points (lat/lng) which I'll call X and Y开发者_运维知识库, I want to then virtually draw this line, then provide another point, Z which I would like to know if its within 10 metres of that "virtual" line.


You can find the answer to this question over at GIS: https://gis.stackexchange.com/questions/11409/calculating-the-distance-between-a-point-and-a-virtual-line-of-two-lat-lngs

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜