Implementation of media attribute#1022
Merged
prushforth merged 1 commit intoMaps4HTML:mainfrom Dec 30, 2024
Merged
Conversation
095e69a to
0d4c50c
Compare
1bbee84 to
026f289
Compare
026f289 to
4ed39fa
Compare
1aa7394 to
af12111
Compare
Remove prefers-map-content hardcoded demo hack Add implementation of _changeHandler that invokes _onAdd, _onRemove. Add media query matches to map-layer._validateDisabled Re-organize _onRemove so that stuff isn't deleted until it's no longer needed, Make call to registerMediaQuery(mq) conditional on there being a mq, make it the path through which a layer gets initialized only when that is true, so as to not perform _onAdd twice. Move detection of media query matches check out of core if (map) block in map-layer._validateDisabled() Remove vestige of old prefers-map-content demo implementation from both map-link.js and layer.js Make execution of map-extent's map-projectionchange handler conditional on the there being a parentLayer._layer property value. This specifically covers the case when this handler is invoked by the projection change event happening, in which the parent layer may be disabled due to a media condition and therefore there is no LayerGroup to add the extentLayer to. add map-layer media attribute as an observed attribute Make map-link._registerMediaQuery async, wait on mapml-viewer to be ready before trying to register a media query (which may depend on mapml-viewer.extent). Remove map-link media attribute from those attributes that are copied onto the 'rendered' <link> element, because the link element actually supports the media attribute, but not the media features we are designing (hence it always forces the element to be disabled). Update map-layer._registerMediaQuery so that when the observed media attribute is removed or set to the empty string, the map-layer goes through the initialization life cycle, as though it was newly connected to the DOM (it may go from disabled to enabled due to the removal). Clean up map-layer _registerMediaQuery Add tests for <map-layer media="..."> attribute Add tests for <map-link rel="stylesheet" media="..."> attributes Add test for <map-link rel="features" media="..."> attribute cycling Update linux image for map-link-media test Initial implementation of map-style media attribute Refactor enable/disableLink methods to _enable/_disableLink Update / fix test title for map-link (should not be 'map-layer') Add test for map-style media attribute. Update implementation of map-link and map-style rendering to take media attribute into account. Move renderStyles to its own file, import it and export as member func Co-authored-by: Yushan Mu <yushan.mu@nrcan-rncan.gc.ca>
af12111 to
a8ff66c
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.
Co-authored by @yushan-mu