We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm a bit lost with the poor documentation regarding the feature-state so I don't know if it's a bug or a wrong implementation.
feature-state
I have this function that does set the feature-state
Future<void> _changeSelectedMarker({ExtendedActivity? previousSelection, ExtendedActivity? newSelection}) async { if (previousSelection != null) { LoggingService.instance.debug('Deselecting marker with ID: ${previousSelection.activity.firebaseId}'); map.setFeatureState( "activity-source", null, previousSelection.activity.firebaseId, jsonEncode({"selected": false}), ); } if (newSelection != null) { LoggingService.instance.debug('Selecting marker with ID: ${newSelection.activity.firebaseId}'); map.setFeatureState( "activity-source", null, newSelection.activity.firebaseId, jsonEncode({"selected": true}), ); } }
My layer is init like that
Future<void> _initSymbolLayer() async { await map.style.addStyleSource( "activity-source", jsonEncode({ 'type': 'geojson', 'data': { 'type': 'FeatureCollection', 'features': [], }, })); await map.style.addStyleLayer( jsonEncode( { 'id': "activity-layer", 'type': 'symbol', 'source': "activity-source", 'layout': { 'text-field': ['get', 'title'], 'text-size': OGDims.dim4, 'text-variable-anchor': ['left', 'top', 'right'], 'text-radial-offset': 1, 'text-offset': [2, 0], 'icon-image': [ 'case', [ 'boolean', ['feature-state', 'selected'], false ], ['get', 'selectedIcon'], ['get', 'icon'], ], 'icon-size': 7, 'icon-allow-overlap': true, 'icon-ignore-placement': true, 'text-allow-overlap': false, 'text-ignore-placement': false, 'text-justify': "auto", }, 'paint': { 'text-color': "#000000", 'text-halo-color': "#FFFFFF", 'text-halo-width': 1.75, 'icon-opacity': [ 'coalesce', ['feature-state', 'opacity'], 0.0 ] } }, ), LayerPosition(at: 0), ); addMarkerImagesToMap(); }
But I can't make it works. Is it a bad implementation or a bug?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm a bit lost with the poor documentation regarding the
feature-state
so I don't know if it's a bug or a wrong implementation.I have this function that does set the feature-state
My layer is init like that
But I can't make it works. Is it a bad implementation or a bug?
The text was updated successfully, but these errors were encountered: