S
S
Sergey questions2018-06-01 20:26:10
JavaScript
Sergey questions, 2018-06-01 20:26:10

Leaflet - how to make dynamic markers without reloading the page/map?

There is a leaflet map, for example, here is the option https://jsfiddle.net/ew1jned8/

There are markers on the map, in the example above there are 3 of them. On the site, each marker in the script is displayed via foreach from the site database, where each marker in the database has a latitude and longitude.

The bottom line is that at the moment the markers in the database are updated every 5 seconds, and on the map, respectively, they will be updated only when you reload the page.

How to update marker positions every 5 seconds without reloading the page?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-06-01
@smartycms

The setLatLng method, like so .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question