Enable <map-layer> inline or remote static features #1034
Merged
prushforth merged 2 commits intoMaps4HTML:mainfrom Oct 7, 2025
Merged
Enable <map-layer> inline or remote static features #1034prushforth merged 2 commits intoMaps4HTML:mainfrom
prushforth merged 2 commits intoMaps4HTML:mainfrom
Conversation
56cd1f7 to
98d9c10
Compare
9174611 to
d2c4806
Compare
Fix tile clean up in MapTileLayer esp for CBMTILE <map-tile>s Add calculatePosition function to be shared by map-extent, -tile, -feature to determine zIndex positioning in parent based on how Leaflet layers are created and shared among sibling elements in a sequence Add red/green/blue-tile.png Add setZIndex function to MapFeatureLayer, MapTileLayer, copied from MapExtentLayer. Update MapFeatureLayer, MapExtentLayer, MapTileLayer initialize constructors to set the zIndex if there's an option present for it Replace map-extent way of setting zIndex to use map-extent.position Adapt calculatePosition to working within either shadow root or light DOM add map-tile tests make map-tile attributes row,col,zoom immutable; add tests for that Fix a few small issues with map-tile attributes Clean up map-feature connectedCallback (remove unused bind) Add timeouts to decrease flakiness Replace page screenshots with viewer screenshots When you remove the src attribute from a layer, it's now empty, and should NOT be disabled. Remove test dependency on external services If this is the last feature or tile to be removed from a static layer context, i.e. as child of a <map-layer>, the container for the MapFeatureLayer or the MapTileLayer should be removed from the layer rendered dom; includes basic tests of this for both types of static content. Add code+test to ensure that TemplatedFeaturesOrTilesLayer.js does not allow dynamic content loaded by a <map-link rel=features> to contain a map-extent Update map-feature.disconnectedCallback to clean up when it's the last feature in a MapFeatureLayer being disconnected, make it remove the <svg> (_container) element created by the renderer. Because Renderer inherits from Layer, we can run its remove() method to do this. Because `disabled` is an observed attribute on <map-linK>, purge the shadowRoot contents when the link is disabled. Add test for <svg> count when panning and zooming the map to prevent regressions hopefully. Keep count of logged messages by map-layer.getProjection(), limit to 1 Change playwright config which was causing problems locally, will hopefully not affect CI Make nodeName dep on returning all CAPS equal by map-tile, map-feature Remove unused method parameter
d2c4806 to
d97f330
Compare
0678011 to
054ba10
Compare
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.
The four use cases in which MapFeatureLayer operates include:
which are potentially siblings of and elements, (among others
but those are the elements that are renderable as Leaflet layers or parts of
Leaflet layers, OR "static" remote <map-feature> children fetched from the <map-layer src>
and re-parented to the shadow root of <map-layer>.
rendered and removed as part of the map movement processing handled by
<map-extent> child <map-link rel="features"> and TemplatedFeaturesOrTilesLayer.
Typically such features have interactive behaviour (popups) and navigation buttons.
of <map-extent> contents. The popups created by these features are tricky and
have popup navigation button controls in the popup content, created by code
in this repository.
of <map-extent> child <map-link rel="tile" type="text/mapml">. These features
are not interactive; they are rendered according to provided styles,
but they don't have popups, relying instead on query links per 3, above.
This PR mostly affects use cases 1 & 2 above:
Refactor FeatureLayer as MapFeatureLayer
map-feature.js custom elements create a MapFeatureLayer when they connect.
and share it between adjacent map-feature elements if applicable.
The FeatureRenderer is also shared among elements of sequences of adjacent <map-feature>s.
Ensure that empty <svg> elements are not left over on moveend by
TemplatedFeaturesOrTilesLayer, by using FeatureRenderer.remove() in the
disconnectedCallback for the last feature in a sequence of <map-feature> elements
to be removed. Add test.
Remove MapLayer.processFeatures function.
Remove MapLayer._mapmlvectors property.
Remove map-layer's map-feature mutation observer (layer.js).
Exclude map-extent from elements that are loaded when fetched by templated content
i.e. a map-extent can't load another map-extent via its map-link(s).