Needs work
Project:
Leaflet Widget for Geofield
Version:
7.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Jul 2013 at 13:28 UTC
Updated:
15 Jan 2014 at 13:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jodydeanrogan commentedHi All,
I'm still trying, I've looked everywhere, I've even tried with CSS, still no luck. Would anybody be able to point me in the right direction?
BTW, love the work being done with Leaflet on Drupal.
Thanks in advance.
Comment #2
pcambraI think this is an extremely useful feature, I was struggling with it for a while and here's the "hack" solution that doesn't run the init method for the leaflet widget library but a custom one and mimics the draw control instead.
In widget.js, add this:
just before:
And then add this for getting the remove button back just after the map.widget.enable():
map.selectControl = L.Control.select().addTo(map);Attaching it as a patch in case someone uses drush make or something but this is not a definitive solution.
Comment #3
pcambraNow what I think it would be the right fix.
In the Leaflet.widget library (https://github.com/tnightingale/Leaflet.widget) the initialize() method of Leaflet.widget.js should pass the draw options to the initDraw one:
And the _initDraw() method then can just decide on that options if it should display or not display the element and its position:
Here, in the drupal module, the widget/field options should expose the position and display a checkbox for disabling the polyline, polygon and deletion buttons of the toolbar.
I can provide a proper patch with the things described above if the maintainer is still around.