-
Notifications
You must be signed in to change notification settings - Fork 187
fillExtrusionBaseAlignment and fillExtrusionHeightAlignment have no effect on FillExtrusionLayer with 3D terrain enabled (mapbox_maps_flutter v2.12.0) #1117
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.