leaflet.measure icon indicating copy to clipboard operation
leaflet.measure copied to clipboard

General suggestions

Open kingrollo opened this issue 11 years ago • 3 comments

I really like this plugin - it's much cleaner than the other measure tool that's floating around. You should submit it to the full Leaflet plugins page.

There are two things I'd change (have changed actually in my implementation). Firstly, it would be nice if it was more easily configurable for different units - even if it just meant passing the calculation as a formula to the library when loaded. Secondly, the icon isn't too intuitive - I've shared the one I'm using below...

ruler

Thanks!

kingrollo avatar Jul 08 '13 09:07 kingrollo

I totaly agree adding to the Leaflet Plugin list would be really practical.

kartenkarsten avatar Jul 23 '13 14:07 kartenkarsten

I agree that there should be an option for setting units. You can add "options" to the extended Polyline class of leaflet.measurecontrol.js but this is just a hack.

L.Polyline.Measure = L.Draw.Polyline.extend({
    options: {
        metric: false
  },
 ....

It would be nice to set these options when adding the control to the map (i.e. L.Control.measureControl({metric:false}).addTo(map)).

I'll try to come back to this when I have more time.

justinlewis avatar Jan 14 '14 22:01 justinlewis

Great plugin, I'm using it at work. I've added map events to start/stop measuring in my fork, https://github.com/jonathandarrer/leaflet.measure which my company is now using. If you want to pull this change into your repository, then feel free to. What do you think?

_startMeasuring: function() {
  ...
  this._map.fire('measure:measurestart', { layerType: this.type });
  ...
}

_stopMeasuring: function() {
  ...
  this._map.fire('measure:measurestop', { layerType: this.type });
  ...
}

jonathandarrer avatar Feb 20 '15 09:02 jonathandarrer