Skip to content

Optimized layer loading and fixed a ton of smaller issues#386

Merged
finnp-sogelink merged 56 commits into
developmentfrom
274-optimize-layer-loading
Jul 2, 2026
Merged

Optimized layer loading and fixed a ton of smaller issues#386
finnp-sogelink merged 56 commits into
developmentfrom
274-optimize-layer-loading

Conversation

@finnp-sogelink

@finnp-sogelink finnp-sogelink commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Changes — 274-optimize-layer-loading

Summary of all changes on this branch compared to the development branch
(base commit 90fd6c1). 74 files changed, ~1698 insertions / 372 deletions.


Highlights

  • Optimized layer loading — lazy loading of layer data, parallel processing
    of library connectors, and improved load-related UI/UX.
  • Layer library overhaul — reworked UI/UX, breadcrumbing, preview images,
    description formatting, skeleton loading states, and automatic layer addition.
  • Automatic layer discovery — WMS/WMTS layers can now be auto-found from a
    base URL via GetCapabilities.
  • GeoNetwork & CKAN connector fixes — attribution, date retrieval, settings
    error handling, and parallel connector processing.
  • Project tool update — Modernized the project tool
  • Numerous smaller UI fixes — scrollbars, tooltips, bookmarks, mobile layout,
    measure tool, flood legend, point clouds, and translations.
  • Added AGENTS.md documenting architecture, conventions, and pitfalls. Used for agentic coding

Layer loading & performance

  • Optimized layer loading with lazy data loading: CesiumLayer defers data
    loading until a layer is first visible or a tool explicitly requests it
    (startLoading() / ensureLoaded()).
  • Parallel processing of library connectors, with improved loading UI/UX.
  • Touched layers: 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.
  • Only load terrain / background layer manager when multiple options are present.

Layer library

  • Reworked layer library UI/UX and window scaling.
  • Improved breadcrumbing and navigation.
  • Improved layer library preview image handling.
  • Fixed layer library description formatting.
  • Updated layer description visualization and improved description UI.
  • Added LayerConfigGroupSkeleton.svelte for skeleton loading states.
  • Centered layer title text and fixed label sizing in several cases.
  • Now auto-adds a layer from the layer library when selected.
  • Automatic layer finding from a base URL for WMS/WMTS layers — new
    CustomLayers/capabilities.ts (GetCapabilities parsing) plus updates to
    CustomLibraryLayer.svelte, CustomLibraryLayerInfo.svelte, and
    custom-layer-config.ts.

Library connectors

  • GeoNetwork: added attribution, fixed date retrieval, and removed the
    GeoNetwork settings error.
  • CKAN: connector updates (ckan-connector.ts).
  • Added attribution support to the base library-connector.ts.

Layer manager

  • Remember custom layer on/off state across sessions.
  • Improved opacity / transparency slider width, including deeply nested layers.
  • Fixed layer manager spacers.
  • Updates to MapToolLayerControl.svelte, MapToolLayerManager.svelte, and
    LayerManagerGroup.svelte.

Bookmarks

  • Disabled bookmark editing for config-defined bookmarks.
  • Fixed bookmark labels.

Tools & feature info

  • Measure tool: fixed the edit window; minor cleanups in MeasureEntry.svelte.
  • Flooding: improved the flooded-roads (flood_depth) legend UI.
  • Stories: abort drawing polygons while a PDF is still generating; story view
    and draw-polygon refinements.
  • Isochrones: minor draw / layer fixes.
  • Help: small view/tab cleanups.
  • Feature info: view formatting tweaks (FeatureInfoView.svelte).

Point clouds & 3D

  • Fixed pointcloudAttenuationBaseResolution being ignored.
  • Set non-harmful point-cloud variables even for non-.pnts point-cloud layers.

Styling & layout

  • Improved scrollbar behavior and resolved Firefox/Chromium differences; removed
    scrollbars where not necessary (tosti.scss, route layouts).
  • Fixed mobile layout for the header and library.
  • Tooltips: fixed hidden/clipped tooltips and tooltip layering (z-index).
  • Removed unused slicer/clip style; improved LayerControlClip.
  • Removed video margin and fixed minor styling issues.

Internationalization

  • Added missing translations and synced new keys across en.json, nl.json,
    and fr.json.
  • Updates to localization.ts.

Misc / housekeeping

  • Added AGENTS.md (architecture, conventions, pitfalls).
  • Added attribution fallback and BAG attribution; fixed metadata spacing.
  • Improved IDs, squashed warnings, and removed stray console.log / logging.
  • Fixed the last class not being filterable when filtering all classes.
  • Fixed "zoom to layer".

@witte-sogelink witte-sogelink left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@finnp-sogelink finnp-sogelink marked this pull request as draft June 23, 2026 09:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md documentation.

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 both contentType and contenttype; currently only contentType is read here, so contenttype values 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 both contentType and contenttype; currently only contentType is read here, so contenttype values 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.

Comment thread src/lib/map-core/layer-library.ts
@finnp-sogelink finnp-sogelink marked this pull request as ready for review July 2, 2026 10:10

@Larsvanduin Larsvanduin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works

@finnp-sogelink finnp-sogelink merged commit 4bcbc78 into development Jul 2, 2026
2 checks passed
@finnp-sogelink finnp-sogelink deleted the 274-optimize-layer-loading branch July 2, 2026 12:40
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.

4 participants