mapbox / mapbox/mapbox-navigation-android

Request: Provide clearing methods for MapboxMap.Style components (Image, Source...)

Open
#3,572 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

archived feature UI
Dominant language
Kotlin
Stars
651
Forks
321
PR merge metrics
No merged PRs in 30d

Description

**Android API:** 10
**Mapbox Navigation SDK version:**
```
implementation 'com.mapbox.navigation:ui:1.0.0-rc.7'
implementation 'com.mapbox.navigation:core:1.0.0-rc.7'
```

### Why would we like to have this feature?

0. Setup a mapboxMap, a navigation, a navigationMapRoute etc.
1. Add a custom image, source and layer in order to add a marker (Apparently we use this way of adding markers, we don't use the annotation plugin, no idea why)
2. Get re-routed due to a mapbox or an external event
3. Want to clear previous images, sources, layers, etc easily without keeping track of them ourselves.

### Expected behavior
Either a method like `removeImage()` without a parameter or a `removeImages()` or `clearImages` method.

### Actual behavior
There are only `removeImage(name: String)`, ` removeSource(...)`, `removeLayer(...)` methods, which take individual objects.

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 with the MapboxMap.Style APIs for removeImage, removeSource, and removeLayer, and inspect how images, sources, and layers are managed. Define and implement a consistent clearing API for these components, then verify that callers can remove all relevant custom objects without tracking each name individually.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.