flutter-maplibre-gl
flutter-maplibre-gl copied to clipboard
setLayerVisibility specified in documentation but not available in library
The setLayerVisibility
is documented in the API Documentation here.
However, it's not available in the codes. I need to configure the visibility of certain map layers, such as contour
, summit
, carparks
, etc. Is there another way to do this via the map controller?
This feature was merged in #138, and is not yet in a release. You need to use the main branch from this repo, are you doing that?
Yes, I found this, I wasn't using the main
branch, just to confirm, can we use this for hiding or displaying layers like contour-line
, mountain-peak
, hike-route
, bike-route-line
, etc?
Yes, if those layers exist you should be able to hide/show them.
How about getting a layer object and modifying it's properties?
For example,
I am adding a layer with id tracker
as shown below. How do I get the layer object if I need to modify it layer, for example, changing the iconSize
or iconRotate
property. The future
that addSymbolLayer returns does not contain the layer. Neither do I see any method like getLayer
or updateLayer
. Is there anything such?
maplibreMapController.addSymbolLayer(
"trackerSource",
"tracker",
SymbolLayerProperties(
iconImage: "assets/images/NavIcon.png", // "{type}-15",
iconSize: 1,
iconAllowOverlap: true,
iconRotationAlignment: 'viewport',
iconPitchAlignment: 'map',
),
);
No this does not exist, yet. The challenge here is that maplibre on iOS does not support retrieving the JSON representation of a source or layer. I have some ideas how to implement this (updating is probably easier than retrieving), but I can't promise you when this will be ready.
If someone is interested in working on this, please let me know and I can give you some more details.