-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use data driven properties #28
Comments
You can first add the layer with default properties and then use |
Hey, I just tried that and I get this error:
This is how I create the layer: await mapController.style.addSource(GeoJsonSource(id: 'styleSource', data: json.encode(geojson))); // Here geojson is a Map<String, dynamic>
await mapController.style.addLayer(
LineLayer(
id: 'styleLayer',
sourceId: 'styleSource',
lineCap: LineCap.ROUND,
lineWidth: 3,
),
);
await mapController.style.setStyleLayerProperty(
'styleLayer',
'color',
json.encode(['get', 'line-color']),
); |
Line layer does not have 'color' property, it is 'line-color'. Check out this: https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#line |
Oh, okay, that's where the names come from :D Thanks! |
Hello, how can I use data driven properties to pass a color for a line on LineLayer? The LineLayer object takes an int for the line-layer property, so I can't pass the ['get', 'custom-color'] to it :/ Actually that applies to any property in any type of layer...
The text was updated successfully, but these errors were encountered: