Commit ac25192
committed
refactor: extract layer UI into <mapmlify-layer> custom element
Introduce a new <mapmlify-layer> custom element that encapsulates
per-layer DOM structure, controls, event handling, and viewer lifecycle.
Each display function (WMS, WMTS, ESRI MapServer, ESRI ImageServer) now
creates <mapmlify-layer> elements with a single layerConfig property
instead of building DOM and wiring events inline.
- Add src/script/mapmlify-layer.js (1796 lines): vanilla HTMLElement
using Light DOM with a property-driven render pattern
- Simplify all four display functions in main.js to create elements
and set layerConfig
- Remove 15 now-unused functions (createViewerForLayer,
addLayerToViewer, removeViewerForLayer, createQueryLink,
updateLayerQueryInViewer, and their WMTS/ESRI variants)
- Export helper functions (formatDimensionParam, wgs84ToWebMercator,
buildWMTSTileUrl, buildGetMapUrl) for use by the custom element
- main.js reduced from ~3500 to ~1230 lines1 parent 979045e commit ac25192
2 files changed
Lines changed: 2264 additions & 3036 deletions
0 commit comments