mapbox / mapbox/mapbox-maps-flutter
Add model layer above locationPuck or 3D buildings
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 380
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to add my model to the map using the below code, I am making use of the `ModelType.LOCATION_INDICATOR` and am also specifying the layer position but it does not seem to add it at the right place.
It seems like there is some kind of bug when setting the locationPuck to 3D as reported in #1023. This 3D puck is placed above all layers and cannot be moved even using the slots or specifying the layer position. In addition to this adding a model layer above the 3d buildings also does not work even after specifying the slots or the layer position
### Code:
```
await style.addLayerAt(
ModelLayer(
id: droneID + (droneFeature.id as String) + layerId,
sourceId: droneSourceID,
modelId: modelDroneId,
modelType: ModelType.LOCATION_INDICATOR,
modelScale: [
5,
5,
5,
],
modelTranslationExpression: [
0,
0,
10,
],
modelRotationExpression: [
0,
0,
[
getExpression,
directionKey,
]
],
modelCastShadows: false,
),
LayerPosition(
above: 'mapbox-location-model-layer',
),
);
```
### Output:
Model gets added but the layer is below both the userLocationPuck and also the 3d-building


### Desired Output:
Model needs to be placed above at least the building or the userLocationPuck
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the shown addLayerAt, ModelLayer, and LayerPosition configuration, then compare the location puck behavior with the related report in #1023. Trace how model layers are ordered relative to the userLocationPuck and 3D buildings; done means the model can be placed above at least one of those layers as requested.
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