Skip to content

Unable to fix 3d model scaling when map is zoomed #901

Open
@devanupam

Description

@devanupam

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions