All Projects → w8r → Leaflet.path.drag

w8r / Leaflet.path.drag

Drag functionality for Leaflet vector layers

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Leaflet.path.drag

django-leaflet-admin-list
The Django Leaflet Admin List package provides an admin list view featured by the map and bounding box filter for the geo-based data of the GeoDjango.
Stars: ✭ 28 (-61.11%)
Mutual labels:  leaflet, geo
Geotools
Geo-related tools PHP 5.4+ library built atop Geocoder and React libraries
Stars: ✭ 1,157 (+1506.94%)
Mutual labels:  geo, geometry
Leaflet-active-area
A Leaflet plugin to center the map not in the center of the map but inside a DIV. Useful for responsive design.
Stars: ✭ 99 (+37.5%)
Mutual labels:  leaflet, leaflet-plugins
Leaflet Ng2
Angular.io integration of Leaflet
Stars: ✭ 66 (-8.33%)
Mutual labels:  geo, leaflet
Heatmap.js
🔥 JavaScript Library for HTML5 canvas based heatmaps
Stars: ✭ 5,685 (+7795.83%)
Mutual labels:  leaflet-plugins, leaflet
georaster-layer-for-leaflet
Display GeoTIFFs and soon other types of raster on your Leaflet Map
Stars: ✭ 168 (+133.33%)
Mutual labels:  leaflet, geo
Leaflet Ant Path
🌿🐜 Creates a leaflet polyline with a 'ant-path' animated flux
Stars: ✭ 296 (+311.11%)
Mutual labels:  leaflet-plugins, leaflet
leaflet-area-select
Control to just select an area and provide bbox for it
Stars: ✭ 27 (-62.5%)
Mutual labels:  leaflet, leaflet-plugins
Iclient Javascript
Modern GIS Web Client for JavaScript, based on Leaflet\OpenLayers\MapboxGL-JS\Classic(iClient8C), enhanced with ECharts\D3\MapV etc. Contributed by SuperMap & community.
Stars: ✭ 593 (+723.61%)
Mutual labels:  leaflet-plugins, leaflet
Wicket
A modest library for moving between Well-Known Text (WKT) and various framework geometries
Stars: ✭ 484 (+572.22%)
Mutual labels:  geometry, leaflet
Leaflet Geoman
🍂🗺️ The most powerful leaflet plugin for drawing and editing geometry layers
Stars: ✭ 1,088 (+1411.11%)
Mutual labels:  leaflet-plugins, leaflet
Leaflet.markercluster.freezable
Adds ability to freeze clusters at specified zoom
Stars: ✭ 21 (-70.83%)
Mutual labels:  leaflet-plugins, leaflet
Leaflet.MarkerCluster.LayerSupport
Sub-plugin for Leaflet.markercluster plugin; brings compatibility with Layers Control and other plugins
Stars: ✭ 53 (-26.39%)
Mutual labels:  leaflet, leaflet-plugins
leaflet.tilelayer.gloperations
Custom Leaflet TileLayer using WebGL to do operations on and colorize floating-point pixels
Stars: ✭ 15 (-79.17%)
Mutual labels:  leaflet, leaflet-plugins
harp-leaflet
Leaflet plugin for harp.gl
Stars: ✭ 16 (-77.78%)
Mutual labels:  leaflet, leaflet-plugins
Leaflet.pixioverlay
Bring Pixi.js power to Leaflet maps
Stars: ✭ 264 (+266.67%)
Mutual labels:  leaflet-plugins, leaflet
wkb-parser
Well-known binary (WKB) Parser.
Stars: ✭ 69 (-4.17%)
Mutual labels:  geometry, geo
esri-leaflet-vector
Display ArcGIS Online vector basemaps w/ Esri Leaflet
Stars: ✭ 39 (-45.83%)
Mutual labels:  leaflet, leaflet-plugins
Leaflet.markercluster
Marker Clustering plugin for Leaflet
Stars: ✭ 3,305 (+4490.28%)
Mutual labels:  leaflet-plugins, leaflet
Leaflet.flowecharts
leaflet plugin for Baidu Echarts
Stars: ✭ 17 (-76.39%)
Mutual labels:  leaflet-plugins, leaflet

L.Path.Drag

npm version CircleCI

Drag handler for Leaflet vector features. It adds dragging API and events of L.Marker to L.Polygon and L.Polyline.

If you are looking for this functionality combined with Leaflet.draw, take a look at Leaflet.draw.drag and Leaflet.Editable.Drag.

Demo

Usage

<script src="path/to/leaflet/"></script>
<script src="path/to/L.Path.Drag.js"></script>
...
var polygon = new L.Polygon([...], { draggable: true }).addTo(map);
// you can use the drag events just like with markers
polygon
    .on('dragstart', onDragStart)
    .on('drag',      onDrag)
    .on('dragend',   onDragEnd);

with browserify

npm install leaflet-path-drag
...

require('leaflet');
var handler = require('leaflet-path-drag');

Requires [email protected]

For [email protected] support use code from leaflet-0.7 branch

Enable/disable dragging

var polygon = new L.Polygon([...], { draggable: true }).addTo(map);
polygon.dragging.enable();
polygon.dragging.disable();

Info

It uses matrix transforms on SVG/VML paths, so part of it(src/L.Path.Transform) could be used for different transformations - skew/scale/etc - but you have to provide coordinates projection and handling yourself.

VML matrix transform tested in IE8, it has rendering glitches, but what can you expect.

License

The MIT License (MIT)

Copyright (c) 2015 Alexander Milevski

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].