mapbox / mapbox/mapbox-maps-flutter

Not able to place LocationPuck3D below map 3d models (specifically building extrusions)

Open
#660 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
380
Forks
204
PR merge metrics
No merged PRs in 30d

Description

I'm currently using the Mapbox Standard style, but I've attempted to create a custom style where I added a layer for building extrusions. However, the issue persists— my LocationPuck3D still renders above the building extrusions, despite my efforts.

I used the following code to try to move the LocationPuck3D layer below the building extrusions:

` _mapboxMap?.style.moveStyleLayer('mapbox-location-model-layer', LayerPosition(below: 'building-extrusion'));`

This did indeed move the layer but the model was still displayed over the buildings.

additionally, I’ve tried configuring the LocationPuck3D slot in the LayerSlot.MIDDLE but it didn't work, I tried specifying the layerBelow parameter directly in the settings, but neither approach has worked:

```
Future _enableLocationComponent() async {
_mapboxMap?.location.updateSettings(
LocationComponentSettings(
locationPuck: LocationPuck(
locationPuck3D: LocationPuck3D(
modelUri:
"https://raw.githubusercontent.com/Log-Mushun/TSP_models/main/Truck_pkg_1_glb.glb",
modelScale: [1, 1, 1],
modelScaleMode: ModelScaleMode.MAP,
),
),
enabled: true,
puckBearingEnabled: true,
slot: LayerSlot.MIDDLE,
//layerBelow: 'building-extrusion', (I also tried this)
),
);
}
```


So I wanted to see if LayerSlot.BOTTOM works and it looks weird, It's like the puck model appears under the roads but still above the buildings, with a theme that has a custom layer for 3d buildings the same thing happens



![bottom](https://github.com/user-attachments/assets/9dd4fd87-fcaf-4d10-807f-05b963dd446b)

I'm testing on an android device .

my mapbox version is: mapbox_maps_flutter: ^2.1.0

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 Android behavior in mapbox_maps_flutter 2.1.0 using _enableLocationComponent, the LocationPuck3D configuration, and the LayerPosition and LayerSlot settings shown here. Compare the puck's rendering against the building-extrusion layer; done means establishing whether the puck can render below 3D buildings and documenting or fixing the observed ordering.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile
Issue type
Bug
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.