Skip to content

feat: AddTempLayer plugin (WMS/WMTS/XYZ/GeoJSON) + core layer-add bus#126

Open
BhattaraiSijan wants to merge 10 commits into
developmentfrom
feat/add-temp-layer-plugin
Open

feat: AddTempLayer plugin (WMS/WMTS/XYZ/GeoJSON) + core layer-add bus#126
BhattaraiSijan wants to merge 10 commits into
developmentfrom
feat/add-temp-layer-plugin

Conversation

@BhattaraiSijan

Copy link
Copy Markdown
Collaborator

Purpose

Add an AddTempLayer plugin — "Add layer from URL" — letting users drop an external WMS / WMTS / XYZ / GeoJSON layer onto the map for the current session, plus the core event-bus and rendering support it needs. Built to the monorepo tool pattern: a portable lib/ of presentational React components with all MMGIS coupling isolated in adapters/, communicating with the core over the window.mmgisAPI event bus only.

Proposed Changes

  • [ADD] AddTempLayer plugin (monorepo pattern):
    • lib/ (portable): AddTempLayerPanel (trigger + form state) and AddLayerModal (presentational), utils/url (validateUrl, detectLayerType), utils/icons, BEM blocks-* classes, Path A --theme-* styling.
    • adapters/buildLayerObj (URL → MMGIS layer object), MMGISAddTempLayerAdapter (bus bridge), thin AddTempLayerTool (createRoot), config.json with modern-layout metadata.
  • [ADD] Core bus channels layers:addLayer / layers:removeLayer (Layers_.js), backed by mmgisAPI.addLayer/removeLayer — session-only, in-memory add via resetConfig + modifyLayer (lost on reload).
  • [ADD] WMS / WMTS rendering support:
    • DeckGL: WMSLayer branch in DeckGLHelpers (with parseWmsUrl) selected when tileformat === 'wms'; tileformat threaded through TileLayerOptions and the deck tile call in Map_.js.
    • Leaflet: WMS already supported via WMSColorFilter.
    • WMTS-KVP is rewritten plugin-side into a {z}/{y}/{x} template so it renders through the standard template-tile path in both engines.
  • [CHANGE] layers:listChanged event replaces the direct LayersTool destroy/make on layer mutation, so any subscriber (modern or classic layout) can react — decoupled.
  • [CHANGE] validateUrl rejects internal whitespace, guarding against two URLs pasted into one field.

Issues

Testing

  • npm run typecheck0 errors.

  • Browser (DeckGL engine), verified end-to-end per type — add one URL at a time:

    XYZ

    https://tile.openstreetmap.org/{z}/{x}/{y}.png
    

    WMS (needs a LAYERS param)

    https://ows.terrestris.de/osm/service?SERVICE=WMS&REQUEST=GetMap&LAYERS=OSM-WMS
    

    WMTS — REST template

    https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/BlueMarble_ShadedRelief/default/GoogleMapsCompatible_Level8/{z}/{y}/{x}.jpeg
    

    WMTS — KVP (exercises the KVP→template rewrite)

    https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/wmts.cgi?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=BlueMarble_ShadedRelief&STYLE=default&TILEMATRIXSET=GoogleMapsCompatible_Level8&FORMAT=image/jpeg
    

    GeoJSON (CORS-enabled host)

    https://raw.githubusercontent.com/PublicaMundi/MappingAPI/master/data/geojson/countries.geojson
    

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

✅ Version Already Updated

This PR includes a manual version update to 4.2.9-20260211

No automatic version bump needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant