LevelSwitch¶
This Tutorial will show you how you can switch between the levels of your map.
Step 1: Include Control LevelSwitch¶
After creating a map, as outlined in Getting started, you can install and initiate the level switch control
Install: npm i -S @deepmap/control-level-switch
Initiate:
Code
... const levelControl = new ControlLevelSwitch(); const map = DeepMapFactory.bootstrap(config); map.addControl(levelControl); ...
Step 2: Customize level switch element¶
Now we can customize the Style
Code
<style type="text/css"> ul.deep-map-level { // container } ul.deep-map-level li.level-up { // level up button } ul.deep-map-level li.level-current { // current level display } ul.deep-map-level li.level-down { // level down button } </style>
That’s it! We are done with our level switcher.