mapbox / mapbox/mapbox-maps-android

Can't set style import position relative to main loaded style

Open
#2,478 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle:
Dominant language
Kotlin
Stars
578
Forks
161
PR merge metrics
No merged PRs in 30d

Description

Environment

  • Android OS version:Any
  • Devices affected:Any
  • Maps SDK Version:Any

Observed behavior and steps to reproduce

Imported style using addStyleImportFromURI or addStyleImportFromJSON are always shown below main style loaded using loadStyle, Setting ImportPosition when using addStyleImportFromURI with null values to set it on top has no effect.

Is there any way to have imported style to be on top on main loaded style?

// Load main style
mapboxMap.loadStyle(styleUrl) {
        // Add new overlays over main style > are invisible beacause always show below main style....
        overlays.forEach { overlay ->
                mapboxMap.addStyleImportFromURI(
                    overlay.id,
                    overlay.styleUrl,
                    null,
                    ImportPosition(null, null, null),
                )
            }
        }
     }

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 at the loadStyle, addStyleImportFromURI, and addStyleImportFromJSON entry points and reproduce the ordering with ImportPosition(null, null, null). Trace how imported styles are positioned relative to the main style; done means establishing whether an import can render above the loaded style and covering the observed behavior with an appropriate verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.