Skip to content

Model and viewer changes for proj4leaflet#7739

Open
na9da wants to merge 21 commits intomainfrom
proj4leaflet-model
Open

Model and viewer changes for proj4leaflet#7739
na9da wants to merge 21 commits intomainfrom
proj4leaflet-model

Conversation

@na9da
Copy link
Collaborator

@na9da na9da commented Dec 9, 2025

What this PR does

Summary of changes:

  • Add TilingSchemeRegistry which allows registering custom tiling scheme
  • Add custom tiling scheme support for WebMapServiceCatalogItem
    • Add method createImageryProviderForCrs() to request imageryprovider with custom tiling scheme
    • Add CrsTraits
      • Use tilingSchemeGenerator trait, if defined, to generate a custom tiling scheme
      • Read CRS bounding box from GetCapabilites to get more accurate extent info for custom CRS
  • Add support for creating/saving CameraView from polygon extent to more accurately describe the current view
    This is required when some CRS (eg Antarctica) require more than 2 latlon points to describe an extent precisely
  • Cesium - Ignore imagery layers using custom tiling scheme
  • Leaflet - Accept map options in constructor
    This is used by the plugin to initialize the map with custom projection
  • DataPreviewMap
  • TerriaViewer
    • Extract viewer loading logic into ViewerLoader to allow loading custom instances of Cesium/Leaflet viewer

TBD: Add tests for the new classes

Test me

Note that for the below tests, the proj4leaflet-plugin has be enabled and configured for the CI branch. The plugin is required for rendering custom projections. The plugin works by overriding the traits for WMS items using this CrsModelStratum.

  • Using base maps with custom projection

    • Open this CI link
    • Make sure you can switch to and view Antarctica (EPSG:3031), and Tasmania (EPSG:23855) base maps.
  • Previewing datasets with custom projection

    • Open this CI link
    • Open the catalog and preview datasets under Antarctica, Tasmania and Switzerland
      (Some of the Antarctica datasets are slow to load so it might take a bit for the preview to appear)
    • Make sure you can preview these datasets in custom projection even when the map viewer is in 3D / standard projection
  • Adding datasets with custom projection

    • When the base map supports the custom projection

      • Open this CI link which has the Antarctica basemap active by default
      • Add datasets from the Antarctica group
      • Observe that you can view these datasets on the map
      • Observe that you are able to view feature info by clicking on the map
        Note some of the layers have a low max zoom so they'll disappear if you zoom in too close
    • When the base map does not support the custom projection

      • Open this CI link which is in 3D mode
      • Try adding some datasets with custom projection
      • Observe that there is a toast message and short report informing the user that the projection is not supported
  • Restoring share links

    • Add a custom projection dataset
    • Zoom in so that you can see some details
    • Create a share link and open it in a new tab
    • Make sure the share link restores the view correctly - map mode, base map and the exact view

Checklist

  • There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)
  • I've updated relevant documentation in doc/.
  • I've updated CHANGES.md with what I changed.
  • I've provided instructions in the PR description on how to test this PR.

@na9da na9da changed the base branch from proj4leaflet-others to main December 12, 2025 01:32
@na9da na9da marked this pull request as ready for review December 12, 2025 07:23
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