mapbox / mapbox/mapbox-gl-js

GeolocateControl heading does not work outside of mapbox docs example

Open
#11,374 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle: environment-specific :desktop_computer: needs investigation :mag:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

mapbox-gl-js version: 2.6.1

browser: Chrome

Steps to Trigger Behavior
  1. Go to: https://docs.mapbox.com/mapbox-gl-js/example/locate-user/
  2. Notice that the heading arrow will show
  3. Click on the codepen link
  4. Notice how it no longer works
Link to Demonstration

https://codepen.io/douglasg14b/pen/zYEaMqQ

Expected Behavior

The heading arrow shows.

Actual Behavior

It does not.

More Info

I have been largely unable to get the heading to work in mapbox. Even copy/pasting the code directly from the example docs linked above verbatim to my app does not work. Even the codepen link doesn't have a heading arrow. It only seems to exist and work in the example docs, but nowhere else?

I've tried on several phones to no effect.

Going into the dev tools and fiddling around with the sensors doesn't seem to have any effect either:

image

Why is this? How is this feature supposed to work?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior using the locate-user documentation example and the linked CodePen, then start from the GeolocateControl implementation and compare the two environments. Check why the heading arrow appears in the docs example but not in the standalone example across Chrome and phones. Done means heading works outside the documentation example or the required conditions are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.