Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

214
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda