Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

leaflet-doubletapdrag

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-doubletapdrag

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

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
222
decreased by-27.45%
Maintainers
1
Weekly downloads
 
Created
Source

Leaflet.DoubleTapDrag

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

This plugin is a base plugin for Leaflet.DoubleTapDragZoom, that implements double-tap-and-drag zoom feature for zooming in / out with one finger on touchscreen.

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

Package last updated on 09 May 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc