You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to add a custom drawing control in Leaflet-Geoman that behaves exactly like the Marker tool (same UI and drawing behavior), but instead of creating a regular L.Marker, I want it to create a custom extended class, like L.NewMarkerCustom, so I can later treat it differently.
Then listening to pm:create and manually replacing:
map.on('pm:create',(e)=>{if(e.shape==='NewMarkerCustom'){constlatlng=e.layer.getLatLng();map.removeLayer(e.layer);// add new marker to the map or do some custom stuff}});
This works, but feels like a workaround.
💡 Feature Request / Question:
Is there a cleaner way to register a new shape type (like NewMarkerCustom) that:
Uses the same interaction as Marker
But creates a custom extended class like L.NewMarkerCustom
Without manually removing & replacing layers on pm:create
Would this be possible now or planned for the future?
Thanks for the awesome tool and your time! 🙌
Actually I have thought this maybe would be even more complicated and redundant current approach is fine
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! 👋
I'd like to add a custom drawing control in Leaflet-Geoman that behaves exactly like the Marker tool (same UI and drawing behavior), but instead of creating a regular L.Marker, I want it to create a custom extended class, like L.NewMarkerCustom, so I can later treat it differently.
What I've tried:
Then listening to pm:create and manually replacing:
This works, but feels like a workaround.
💡 Feature Request / Question:
Is there a cleaner way to register a new shape type (like NewMarkerCustom) that:
Would this be possible now or planned for the future?
Thanks for the awesome tool and your time! 🙌
Actually I have thought this maybe would be even more complicated and redundant current approach is fine
Beta Was this translation helpful? Give feedback.
All reactions