Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

249
Vistas
Best approach to replicate Google Map's "re-center" when user interacts with the map in navigation mode using Leaflet JS

I have a leaflet map where I allow the user to turn on a mode where the map will follow and update their location every 30 seconds. This is implemented with a button click that corresponds to an ActiveLocation = true variable, and as long as it is set to true the map will check for location every 30 seconds and display a location pin and center the view to it. This is needed because the map is used while users are on the move.

Problem

Sometimes users want to check something on the map while ActiveLocation is enabled and they do that without disabling it. Because the map re-centers the view every 30 seconds their work is interrupted. because there is no way to differentiate between the user moving the map and the map moving due to the map.locate() function I have no way of knowing when the user intentionally initiated the change and pause the activeLocation until they request it back.

Are you aware of an efficient and clean way to achieve that? And is there any extension for leaflet that allows features similar to Google Maps' navigation?

Thanks!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda