PHP Classes
elePHPant
Icontem

Can we autorefresh the markers using AJAX

Recommend this page to a friend!

      Map Builder  >  All threads  >  Can we autorefresh the markers using...  >  (Un) Subscribe thread alerts  
Subject:Can we autorefresh the markers using...
Summary:Can we autorefresh the markers using AJAX
Messages:2
Author:Paresh
Date:2016-09-02 10:39:19
 

  1. Can we autorefresh the markers using...   Reply   Report abuse  
Paresh - 2016-09-02 10:39:19
Hi,

Is it possible to auto refresh the markers of the graph using the JS and AJAX after every say 30 seconds?

I want to read the database for latitude and longitude and plot the markers on the map. I do not want complete map to refresh, just re plot the markers. Also if I have zoomed in map and the auto refresh redraw the markers, the zoom level should not reset.

Use case is, I have a mobile application which sends the current latitide and longitude to the server and at server these mobiles needs to plot on the map. There are n number of mobiles which can have this app.

Please help, a sample php file say ex13.php may help :)

  2. Re: Can we autorefresh the markers using...   Reply   Report abuse  
Vagharshak Tozalakyan - 2016-09-02 10:53:30 - In reply to message 1 from Paresh
Hello, you can define a JS callback named mbOnAfterInit() (see ex. 9). Inside that function set a JS timer (window.setInterval(...)) to make AJAX calls every 30 sec. and refresh the map accordingly.