search

Home  >  Q&A  >  body text

java - Gaode map displays the obtained longitude and latitude in real time

I need to display a vehicle on the map in real time. The device will upload the longitude and latitude information continuously every few seconds, and then the server will return to the app.

My current idea is to refresh it regularly, then jump to it with the maker click, and then add a line in the middle to show real-time dynamics. But it seems inappropriate to keep sending requests.

Is there a more suitable way, or can we share the logic implementation? Must use Gaode map.

Thank you all!

ringa_leeringa_lee2774 days ago1076

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 13:28:49

    If it’s once every few seconds, using ajax will be too frequent. Personal suggestion:

    1. If it is a Web client, it is recommended to use websocket, which is very suitable for this requirement;

    2. If it is an App client, you can consider using tcp / udp connection;

    3. If you are just transmitting latitude and longitude, you can consider using a message queue service, such as: mqtt.

    reply
    0
  • 迷茫

    迷茫2017-05-16 13:28:49

    Either the server has a long connection with your app, and the server push message triggers the app's UI update; or the app polls the server to get the data and renders the UI

    reply
    0
  • 某草草

    某草草2017-05-16 13:28:49

    I also have this need recently. If you have any good ideas, please share them

    reply
    0
  • Cancelreply