Optimized layer loading and fixed a ton of smaller issues#386
Conversation
…nager when there are multiple options present
witte-sogelink
left a comment
There was a problem hiding this comment.
Looks good! Only changes are the 100 in the unfolded transparency slider falls of the edge of the element and the background layer. I am unable to make the selection disappear and when deleting it from the config it stays in the menu but just reselects the map that is already present I think. But i'm unsure if this is what's happening.
…armful pointcloud variables even for non '.pnts' pointcloud layers
There was a problem hiding this comment.
Pull request overview
This PR significantly refactors layer loading and the layer library experience, introducing lazy loading for Cesium layers, parallel connector fetching, and multiple UI/UX and i18n improvements across tools and components.
Changes:
- Implement lazy layer loading via
CesiumLayer.startLoading()/ensureLoaded()and update multiple layer subclasses and tools to use it. - Overhaul the layer library and connector pipeline (parallel connector loading + connector metadata surfaced in UI + skeleton loading states).
- Apply a broad set of UI, accessibility, and localization fixes (scrollbars, tooltips, mobile layout, translations, stories, flooding/isochrones, etc.), plus add
AGENTS.mddocumentation.
Reviewed changes
Copilot reviewed 74 out of 74 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| static/example.config.json | Adds attribution and CKAN connector example config. |
| src/routes/+page.svelte | Exposes params prop in route page. |
| src/routes/+layout.svelte | Exposes params prop in route layout. |
| src/routes/[config]/+page.svelte | Exposes params prop for config route. |
| src/routes-static/+page.svelte | Exposes params prop in static page. |
| src/routes-static/+layout.svelte | Exposes params prop in static layout. |
| src/routes-static/[config]/+page.svelte | Exposes params prop for static config route. |
| src/lib/styles/tosti.scss | Updates global scrollbar styling. |
| src/lib/map-core/library-connectors/library-connector.ts | Adds label to connector interface. |
| src/lib/map-core/library-connectors/geonetwork/geonetwork-connector.ts | Connector metadata/date/attribution fixes + settings parsing hardening. |
| src/lib/map-core/library-connectors/ckan/ckan-connector.ts | Connector metadata/attribution/date updates + logging tweaks. |
| src/lib/map-core/layer-manager-group.ts | Adds connector/toolGroup metadata to manager groups. |
| src/lib/map-core/layer-library.ts | Tracks “loading connectors” for skeleton UI. |
| src/lib/map-core/layer-config.ts | Adds date fields + converts camera position into a store-backed property. |
| src/lib/map-core/layer-config-group.ts | Adds toolGroup metadata to config groups. |
| src/lib/map-cesium/providers/wfs-provider.ts | Removes stray console logging. |
| src/lib/map-cesium/providers/vector-imagery-provider.ts | Removes commented debug logging. |
| src/lib/map-cesium/map-options.ts | Fixes point cloud base resolution option mapping. |
| src/lib/map-cesium/layers/wmts-layer.ts | Adjusts WMTS provider URL handling (now strips query). |
| src/lib/map-cesium/layers/wms-layer.ts | Adjusts WMS provider URL handling (now strips query). |
| src/lib/map-cesium/layers/wfs-layer.ts | Moves WFS provider creation to lazy startLoading. |
| src/lib/map-cesium/layers/vector-tiles-layer.ts | Defers creation to createLayer() for lazy loading. |
| src/lib/map-cesium/layers/threedee-layer.ts | Defers tileset creation + point cloud style/controls tweaks. |
| src/lib/map-cesium/layers/ogc-features-layer.ts | Moves OGC Features provider creation to lazy startLoading. |
| src/lib/map-cesium/layers/imagery-layer.ts | Defers imagery source creation to lazy startLoading. |
| src/lib/map-cesium/layers/i3s-layer.ts | Defers I3S source creation to lazy startLoading. |
| src/lib/map-cesium/layers/geojson-layer.ts | Gates addToMap behind lazy load + fill style guard. |
| src/lib/map-cesium/layers/cesium-layer.ts | Introduces lazy loading orchestration + ensureLoaded(). |
| src/lib/map-cesium/drag-n-drop.ts | Switches to UUID IDs + improves error logging. |
| src/lib/i18n/localization.ts | Syncs document <html lang> with selected locale. |
| src/lib/i18n/json/nl.json | Adds new/updated translation keys (NL). |
| src/lib/i18n/json/fr.json | Adds new/updated translation keys (FR). |
| src/lib/i18n/json/en.json | Adds new/updated translation keys (EN). |
| src/lib/components/widgets/MapWidgetLoading/MapWidgetLoading.svelte | Uses console.error instead of console.log. |
| src/lib/components/tools/MapToolStories/StoryView.svelte | Refactors story layout/scroll container + tooltip positions. |
| src/lib/components/tools/MapToolStories/StoryChart/StoryChartDownloadButton.svelte | Updates tooltip position. |
| src/lib/components/tools/MapToolStories/DrawPolygon.svelte | Adds AbortController cancellation + localized error title. |
| src/lib/components/tools/MapToolMenu.svelte | Improves mobile layout + scrollbar-gutter handling. |
| src/lib/components/tools/MapToolLayerManager/MapToolLayerManager.svelte | Avoids base-layer selector when only one background layer. |
| src/lib/components/tools/MapToolLayerManager/MapToolLayerControl.svelte | Adds clamped/expandable descriptions + tooltip/i18n tweaks. |
| src/lib/components/tools/MapToolLayerManager/LayerManagerGroup.svelte | Shows toolGroup icon + connector tag link. |
| src/lib/components/tools/MapToolLayerManager/CesiumBackgroundControls.svelte | Minor spacing styling change. |
| src/lib/components/tools/MapToolLayerLibrary/MapToolLayerLibraryView.svelte | Adds breadcrumb improvements + skeleton groups while loading. |
| src/lib/components/tools/MapToolLayerLibrary/MapToolLayerLibrary.svelte | Parallel connector loading + persist My Data visibility. |
| src/lib/components/tools/MapToolLayerLibrary/LibraryLayerInfo.svelte | Adds image loading state + copy-to-clipboard notifications + date fields. |
| src/lib/components/tools/MapToolLayerLibrary/LibraryLayer.svelte | Adds add/remove tooltips + title truncation improvements. |
| src/lib/components/tools/MapToolLayerLibrary/LayerConfigGroupSkeleton.svelte | New skeleton component for loading connectors. |
| src/lib/components/tools/MapToolLayerLibrary/LayerConfigGroup.svelte | Adds toolGroup icon + connector tag link. |
| src/lib/components/tools/MapToolLayerLibrary/CustomLayers/CustomLibraryLayerInfo.svelte | Adds GetCapabilities-driven WMS/WMTS layer discovery UI. |
| src/lib/components/tools/MapToolLayerLibrary/CustomLayers/CustomLibraryLayer.svelte | Adds add/remove tooltips + truncation improvements. |
| src/lib/components/tools/MapToolLayerLibrary/CustomLayers/custom-layer-config.ts | Adds UUID IDs + defaults + GetCapabilities URL building/validation. |
| src/lib/components/tools/MapToolLayerLibrary/CustomLayers/capabilities.ts | New GetCapabilities fetch/parse/cache utilities. |
| src/lib/components/tools/MapToolIsochrones/isochrones-layer.ts | Ensures referenced layer is loaded for isochrones tool. |
| src/lib/components/tools/MapToolIsochrones/DrawIsochrones.svelte | Awaits layer ensureLoaded() before using data values. |
| src/lib/components/tools/MapToolHelp/Tabs/TabMovement.svelte | Minor layout tweak. |
| src/lib/components/tools/MapToolHelp/MapToolHelpView.svelte | Uses overflow-y: auto. |
| src/lib/components/tools/MapToolFlooding/MapToolFlooding.svelte | Passes label to controller for toolGroup metadata. |
| src/lib/components/tools/MapToolFlooding/layer-controller.ts | Sets toolGroup + ensures floodedRoads layer is loaded. |
| src/lib/components/tools/MapToolFeatureInfo/FeatureInfoView.svelte | Localizes link/open labels + improves PDF object title. |
| src/lib/components/tools/MapToolCesiumMeasure/MeasureEntry.svelte | Localizes placeholders/tooltips + minor UI tweaks. |
| src/lib/components/tools/MapToolCesiumMeasure/MapToolCesiumMeasure.svelte | Renames prop to editing. |
| src/lib/components/tools/MapToolButton.svelte | Always renders label + adjusts active label color. |
| src/lib/components/tools/MapToolBookmarks/MapToolBookmarks.svelte | Disables editing for non-editable bookmarks + rename variables. |
| src/lib/components/Page.svelte | Localizes GitHub link title + header layout tweaks. |
| src/lib/components/notifications/NotificationView.svelte | Improves notification sizing/overflow handling. |
| src/lib/components/layer-controls/LayerControls/LayerControlOGCFeaturesLayer.svelte | Improves legend rendering + adds i18n support. |
| src/lib/components/layer-controls/LayerControlGeoJSON/LayerControlGeoJSON.svelte | Localizes “all other” and tooltip text. |
| src/lib/components/layer-controls/LayerControlClip/LayerControlClip.svelte | Removes unused slice mode UI and adjusts button kind. |
| src/lib/components/header/search-active.ts | New store for header search “active” state. |
| src/lib/components/header/Language.svelte | Renames class on radio buttons. |
| src/lib/components/header/HeaderUtilityModeSwitcher/HeaderUtilityModeSwitcher.svelte | Hides mode switcher on small screens when search active. |
| src/lib/components/header/HeaderUtilityGeocoder/HeaderUtilityGeocoder.svelte | Responsive width + sets searchActive on active/inactive. |
| src/lib/components/header/CarbonHeader.svelte | Localizes logo alt + hides title/subtitle when search active. |
| AGENTS.md | Adds architecture/conventions/pitfalls documentation. |
Comments suppressed due to low confidence (2)
src/lib/map-cesium/layers/wmts-layer.ts:41
- Splitting the WMTS url on
?drops any required query params (e.g. API keys) and can break services. Also, the config/connector code uses bothcontentTypeandcontenttype; currently onlycontentTypeis read here, socontenttypevalues are ignored. Consider stripping only GetCapabilities-related params while preserving other query params, and accept both keys for the image format.
src/lib/map-cesium/layers/wms-layer.ts:20 - Splitting the WMS url on
?drops any required query params (e.g. API keys) and can break services. Also, the codebase/configs use bothcontentTypeandcontenttype; currently onlycontentTypeis read here, socontenttypevalues are ignored. Consider stripping only GetCapabilities-related params while preserving other query params, and accept both keys for the image format.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ded missing french translation
made connector loading more robust Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: finnp-sogelink <finn.peranovic@sogelink.com>
Changes —
274-optimize-layer-loadingSummary of all changes on this branch compared to the
developmentbranch(base commit
90fd6c1). 74 files changed, ~1698 insertions / 372 deletions.Highlights
of library connectors, and improved load-related UI/UX.
description formatting, skeleton loading states, and automatic layer addition.
base URL via GetCapabilities.
error handling, and parallel connector processing.
measure tool, flood legend, point clouds, and translations.
AGENTS.mddocumenting architecture, conventions, and pitfalls. Used for agentic codingLayer loading & performance
CesiumLayerdefers dataloading until a layer is first visible or a tool explicitly requests it
(
startLoading()/ensureLoaded()).cesium-layer.ts,geojson-layer.ts,i3s-layer.ts,imagery-layer.ts,ogc-features-layer.ts,threedee-layer.ts,vector-tiles-layer.ts,wfs-layer.ts,wms-layer.ts,wmts-layer.ts.Layer library
LayerConfigGroupSkeleton.sveltefor skeleton loading states.CustomLayers/capabilities.ts(GetCapabilities parsing) plus updates toCustomLibraryLayer.svelte,CustomLibraryLayerInfo.svelte, andcustom-layer-config.ts.Library connectors
GeoNetwork settings error.
ckan-connector.ts).attributionsupport to the baselibrary-connector.ts.Layer manager
MapToolLayerControl.svelte,MapToolLayerManager.svelte, andLayerManagerGroup.svelte.Bookmarks
Tools & feature info
MeasureEntry.svelte.flood_depth) legend UI.and draw-polygon refinements.
FeatureInfoView.svelte).Point clouds & 3D
pointcloudAttenuationBaseResolutionbeing ignored..pntspoint-cloud layers.Styling & layout
scrollbars where not necessary (
tosti.scss, route layouts).LayerControlClip.Internationalization
en.json,nl.json,and
fr.json.localization.ts.Misc / housekeeping
AGENTS.md(architecture, conventions, pitfalls).console.log/ logging.