Enable <map-layer> inline or remote static features #1034
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).