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

207
Vistas
Display user location on the map MapboxJS

It seems as though it is not possible to Show the user's location on the map using Mapbox-gl-js. There are examples in the documentation that discuss doing this with Mapbox IOS/Android however, nothing with MapboxGl JS.

What I've Tried:
I am currently able to add a Geolocate Control that does this feature with a button:

map.addControl(
    new mapboxgl.GeolocateControl({
        positionOptions: {enableHighAccuracy: true},
        trackUserLocation: true,
        showUserHeading: true,
    })
);

However, this is not live tracking of the user, as shown in the linked example above.

Is anoyone able to help?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You're doing it right - GeolocateControl will track the user on the map as a blue pulsing dot. If it's not doing that for you, something is going wrong - perhaps you haven't granted permissions, or perhaps you're not running in a context where the browser can get the user's location. For instance, you need to be serving the page on https, not http.

about 4 years ago · Juan Pablo Isaza Denunciar
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