FloorSwitcherControl

FloorSwitcherControl

new FloorSwitcherControl()

Creates a SteerpathFloorSwitcher control with buttons to change layer index of the building, i.e. the active floor. Control is created from building's "floorLists" object which has floorIndexList and floorNameList. FloorNameList holds values visible to the user and floorIndexList the actual layer index values. You can set the position of the controller by adding option: "top/bottom-left/right"
Example
mapboxgl.accessToken = 'your_accessToken_here'

 var mapboxMap = new mapboxgl.Map({
     container: 'mapboxMap',
     style: 'your_style_url_here',
     center: [0, 0],
     zoom: 16,
     bearing: 0,
     pitch: 0
 });

 var options = {
   inspectionZoomLevel: 15,
   inspectionBoundaries: 0.5,
   queryOnceMapLoad: true
 };


 var steerpathMap = new steerpath.SteerpathMap(mapboxMap, options);
 var floorSwitcher = new steerpath.FloorSwitcherControl(steerpathMap);
 mapboxMap.addControl(floorSwitcher, "bottom-right");

Methods

(static) hideFloorSwitcher()

Hide floor switcher control from the view.
Example
floorSwitcher.hideFloorSwitcher();

(static) showFloorSwitcher()

Show floor switcher control in the view.
Example
floorSwitcher.showFloorSwitcher();