mapbox / mapbox/mapbox-maps-flutter
SymbolPlacement.LINE_CENTER in SymbolLayer : value must be a valid enumeration value
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 380
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
When I generate a new SymbolLayer with a SymbolPlacement that has SymbolPlacement.LINE_CENTER as its value, I get the following error:
error while loading slopes PlatformException(Throwable, java.lang.Throwable: value must be a valid enumeration value, Cause: null, Stacktrace: java.lang.Throwable: value must be a valid enumeration value
at com.mapbox.maps.mapbox_maps.StyleController.addStyleLayer$lambda-8(StyleController.kt:91)
at com.mapbox.maps.mapbox_maps.StyleController.$r8$lambda$DWIml6qF1nsOCXcfyyItwp6myFM(Unknown Source:0)
at com.mapbox.maps.mapbox_maps.StyleController$$ExternalSyntheticLambda42.onStyleLoaded(Unknown Source:6)
at com.mapbox.maps.MapboxMap.getStyle(MapboxMap.kt:359)
at com.mapbox.maps.mapbox_maps.StyleController.addStyleLayer(StyleController.kt:80)
at com.mapbox.maps.pigeons.FLTMapInterfaces$StyleManager$-CC.lambda$setup$7(FLTMapInterfaces.java:6919)
at com.mapbox.maps.pigeons.FLTMapInterfaces$StyleManager$$ExternalSyntheticLambda34.onMessage(Unknown Source:2)
at io.flutter.plugin.common.BasicMessageChannel$IncomingMessageHandler.onMessage(BasicMessageChannel.java:219)
No error is generated with SymbolPlacement.POINT or SymbolPlacement.LINE. I'm on android 11 with:
Flutter 3.13.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision e1e47221e8 (2 weeks ago) • 2023-08-22 21:43:18 -0700
Engine • revision b20183e040
Tools • Dart 3.1.0 • DevTools 2.25.0
Code type :
await controller.style.addLayerAt(
SymbolLayer(
id: 'direction',
sourceId: path,
textField: 'name',
symbolPlacement: SymbolPlacement.LINE_CENTER,
...
Edit : symbolZOrder not working also
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 SymbolLayer example with SymbolPlacement.LINE_CENTER, then inspect StyleController.kt around line 91 and the Android style-layer enum handling shown in the stack trace. Check the related symbolZOrder behavior as well; done means LINE_CENTER and the reported symbolZOrder case are accepted without the enumeration error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100