farmOS-map icon indicating copy to clipboard operation
farmOS-map copied to clipboard

Consider implementing our own ol-popup overlay

Open paul121 opened this issue 3 years ago • 0 comments

We currently use: https://github.com/walkermatt/ol-popup and there hasn't been a release in a few years. It still works and I don't think we're facing any major issues from it, but the code if quite simple and I'm curious if we would benefit from rolling our own version and having more control over the Popup overlay class. A few reasons off the top of my head:

  • Ability to customize events (#176)
  • Ability to add helper methods to the popup itself.
    • Rather than adding arbitrary HTML as we do in farmOS core: https://github.com/farmOS/farmOS/blob/fc77c86abe6b142702e7b103cd85e0c207333b79/modules/core/map/js/farmOS.map.behaviors.popup.js#L40-L51 there could be methods setName, setDescription, etc that abstract this out
    • Perhaps include a helper function to get the features associated with the popup: https://github.com/farmOS/farmOS/blob/fc77c86abe6b142702e7b103cd85e0c207333b79/modules/core/map/js/farmOS.map.behaviors.popup.js#L20
  • More control over popup styling

paul121 avatar Aug 11 '22 17:08 paul121