alex3165 / react-leaflet-draw

React component for leaflet-draw on top of react-leaflet
228 stars 152 forks source link

Support for custom text and labels of the draw controls #169

Closed manuelpoelzl closed 1 year ago

manuelpoelzl commented 1 year ago

Hi,

would it be possible to get support for custom text and labels of the draw controls, so we can specify our own? This is already possible with leaflet itself like this:

L.drawLocal = {
      draw: {
        toolbar: {
          actions: {
            title: 'Cancel - your text-',
            text: '- your text-'
          },
          finish: {
            title: '- your text-',
            text: '- your text-'
          },
          undo: {
            title: '- your text-',
            text: '- your text-'
          },
          buttons: {
            polyline: '- your text-',
            polygon: '- your text-',
            rectangle: '- your text-',
            circle: '- your text-',
            marker: '- your text-',
            circlemarker: '- your text-'
          }
}

Maybe there is some way to make this work with EditControl of this library, since the structure is rather similar:

<EditControl
   position='topright'
   draw={{rectangle: false}}/>

My idea would be, that the draw property of the EditControl can take another toolbar property, which essentially mirrors the object above and enables us to specify our own texts for the controls.

giovanesantossilva commented 1 year ago

Hello, could you open an issue in the repository https://github.com/giovanesantossilva/react-leaflet-draft, I would be happy to try to help you!

manuelpoelzl commented 1 year ago

Hi @giovanesantossilva !

I've created an issue in your repo Issue

giovanesantossilva commented 1 year ago

Hi @manuelpoelzl

take a look at the new version of react-leaflet-draft if it helped you can close the issue here!