Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

206
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!