Simple pitch on/off button in Mapbox GL JS style.
JavaScript CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore initial commit Jan 30, 2017
LICENSE Initial commit Jan 30, 2017
README.md initial commit Jan 30, 2017
pitch-toggle-3d.svg fix for svg font family Jan 31, 2017
pitchtogglecontrol.css fix for svg font family Jan 31, 2017
pitchtogglecontrol.js fixed aria text Jan 31, 2017

README.md

mapbox-gl-pitch-toggle-control

Simple pitch on/off button in Mapbox GL JS style.

Demo

map.addControl(new PitchToggle({minpitchzoom: 11})); 

Options (optional):

  • bearing: Bearing for 3d mode. Default is -20.
  • pitch: Pitch for 3D mode. Default it 70.
  • minpitchzoom: Minimum zoom level for 3D mode, so you don't have flying polygons gouging out eyeballs. Default it null (i.e. stays at same zoom).

Note that the control is as an ES6 class, so running it through something like Babel is necessary.