martindholmes / BreezeMap

BreezeMap is a project to create a simple user interface for interactive map and facsimile editing based on TEI XML and OpenLayers 4+.
MIT License
11 stars 3 forks source link

Switch to HTML templates for constructing page components #32

Open martindholmes opened 3 years ago

martindholmes commented 3 years ago

The original methods by which the vector layer constructs page components such as menus was written before HTML templates were widely supported; it would probably be faster and more easily maintainable to have those functions use template elements built into the HTML in the template page itself.

martindholmes commented 4 months ago

Initial work on this is happening in the issue-32-templates branch. It's complicated by the fact that we don't actually control the host page HTML, so it may not even be practical. There seems little point in creating templates in JS at runtime, then using them; might as well create the elements themselves. However, there might be some way to inject the templates into existing HTML at build time, and then use them. That would involve processing the host page, though, and we don't currently do that except in the test projects.