pm:vertexadded event listener isnt triggered when placing a vertex with a rectangle.
BrandanDoesCode opened this issue · comments
BrandanDoesCode commented
https://jsfiddle.net/mpotq23b/1/
as shown in the above jsfiddle, the console .log for vertex added appears when using the polygon tool, however it does not work when using rectangle tool.
Please let me know if there is another way to detect if first point of recetangle has been placed
Florian Bischof commented
pm:vertexadded
is currently not implement for Rectangle.
You can use this workaround:
map.on('pm:drawstart',(e)=>{
if(e.shape === 'Rectangle'){
map.pm.Draw.Rectangle._startMarker.on('move', ()=>{
console.log('start Marker set')
})
}
})
BrandanDoesCode commented
This fix works awesome thank you !