Socket
Socket
Sign inDemoInstall

leaflet-doubletapdragzoom

Package Overview
Dependencies
2
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.2.0

CHANGELOG.md

6

Leaflet.DoubleTapDragZoom.js
L.Map.mergeOptions({
doubleTapDragZoom: L.Browser.touch && !L.Browser.android23,
doubleTapDragZoomOptions: {
reverse: false,
},
});

@@ -45,2 +48,3 @@

var map = this._map;
var reverse = this._map.options.doubleTapDragZoomOptions.reverse;
var p = map.mouseEventToContainerPoint(e.touches[0]);

@@ -52,3 +56,3 @@

var distance = this._startPointY - p.y;
var distance = reverse ? p.y - this._startPointY : this._startPointY - p.y;

@@ -55,0 +59,0 @@ var scale = Math.pow(Math.E, distance / 200);

2

package.json
{
"name": "leaflet-doubletapdragzoom",
"version": "0.1.0",
"version": "0.2.0",
"description": "Leaflet plugin that implements double-tap-and-drag zoom feature for zooming in / out with one hand",

@@ -5,0 +5,0 @@ "main": "Leaflet.DoubleTapDragZoom.js",

@@ -34,8 +34,21 @@ # Leaflet.DoubleTapDragZoom

```
```js
var map = L.map('map', {
doubleTapDragZoom: true,
doubleTapDragZoomOptions: {
reverse: false,
},
})
```
To achieve Google Maps-like behavior, use this configuration:
```js
var map = L.map('map', {
doubleTapDragZoom: 'center',
doubleTapDragZoomOptions: {
reverse: true,
},
})
```
## Options

@@ -45,2 +58,4 @@

| ------ | ----- | ------- | ----------- |
| `doubleTapDragZoom` | Boolean\|String | * | Whether the map can be zoomed by double-tap-and-drag gesture. If passed `'center'`, it will zoom to the center of the view regardless of where the touch event (finger) was. Enabled for touch-capable web browsers except for old Androids |
| `doubleTapDragZoom` | Boolean\|String | * | Whether the map can be zoomed by double-tap-and-drag gesture. If passed `'center'`, it will zoom to the center of the view regardless of where the touch event (finger) was. Enabled for touch-capable web browsers except for old Androids |
| `doubleTapDragZoomOptions` | Object | -- | Plugin options, see available options below |
| `doubleTapDragZoomOptions.reverse` | Boolean | false | If true, zoom drag direction will be reversed - dragging up will zoom out, dragging down will zoom in |

Sorry, the diff of this file is not supported yet

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