feat(gui-editor): add multi-layer data-bound Map component to No-Code editor - #185
Open
prasadadhav wants to merge 2 commits into
Open
feat(gui-editor): add multi-layer data-bound Map component to No-Code editor#185prasadadhav wants to merge 2 commits into
prasadadhav wants to merge 2 commits into
Conversation
- Replace OSM iframe preview with react-leaflet MapContainer + TileLayer - Add data-source trait (class picker) + latitude-field, longitude-field, marker-label-field selects; geo-field options populate dynamically when a class is chosen - Inject Leaflet CSS into GrapesJS iframe canvas to fix tile/marker rendering - Fix: remove 'map' from removeUnwantedBlocks — our custom block used the same id and was being deleted on every editor load - Add leaflet ^1.9.4, react-leaflet ^4.2.1, @types/leaflet to package.json - Add latitudeField, longitudeField, markerLabelField i18n keys to all 6 locales - registerMapComponent.ts, mapConfig.ts, MapComponent.tsx wired into editor
Replace the flat data-source/field traits on the Map block with a repeatable layer-manager trait. Each layer has its own type selector (points / geojson / choropleth / heatmap), data-source picker, and conditional field selects driven by the bound class's attributes. - Add registerLayerManagerTrait.ts — custom GrapesJS TraitManager type serialising layers to a single `map-layers` JSON attribute - Rewrite mapConfig.ts — remove flat field traits, add layer-manager trait - Rewrite registerMapComponent.ts — wire layer-manager; rebuild preview on every attribute change - Rewrite MapComponent.tsx — show per-layer badge strip in the editor preview - Add i18n keys (layerManager.title / addLayer / traits.layers) to all six locale files (en, de, fr, es, ca, lb)
Open
7 tasks
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.
Summary
Implements the frontend editor side of the Map component feature requested in BESSER-PEARL/BESSER#479.
Adds a fully configurable, data-bound Map block to the GrapesJS-based No-Code editor. Users can drag-and-drop a Map onto any screen, attach domain classes as data sources, and configure multiple typed layers (points, geojson, choropleth, heatmap) through a repeatable layer-manager trait, all without writing code.
Changes
Layer Manager Trait
registerLayerManagerTrait.ts: custom GrapesJS TraitManager typethat serialises the full layer stack to a single
map-layersJSON attributeconditional field selects populated dynamically from the bound class
Map Block
mapConfig.ts: remove flat field traits, wire layer-manager traitregisterMapComponent.ts: rebuild live preview on everyattribute change; fix: remove
mapfromremoveUnwantedBlocks(ourblock id was being deleted on every editor load)
MapComponent.tsx: per-layer badge strip in the editor previewMapContainer+TileLayerDependencies
leaflet ^1.9.4,react-leaflet ^4.2.1,@types/leaflettopackage.jsoni18n
layerManager.title,addLayer,traits.layerskeys to all sixlocale files:
en,de,fr,es,ca,lbRelates to
feat/maps_webapp_component)Acceptance Criteria Covered