Socket
Socket
Sign inDemoInstall

leaflet-doubletapdrag

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    leaflet-doubletapdrag

Leaflet plugin that allows to handle double-tap-and-drag gestures


Version published
Weekly downloads
125
decreased by-34.21%
Maintainers
1
Install size
6.07 kB
Created
Weekly downloads
 

Changelog

Source

0.1.1 (2018-08-18)

  • Increase double click timeout to 500ms (#7)
  • Decrease waiting for drag end timeout to 100ms (#8)

Readme

Source

Leaflet.DoubleTapDrag

This plugin adds doubletapdragstart, doubletapdrag and doubletapdragend map events on touch devices. It allows to handle double-tap and hold gesture.

Demo: https://cherniavskii.github.io/Leaflet.DoubleTapDrag/

Usage

NPM

npm install --save leaflet-doubletapdrag

import L from 'leaflet';
import 'leaflet-doubletapdrag';

const map = L.map('map');

...
...
...

map.on('doubletapdragstart', (e) => {
  console.log('doubletapdragstart');
});

map.on('doubletapdrag', (e) => {
  console.log('doubletapdrag');
});

map.on('doubletapdragend', (e) => {
  console.log('doubletapdragend');
});

Loading from unpkg.com:

Add script to head:

<script src="https://unpkg.com/leaflet-doubletapdrag"></script>

Now it's ready to use:

const map = L.map('map');

...
...
...

map.on('doubletapdragstart', (e) => {
  console.log('doubletapdragstart');
});

map.on('doubletapdrag', (e) => {
  console.log('doubletapdrag');
});

map.on('doubletapdragend', (e) => {
  console.log('doubletapdragend');
});

Events

  • doubletapdragstart - fired when user double-taps and holds finger on map
  • doubletapdrag - fired when user moves finger without releasing it from screen
  • doubletapdragend - fires when user releases finger from screen

Keywords

FAQs

Last updated on 18 Aug 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc