Implemented in Leaflet-Geoman with Release 2.11.0. This Library will not longer supported
This is a Leaflet Geoman Subplugin
Demo: PMLock
Download index.js and include them in your project.
<script src="./dist/index.js"></script>
or use the script over cdn:
<script src="https://cdn.jsdelivr.net/gh/Falke-Design/PMLock@latest/dist/index.js"></script>
Create the L.PMLock button after Leaflet Geoman
pmLock = new L.PMLock(map)
You can add the library without the button:
pmLock = new L.PMLock(map,{showControl: false})
map.pm.enableDraw("Circle",{pathOptions:{pmLock: true}});
map.pm.disableDraw("Circle");
pmLock.setOptions(options)
showControl: true | false
text: {unlock: 'Unlock', lock: 'Lock', title: 'Lock / Unlock Layers', finish: 'Finish'}
pmLock.setText(text)
showControl: true | false
text: {unlock: 'Unlock', lock: 'Lock', title: 'Lock / Unlock Layers', finish: 'Finish'}
pmLock.enableLock(name, changeToolbar = true)
name: 'unlock' | 'lock' | ''
pmLock.disableLock(changeToolbar = true)
enable 'lock' | 'unlock' or disable all ' '
pmLock.toggle(name = 'lock', changeToolbar=true)
pmLock.render()
pmLock.getLockedLayers()
pmLock.getUnlockedLayers()