Skip to main content

Layer control

Control component adding functionality to parent Map component.

This component adds possibility to change used map layer, based on set default layers in MapProviders prop mapLayers.

By using this control, map will render Layer changer in top left corner in map container, with selection of all provided map layers from mentioned mapLayers prop.

How to use it

import { Map, LayerControl } from 'mapy-cz-react';

<Map>
<LayerControl width={65} pageSize={3} />
</Map>;

Props

NameTypeDefaultDescriptionRequired
widthnumber65Width of each item in layer control. Not necessary for 90% of usecases
pageSizenumber3Enable keyboard zoom control - + - keys

Example

Live Editor
Result
Loading...