Get location field integrating with form saving/loading (#52)
This commit is contained in:
parent
e067443756
commit
ee88a3160e
@ -106,7 +106,6 @@
|
||||
|
||||
// Add a help text control
|
||||
this._zoomHelpText = new ZoomHelpText().addTo(map)
|
||||
console.log(this._zoomHelpText)
|
||||
|
||||
// Only allow editing past a certain zoom level (see #56)
|
||||
// Remove the edit controls
|
||||
@ -120,6 +119,19 @@
|
||||
this.zoomLevelTooLow()
|
||||
}
|
||||
})
|
||||
|
||||
// Respond to underlying text field changing
|
||||
const textarea = document.getElementById(this.options.fieldid)
|
||||
textarea.addEventListener('change', evt => {
|
||||
this.load()
|
||||
})
|
||||
|
||||
const triggerChange = evt => {
|
||||
document.getElementById('case-study-form').dispatchEvent(new Event('dirty'))
|
||||
}
|
||||
map.on(L.Draw.Event.CREATED, triggerChange)
|
||||
map.on(L.Draw.Event.EDITED, triggerChange)
|
||||
map.on(L.Draw.Event.DELETED, triggerChange)
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user