Leaflet / Leaflet.draw

Vector drawing and editing plugin for Leaflet
https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html
MIT License
1.98k stars 994 forks source link

Cant drag handles after drawing a shape #1011

Open t1a2l opened 3 years ago

t1a2l commented 3 years ago

I cant drag handles after drawing a shape. I have the same issue as this guy has: https://stackoverflow.com/questions/52297645/unable-to-drag-handles-when-editing-feature

but i don't have leaflet snap nor leaflet-geometryutil.

I am using leaflet 1.7.1 and leaflet draw 1.0.4, i saw a jsfiddle with the same libaries and it work fine.. apparently i have a plugin that creates a conflict but i don't know what.

@johnd0e - can you help?

johnd0e commented 3 years ago

Try these fixes:

    L.Draw.Polyline.prototype.options.shapeOptions.interactive = true;
    L.Draw.Polygon.prototype.options.shapeOptions.interactive = true;
    L.Draw.Rectangle.prototype.options.shapeOptions.interactive = true;
    L.Draw.CircleMarker.prototype.options.interactive = true;
    L.Draw.Circle.prototype.options.shapeOptions.interactive = true;

    // https://github.com/Leaflet/Leaflet.draw/issues/789
    // https://github.com/Leaflet/Leaflet.draw/issues/695
    L.Draw.Polyline.prototype._onTouch = L.Util.falseFn;

    // disable tap handler as it conflicts with leaflet.draw
    // https://github.com/Leaflet/Leaflet/issues/6977
    // !Note: currently this may brake `contextmenu` handling on iOS
    map.tap = map.tap ? map.tap.disable() : false;

If this will not solve your issue - than setup jsfiddle and let me see.

t1a2l commented 3 years ago

@johnd0e thanks, it didn't help.. it seems like a conflict with another plugin.. i found a js fiddle with only leaflet and leaflet draw and the editing works well.. the issue is this could be anything.. i am using these libaries: backbone, bootstrap-sass, bootstrap-datetimepicker, leaflet, leaflet-draw, moment, select2, cookies, dust_render, dust-helpers, dust, geolib, jquery, signature, xmltonjson. Does any of those could conflict with leaflet draw?

johnd0e commented 3 years ago

I have no idea, sorry.

t1a2l commented 3 years ago

@johnd0e Hey, so I found out that it is working in firefox without any issue, but not working in chrome for some reason. is there nay setting in chrome i need to change or edit for it to work?

t1a2l commented 3 years ago

@johnd0e found the problem. removing these lines solved it. (the tooltips on RTL maps block the editing and deleting functionality.


               edit: {
                   tooltip: {
                       text: 'Drag handles or markers to edit features.',
                       subtext: 'Click cancel to undo changes.'
                   }
               },
               remove: {
                   tooltip: {
                       text: 'Click on a feature to remove.'
                   }
               }
           }