geoman-io / leaflet-geoman

🍂🗺️ The most powerful leaflet plugin for drawing and editing geometry layers
https://geoman.io
MIT License
2.21k stars 433 forks source link

Show Radius on Circle Draw #650

Closed Jhays10 closed 4 years ago

Jhays10 commented 4 years ago

Hey Everyone,

We're looking to have the Radius shown on draw.

This was partially discussed already here: https://github.com/geoman-io/leaflet-geoman/issues/188.

The issue we're running into is we're looking to have the ability to see the radius while drawing and not after. Currently looking through the code, there is no callbacks as to when the Circle is being drawn to set our own tooltip.

Within the L.PM.Draw.Circle.js file.

I see you're already calculating the radius on _finishShape() method. https://github.com/geoman-io/leaflet-geoman/blob/41810b57bec8e60f66b3191e68f084555e55b804/src/js/Draw/L.PM.Draw.Circle.js#L205-L207

To me it looks like we'd just need to move that functionality to also be used in the _syncHintMarker() method as well. https://github.com/geoman-io/leaflet-geoman/blob/41810b57bec8e60f66b3191e68f084555e55b804/src/js/Draw/L.PM.Draw.Circle.js#L149-L159

The only thing I'm unsure of is how this works in the projects translations and conversions for different Countries.

codeofsumit commented 4 years ago

Hi there,

Great question - we are currently building Measurement for all shapes including unit switching, metric and imperial system and the possibility to change those via the translations functionality for Leaflet-Geoman Pro: https://geoman.io/leaflet-geoman-pro

This will eventually also go into the open source library but the initial release will be in the Pro version only.