In Drupal 7 this module originally utilised the Leaflet plugin called Leaflet.draw to enable the creation and editing of geometries (points, lines, polygons, etc) directly onto a Leaflet map.

This request is to add the Leaflet.draw plugin to the Drupal 8 version of this module. This request focuses on the initial inclusion and setup of the plugin. Further feature requests will be submitted to make use of the functionality once the basic Leaflet.draw plugin is working.

Comments

ken-g created an issue. See original summary.

ken-g’s picture

Status: Active » Needs review
StatusFileSize
new3.14 KB

Here is a patch that implements the Leaflet.draw plugin into this Leaflet Widget module. The actual Leaflet.draw plugin has to be downloaded manually from GitHub into a library folder called /libraries/Leaflet.draw. A separate issue will be raised to download this plugin via Composer.

Installing this patch will recognise the new plugin, and will show the Leaflet.draw toolbar on the right hand side of the Leaflet map. NB. Further separate feature requests will be required before any geometries drawn on the map can be save in the underlying Geofield.

ken-g’s picture

Title: Implement Leaflet.draw for creating and maintain geometries » Implement Leaflet.draw for creating and maintaining geometries
ayalon’s picture

Before you invest too much time. I just released my fully refactored version of this module. I cannot provide a patch, because I basicly rewrote it from scratch. Its was more stable than the current version and supports all kind of markers / polygons.

Maybe we can release it as branch 2.0?

https://github.com/ayalon/leaflet_widget

fmb’s picture

Thanks for your work ken-g and ayalon. Since ayalon's module is to be merged in a 2.x-branch (#3031091: New version of the module supporting drawing / polygons.), you should then contribute your feature on this branch if still needed.

ayalon’s picture

The new branch 2.x-dev leverage the Leaflet.pm module with a better support of multipolygon. This thread can be closed.
See:
https://www.drupal.org/project/leaflet_widget/issues/3031091

ayalon’s picture

Status: Needs review » Closed (won't fix)