@watergis/mapbox-gl-pitch-toggle-control
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

mapbox-gl-pitch-toggle-control

GitHub

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

I forked tobinbradley/mapbox-gl-pitch-toggle-control repository, then changed it to typescript and registered package. I also did some changes for optional parameters.

Installation:

npm i @watergis/mapbox-gl-pitch-toggle-control --save

Demo:

demo

See demo.

Usage:

import MapboxPitchToggleControl from '@watergis/mapbox-gl-pitch-toggle-control';
import '@watergis/mapbox-gl-pitch-toggle-control/css/styles.css';
map.addControl(new PitchToggle({minpitchzoom: 11})); 

Options (optional):

  • bearing: Bearing for 3d mode. Default is NULL.
  • 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.

Test:

npm run build
npm start

Package Sidebar

Install

npm i @watergis/mapbox-gl-pitch-toggle-control

Weekly Downloads

20

Version

1.0.3

License

MIT

Unpacked Size

9.53 kB

Total Files

8

Last publish

Collaborators

  • j_igarashi