Skip to content

Migration from outdated Leaflet.draw library to an actively maintained fork #816

@modos189

Description

@modos189

Current situation

IITC-CE uses the Leaflet.draw library, which has not been updated for 7 years. PR #813 proposes adding a confirmation when deleting all layers using the following code:

// Add Confirm request to Delete-All command
var original = L.EditToolbar.Delete.prototype.removeAllLayers;
L.EditToolbar.Delete.prototype.removeAllLayers = function () {
  if (confirm('Are you sure?')) {
    original.call(this);
  }
};

Problem

This approach involves direct modification of library methods in the IITC-CE code, which is not an optimal solution in terms of long-term code maintenance and may cause problems when updating the library.

Proposed solution

It is necessary to:

  1. Research existing forks of the Leaflet.draw library and choose an actively maintained option
  2. Or create our own fork of the library if no suitable one is found
  3. Transfer the changes proposed in PR drawtools: add delete confirmation dialog #813 to the selected/created fork
  4. Update dependencies in IITC-CE to use the new library instead of the outdated one

Metadata

Metadata

Assignees

No one assigned

    Labels

    developmentgeneral development issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions