Skip to content

Conversation

@prushforth
Copy link
Member

@prushforth prushforth commented May 2, 2025

GeoServer now has support for processing layer groups in "vector tile" mode. That is, layers in a layer group referenced by a GetMap request will be able to be represented as vector information, except of course for natural raster layers embedded in the group. These layers will be rendered as sequences of <map-tile row="nnn" col="nnn" zoom="nn" src="GetMap or GetTile URL to an image"></map-tile>.

This commit creates the TemplatedFeaturesOrTilesLayer that integrates rendering of both <map-tile> and <map-feature>.

See the commit message for details of what has changed (quite a bit of refactoring going on).

@prushforth prushforth force-pushed the map-tile branch 2 times, most recently from 3c6a819 to d9917d3 Compare August 1, 2025 16:03
@prushforth prushforth marked this pull request as ready for review August 1, 2025 16:07
layer.js - no longer tests to see if the bounds have been previously calculated,
updates the _layer.bounds field whenever extent getter executes

- MapMLLayer usage refactored to use MapLayer per the element name association

- _validateDisabled method updated to account for replacement of StaticTileLayer by MapTileLayer

- replaced reliance of _validateDisabled on presence of properties such as
MapLayer['_staticTileLayer'] by using the array ['_staticTileLayer','_mapmlvectors','_extentLayer']
only as a driver of the loop used to validate that each child layer of the
LayerGroup's extent is enabled or not.  the _mapmlvectors step is not completely
worked out, will get done in subsequent work tbc...

map-extent.js - applied name refactoring required by renaming ExtentLayer.js to
MapExtentLayer.js

map-feature.js

- changed addFeature a bit. changes look ok tbd, but the whole dependence of map-feature.js
on MapFeatureLayer.createGeometry as a factory method for creating the geometry
as a Leaflet layer should be revisited and hopefully simplified.  Why not just
construct a geometry via new Geometry?

- for the use case of a <map-feature> loaded via a <map-link>, created a group of
  new methods, patterned after/ copied from <map-tile>:
    - _createOrGetFeatureLayer - runs conditional on the feature being loaded as
      part of <map-link> processing.  Called during connectedCallback
    - isFirst - determines if this element is the first such element in a sequence
              of elements named the same i.e. map-feature.  If it is, used by
              _createOrGetFeatureLayer to construct a FeatureLayeer constructed
               as a holder for features that are constructed and removed with each
              map movement.
    - getPrevious - returns the previous sibling element of the <map-feature> with no checks
      as to what kind of element it is.  The notion is that it's only called when
      isFirst returns false, so the returned sibling element is guaranteed to be a map-feature
      (well, isFirst tests the name such that it must be equal to the name of this node,
      which in this case is map-feature).

map-link.js - imports and constructs the newly refactored TemplatedFeaturesOrTilesLayer instead
of only TemplatedFeaturesLayer

map-select.js - changed a comment that mentioned MapMLLayer

map-tile.js  - new.

mapml-viewer.js - imports and defines the map-tile element and HTMLTileElement interface

LayerControl.js - udpated a comment that referred to MapMLLayer

AnnounceMovement.js updated a comment that referred to MapMLLayer

index.js - imports and defines the map-tile element and HTMLTileElement interface from mapml-viewer.js

ExtentLayer.js - renamed to MapExtentLayer.js

FeatureLayer.js - updated a comment that referred to MapMLLayer

MapFeatureLayer.js - new.  not used yet

MapLayer.js - refactoring of MapMLLayer.js:
  - adds getContainer public method
  - in onAdd, removes addition of static tile layer to LayerGroup
  - removes the use of MapMLLayer['_staticTileLayer'], replaces with using the
    string '_staticTileLayer' as a key to determine action to be taken in the
    bounds calculation loop
  - removes the processTiles construction method

MapTileLayer.js - new.  Replaces StaticTileLayer.

TemplatedFeaturesOrTilesLayer.js - new. replaces TemplatedFeaturesLayer, since
we now support <map-tile> in template processing response documents.

TemplatedTileLayer.js - updated to support vector tiles that contain <map-tile>
elements.

map-bounding-box.test.js - add waitForTimeout to overcome flakiness.

drag.test.js - replace detection of class that was renamed / removed when StaticTileLayer was
eliminated

missingMetaParameters.html - add comment to clarify intent to future me

map-link-media.html - remove use of external resource, replace with content from test data

featureLayer.test.js - udpate comment mentioning MapMLLayer to MapLayer

multipleExtents.test.js, multipleExtents.html - update to support new classes used by
features or tiles support in templated link.  Modernize the test a bit to make
it more readable.  Still an ugly large test.

staticTileLayer.test.js - update

templatedPMTilesCBMTILETest.html - added map-link for stylesheet module. Not sure why this
test was working previously, maybe I misunderstood, but I think it was a cut and
paste error.

templatedPMTilesMVTLayer.test.js - changed expectation that layer will not be disabled
to expect that layer WILL be disabled, because the particular layer didn't have
a stylesheet and so could never be enabled, despite multiple projections available

customTCRS.test.js - one test was using static tiles, updated to continue working

playwright.config.js - added global directive to ignore https errors.  These were
causing intermittent problems with tests on work network.

See if we can get ci testing to pass...
@prushforth prushforth merged commit df49def into Maps4HTML:main Aug 1, 2025
1 check passed
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