I am trying to revive some of the code of Leaflet-Illustrate:

It uses some Leaflet code that I believe is attaching hooks by using this:

statics: {
    START: L.Draggable.START,
    END: L.Draggable.END,
    MOVE: L.Draggable.MOVE

initialize: function(element, selectStartTarget) {
    this._element = element;
    this._selectStartTarget = selectStartTarget || element;

addHooks: function() {
    var start = L.Draw.Selectable.START;
    L.DomEvent.on(this._selectStartTarget, start.join(' '), this._onDown, this);

removeHooks: function() {
    var start = L.Draw.Selectable.START;
    L.DomEvent.off(this._selectStartTarget, start.join(' '), this._onDown, this);

_onDown: function(event) {

Somehow it attaches hooks to the rectangle that was drawn and makes a textbox (textarea) that attached to it. I've got that done, of having a rectangle with a textbox in it. I just can't seem to attach the textbox to the rectangle so that it moves wiht it in an edit mode.

Does anyone know how the L.Draggable.START/END/MOVE relate to modern Draggable actions?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.