-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Is your feature request related to a problem? Please describe.
Currently, the ui-mapbox plugin does not allow to get (and interact) with map style layers.
A use case would be to show or hide certain layers like "hide motorways", "show bikelanes"
Describe the solution you'd like
I propose to introduce the concept of a "Layer" type as following:
interface Layer {
id: string;
visibility(): boolean;
show(): void;
hide(): void;
}
The native SDKs for Android and iOS provide more properties, but additional properties can be added later when needed (i.e. getMaxZoom, getMinZoom, etc). For now, imho that basic structure should be good enough for now.
To be able to get a single layer or a list of all map style layers, the MapboxViewApi needs to be extended with the following methods:
getLayer(name: string, nativeMap?): Promise<Layer>;
getLayers(nativeMap?: any): Promise<Array<Layer>>;
Additional context
I would be happy to provide a PR that adds this functionality