Skip to content

Layer

The layer component hold a group of markers. It can be used to organize the informations that you wanto to show on the map. For example, suppose to manage an emergency evacuation plan, you can show on map emergency path and exits and fire hoses. You can create two layers, "Paths" and "Fire Hoses", and distribuite the items between this two layers. If you want to see only emergency path, just hide "Fire Hoses" layer.

Create a Layer

Create a new layer to hold a group of markers.

mapview.addLayer(layerId: "LayerA")
mapview.apply()
NextomeMapViewHandler.instance.addLayer(layerId: "LayerA")
NextomeMapViewHandler.instance.apply()

Set Layer visibility

Set the visibility of a layer

mapview.setLayerVisibility(layerId: "LayerA", show: false)
mapview.apply()
NextomeMapViewHandler.instance.setLayerVisibility(layerId: "LayerA", show: false)
NextomeMapViewHandler.instance.apply()

Clear a Layer

Delete all markers presents into the layer

mapview.clearLayer(layerId: "LayerA")
mapview.apply()
NextomeMapViewHandler.instance.clearLayer(layerId: "LayerA")
NextomeMapViewHandler.instance.apply()

Example usage

Note

The NMLayer is actually managed by the controller, therefore the developer doesn't need to write any code about that. See the NMMapController class to see how manage layers.