mapbox / mapbox/mapbox-maps-flutter

Unable to fix 3d model scaling when map is zoomed

Open
#901 2 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 am using below code to add a 3d model and used to scale mode as VIEWPORT, still it is scaling the model as per the current zoom level. I want the model to be of the same size on the screen irrespective of the zoom level. I am using mapbox_maps_flutter v2.6.2.

await mapboxMap?.style.addSource(GeoJsonSource(id: "sourceId", data: json.encode(modelPoint)));
double scale = 10;

var modelLayer = ModelLayer(id: "modelLayerId", sourceId: "sourceId");
modelLayer.modelId = modelAssetPath;
modelLayer.modelScale = [scale, scale, scale];
modelLayer.modelScaleMode = ModelScaleMode.VIEWPORT;
modelLayer.modelRotation = [0, 0, 180];
modelLayer.modelType = ModelType.LOCATION_INDICATOR;
await mapboxMap?.style.addLayer(modelLayer);

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

Reproduce the behavior from the mapboxMap.style.addLayer call using ModelLayer, modelScale, and ModelScaleMode.VIEWPORT in mapbox_maps_flutter v2.6.2. Start by checking how viewport scaling is handled for ModelLayer and verify whether the model remains the same screen size as the map zoom changes; document the result or identify the relevant SDK limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
computer-graphics, mobile-dev
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.