feat: AddTempLayer plugin (WMS/WMTS/XYZ/GeoJSON) + core layer-add bus#126
Open
BhattaraiSijan wants to merge 10 commits into
Open
feat: AddTempLayer plugin (WMS/WMTS/XYZ/GeoJSON) + core layer-add bus#126BhattaraiSijan wants to merge 10 commits into
BhattaraiSijan wants to merge 10 commits into
Conversation
…to feat/add-temp-layer-plugin
✅ Version Already UpdatedThis PR includes a manual version update to No automatic version bump needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inadapters/, communicating with the core over thewindow.mmgisAPIevent bus only.Proposed Changes
AddTempLayerplugin (monorepo pattern):lib/(portable):AddTempLayerPanel(trigger + form state) andAddLayerModal(presentational),utils/url(validateUrl,detectLayerType),utils/icons, BEMblocks-*classes, Path A--theme-*styling.adapters/buildLayerObj(URL → MMGIS layer object),MMGISAddTempLayerAdapter(bus bridge), thinAddTempLayerTool(createRoot),config.jsonwith modern-layoutmetadata.layers:addLayer/layers:removeLayer(Layers_.js), backed bymmgisAPI.addLayer/removeLayer— session-only, in-memory add viaresetConfig+modifyLayer(lost on reload).WMSLayerbranch inDeckGLHelpers(withparseWmsUrl) selected whentileformat === 'wms';tileformatthreaded throughTileLayerOptionsand the deck tile call inMap_.js.WMSColorFilter.{z}/{y}/{x}template so it renders through the standard template-tile path in both engines.layers:listChangedevent replaces the directLayersTooldestroy/make on layer mutation, so any subscriber (modern or classic layout) can react — decoupled.validateUrlrejects internal whitespace, guarding against two URLs pasted into one field.Issues
Testing
npm run typecheck→ 0 errors.Browser (DeckGL engine), verified end-to-end per type — add one URL at a time:
XYZ
WMS (needs a
LAYERSparam)WMTS — REST template
WMTS — KVP (exercises the KVP→template rewrite)
GeoJSON (CORS-enabled host)