mapbox / mapbox/mapbox-gl-js

allow geolocate control to query and use permissions

Open
#9,741 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature :green_apple:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**mapbox-gl-js version**:
v1.10.1
**browser**:
mobile Safari (mapbox-gl-js embedded in WKWebView)

### Steps to Trigger Behavior

It worked in former versions e.g. one year ago, but creates problems now.
When I first start the app I get asked to give the geolocation permission, when I click on "always" it will work for the first time and locate me, but after I close and restart the app, I will not be asked any more and the geolocation button will keep spinning and the geoloc status remains "WAITING_ACTIVE"

If I go to the app settings and change the permissions to "ask next time" (or similar), it will work, but there doesn't seem a way to store (and use) the permission permanently (it will store the permission, but it will not locate me nor ask about permission, it will remain "WAITING ACTIVE").

Any idea?

### Link to Demonstration

https://jsbin.com/

### Expected Behavior

### Actual Behavior

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

Start by reproducing the permission flow on mapbox-gl-js v1.10.1 in mobile Safari or a WKWebView, focusing on the geolocate control's WAITING_ACTIVE state after an app restart. Done means the control queries and uses the stored permission correctly and either locates the user or requests permission instead of spinning indefinitely.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, mobile-dev, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.