Code Monkey home page Code Monkey logo

path.drag.js's Issues

Markers not draggable anymore after overlay hide/show

I'm grouping some draggable markers in a layer in order to be able to hide/show them at once with the leaflet built-in control for overlays.

The markers are draggable all right at first, but as soon as the layer has been hidden and shown again using the control checkbox, then trying to drag a marker will move the whole map.

Minimum example to reproduce:

var myLatLng1 = L.latLng(48, 5);
var myLatLng2 = L.latLng(48.1, 5.1);

map.setView(myLatLng1, 11);

var myMarker1 = L.circleMarker(myLatLng1, {draggable: true});
var myMarker2 = L.circleMarker(myLatLng2, {draggable: true});

var myLayer = L.layerGroup([myMarker1, myMarker2]);
myLayer.addTo(map);

L.control.layers({}, {'My layer': myLayer}).addTo(map);

I'm experiencing this with both leaflet 1.3.4 and 1.4.

Using it with Leaflet.Draw

I am trying to implement this using Leaflet.Draw, but its not working totally correct.
screenshot_2
I am moving the polygon to the left in this case, but the boundary markers are staying put. (marked them with grey color) When i press Save, only then they get updated, and are located to their new place when i edit the polygon again.
Have you ever tried it with Leaflet.Draw ?
Thanks

Option to ignore right click

It would be super nice to be able to select which mouse button can drag the path.
In my application I want to be able to rotate objects with right-click, which results in an interesting behavior when right-clicking into a path. It rotates and moves the path at the same time.

Add leaflet to dependencies

I suppose this lib has a dependency to leaflet v1.0+. I had a lot of trouble make this work with version 0.7 and repeatedly got error:

TypeError: Cannot read property 'getRenderer' of undefined

please add specific leaflet version to dependencies or state the version this lib supposed to work alongside.

Dragging not working after removeLayer and addLayer

I'm toggling the visibility of a featureGroup using removeLayer() and addLayer().

But after a toggle, dragging is no longer working. I can still edit the points of a polyline, but dragging is not working.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.