如何使用islocationOnEdge函数在服务器端的Google Maps api路径上/附近查找坐标 [英] how to use islocationOnEdge function to find coordinates on/near a path of google maps api on server side

查看:126
本文介绍了如何使用islocationOnEdge函数在服务器端的Google Maps api路径上/附近查找坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题是 在您的沿线查找特定城市的问题的扩展路径 ,但包含所有详细信息.

this question is an extension to the question on Finding particular cities along your Path but am including all the details.

google.maps.geometry.poly.isLocationOnEdge(LatLngOfDbCoordinate,new google.maps.Polyline({path:google.maps.geometry.encoding.decodePath(response.routes[0].overview_polyline)}),0.00001);

1)我可以在服务器端以Node.JS的php代码内的javascript的身份在服务器端运行许多代码(例如:10000)(存储在数据库中的LatLngOfDbCoordinate)吗?

1) can i run this above line of code for many(eg:10000) (LatLngOfDbCoordinate stored in the database) at the server side as javascript inside the php code with Node.JS ?

2)如果是,那么请您告诉我该怎么做否则

2)if yes then could you please tell how should i go about it else

3)您能否告诉我如何通过php或其他一些类,例如

3)could you please tell me how to execute this code via php or with some other classes like http://luktek.com/Blog/2011-02-03-google-maps-routeboxer-in-php (from the stack overflow link at the top)?
And could you please tell me how to use isLocationOnEdge() function with the routeboxer class mentioned above?

4)在我不知道的服务器端,还有其他更简便的方法来使用isLocationOnEdge()或任何其他方法吗?

4)Is there any other easier way to use isLocationOnEdge() or any other method at the server side to which i am not aware of ?

5)在服务器端使用功能isLocationOnEdge()有使用限制吗?因为这是几何库的功能,而我将仅使用此函数布尔返回值来显示折线上/附近的坐标是否适用用法限制?

5) Is there any usage limits to use the function isLocationOnEdge() on server side ? As this is the function of the geometry library and i would only be using this functions boolean return values to display the coordinates which are on/near the polyline are usage limits applicable?

6)并且将路线的概述折线存储在db中是否有用(因为在路线较大的情况下可能会很长),或者我应该每次向Google url服务发出请求,方法是将它们发送给起点和终点坐标并使用我以JSON或XML格式接收的概述折线传入isLocationOnEdge()中?请说明原因.

6)And would it be useful to store the overview polyline of routes in the db(cause can be very lengthy in case of large routes) or should i make a request everytime to google url service by sending them start and destination coordinates and using the overview polyline which i recieve as JSON or XML to pass in isLocationOnEdge()? Please specify the reason.

请帮助
预先感谢

Please Help
Thanks in advance

推荐答案

我遇到了同样的问题.但是由于我的应用程序是在android中,而服务器端是在nodejs中,因此决定在android中实现.我使用了具有相同功能的PolyUtil类.

I had the same problem. But as my application was in android only with the server side is in nodejs, decided to make the implementation in android. I used the PolyUtil class that has the same functions.

http://googlemaps. github.io/android-maps-utils/javadoc/com/google/maps/android/PolyUtil.html

但是,如果您确实需要在javascript服务器端实现此代码,则可以尝试重新创建PolyUtil类的功能.在其中,您将找到isLocationOnEdge的完整代码

But if you really need implement this code in javascript server side you can try to recreate the functions of PolyUtil class. In it you will find the complete code of isLocationOnEdge

https://github.com/jefersondeoliveira/android-hackathon/blob/master/google-maps-utils/library/src/com/google/maps/android/PolyUtil.java

希望这会有所帮助.

再见

这篇关于如何使用islocationOnEdge函数在服务器端的Google Maps api路径上/附近查找坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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