mapbox / mapbox/mapbox-maps-flutter
fillExtrusionBaseAlignment and fillExtrusionHeightAlignment have no effect on FillExtrusionLayer with 3D terrain enabled (mapbox_maps_flutter v2.12.0)
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 380
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
Summary
The experimental properties fillExtrusionBaseAlignment and fillExtrusionHeightAlignment on FillExtrusionLayer have no visual effect when 3D terrain is enabled. Changing values between FLAT and TERRAIN produces identical rendering. The extrusion top and base always follow the terrain contour, particularly noticeable when zoomed in.
Environment
mapbox_maps_flutter version: v2.12.0
Native Maps SDK version: v11.16.0
Platform: iOS and Android (Flutter)
Terrain source: mapbox://mapbox.mapbox-terrain-dem-v1 (tileSize: 512, maxzoom: 14)
Expected Behavior
fillExtrusionHeightAlignment: FillExtrusionHeightAlignment.FLAT → The top of the extrusion should remain at a constant absolute altitude (flat plane), regardless of terrain elevation beneath it.
fillExtrusionBaseAlignment: FillExtrusionBaseAlignment.TERRAIN → The base of the extrusion should follow the terrain surface.
fillExtrusionBaseAlignment: FillExtrusionBaseAlignment.FLAT → The base should sit at a fixed MSL altitude, not following terrain.
Actual Behavior
Both the top and base of the extrusion follow the terrain contour at all zoom levels (most visible when zoomed in).
Switching fillExtrusionHeightAlignment between FLAT and TERRAIN produces no visible change.
Switching fillExtrusionBaseAlignment between FLAT and TERRAIN produces no visible change.
At far zoom levels the extrusion appears flat (because the terrain mesh is coarse), but as you zoom in, the top clearly follows the higher-resolution terrain tiles.
Steps to Reproduce
Enable 3D terrain:
Add a GeoJSON source with polygon features containing extrusion_height and extrusion_base properties:
Attempt 1 - Using Flutter SDK constructor properties:
Add a FillExtrusionLayer with alignment set via the constructor parameters:
Result: No effect. The extrusion top and base both follow terrain.
Attempt 2 - Using setStyleLayerProperty to bypass Flutter encoding:
Added the layer without alignment properties, then set them directly via the native style API:
Result: No effect. No PlatformException thrown, but rendering is identical — extrusion still follows terrain.
Navigate to a hilly/mountainous area and pitch the camera to view the extrusion in 3D.
Zoom in - the extrusion top follows the terrain rather than remaining flat.
Swap all alignment values to the opposite (TERRAIN ↔ FLAT) — no visual difference in either approach.
Additional Notes
Terrain exaggeration value does not affect this issue (tested with both 1.0 and 1.5).
These properties are marked @experimental in the Flutter SDK. We'd like to confirm whether they are fully implemented in the native Maps SDK v11.16.0, or if there is a known limitation or planned timeline for full support.
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 with the FillExtrusionLayer constructor alignment properties and the setStyleLayerProperty reproduction described in the issue, then compare behavior on both iOS and Android with 3D terrain enabled. Verify the alignment values against the documented expected behavior at different zoom levels; done means FLAT and TERRAIN produce their distinct rendering effects.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100