1.0.11 • Published 4 years ago

@tilecloud/mbgl-gesture-handling v1.0.11

Weekly downloads
28
License
MIT
Repository
github
Last release
4 years ago

@tilecloud/mbgl-gesture-handling

Build Status npm version

This is a Mapbox GL JS plugin that handles wheel and touch gestures to prevent unexpected zooming and moving for the map embeded in your web site.

Deprecation

The @tilecloud/mbgl-gesture-handling has been deprecated and future updates will never be provided. Please use @geolonia/mbgl-gesture-handling instead.

Screenshots

PC

Users need to use [alt] + wheel to zoom them map.

npm.io

Mobile devide

Users need to use two fingers to move the map.

npm.io

Demo

https://tilecloud.github.io/mbgl-gesture-handling/

How to use

$ npm install @tilecloud/mbgl-gesture-handling
import GestureHandling from '@tilecloud/mbgl-gesture-handling'

const map = new mapboxgl.Map({
  ...
});

// Defaults
const options = {
  backgroundColor: 'rgba(0, 0, 0, 0.8)',
  textColor: '#ffffff',
  textMessage: 'Use alt + scroll to zoom the map.',
  textMessageMobile: 'Use two fingers to move the map.',
  timeout: 3000,
}

new GestureHandling(options).addTo(map);

Contributing

$ git clone git@github.com:tilecloud/mbgl-gesture-handling.git
$ cd mbgl-gesture-handling
$ npm install
$ npm test
$ npm run build

Note for developers

To publish this module:

$ npm tag x.x.x
$ git push origin x.x.x
1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago