Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of media attribute #1022

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

prushforth
Copy link
Member

@prushforth prushforth commented Dec 13, 2024

Co-authored by @yushan-mu

@prushforth prushforth force-pushed the media-attribute branch 2 times, most recently from 095e69a to 0d4c50c Compare December 20, 2024 02:05
@prushforth prushforth changed the title Preliminary implementation of media attribute. See to-do.txt Implementation of media attribute Dec 20, 2024
@prushforth prushforth force-pushed the media-attribute branch 2 times, most recently from 1bbee84 to 026f289 Compare December 20, 2024 13:40
@prushforth prushforth marked this pull request as ready for review December 20, 2024 13:55
@prushforth prushforth requested a review from AliyanH December 20, 2024 13:55
@prushforth prushforth removed the request for review from AliyanH December 20, 2024 18:04
@prushforth prushforth force-pushed the media-attribute branch 3 times, most recently from 1aa7394 to af12111 Compare December 26, 2024 18:02
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 <[email protected]>
@prushforth prushforth merged commit fa6f944 into Maps4HTML:main Dec 30, 2024
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