javascriptreactjsleaflet-geoman

Editing Geoman map cursor tooltip


In my React app, I'd like to edit the text displayed in the cursor tool-tip when using a Geoman tool (and providing texts for different languages like Geoman does). Is there any built-in way to do this or should I use a querySelector ?


Solution

  • You can overwritte the tooltips with your custom translation:

    const customTranslation = {
      tooltips: {
        placeMarker: 'Custom Marker Translation',
      },
    };
    
    map.pm.setLang('customName', customTranslation, 'en');