简体   繁体   English

如何在Google地图上实时跟踪用户?

[英]How to track user on google map in real-time?

I am developing one application, in which I want to achieve the following things using Google Map : 我正在开发一个应用程序,在其中我要使用Google Map实现以下目的:

  1. Person A can get tracked by multiple user. 人员A可以被多个用户跟踪。

  2. Each and every person who are tracking Person A can put a Pin in Map and make a radius so that they can Track Person A on different location. 跟踪人物A的每个人都可以在地图上放置图钉并绘制半径,以便他们可以在不同的位置上追踪人物A。

  3. If Person B is tracking Person A in Santa Clara location and radius is 30meters then whenever Person A enters or leaves that location then Person B will get a notification. 如果人员B在圣塔克拉拉(Santa Clara)位置跟踪人员A,且半径为30米,则只要人员A进入或离开该位置,人员B都会收到通知。

  4. If Person A has arrived in tracked location, and travelling then we have to display speed, directions in which he is travelling on Map in real-time. 如果人员A已到达跟踪位置并正在旅行,则我们必须实时显示其在地图上的行进速度,方向。

  5. So there can be multiple locations in which Person A gets tracked. 因此,可以在多个位置跟踪人员A。 and we have to display real-time direction in which he is travelling and current speed. 并且我们必须显示他行驶的实时方向和当前速度。 Like UBER app . 像UBER应用

I had a call with google support and she told me "You have to implement your own tracking mechanism by maintaining geocode records in database" . 我打了一个Google支持电话,她告诉我“您必须通过在数据库中维护地理编码记录来实现自己的跟踪机制” But If I implement like this then each and every second I have to send geolocation to the server and retrieve it. 但是,如果我像这样实现,那么我必须每一秒钟将地理位置发送到服务器并检索它。

Is there any other solution for this problem ? 还有其他解决方案吗?

Thanks, Abbas Mulani 谢谢阿巴斯·穆拉尼(Abbas Mulani)

You will need to implement your own mechanism by saving the markers that person B adds and then checking them against the location of person A for each record. 您将需要实现自己的机制,方法是保存人B添加的标记,然后针对每个记录对照人A的位置检查它们。 You will also need to save the location of person A along with his speed and location and then display it on the map. 您还需要保存A人的位置及其速度和位置,然后将其显示在地图上。

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

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