You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Zoom to fragment of <map-a href> else zoom to extent of linked resource #378
A page can have > 1 map on it, but it would be useful to be able to capture the URL fragment and set the map center or bounds based on the parameters found there.
Maybe it could be in the form of a script that is distributed with the custom elements set, that you could configure easily to "do something" with a page's URL fragment if doing something is possible i.e. the fragment parses as something recognizable as a zoom,lon,lat or bbox etc.
This is essentially Text Fragments, but for maps. Something similar has been proposed for videos (linking to a particular time in a particular video on a web page) but I don't think I need to reference that from here.
Something similar has been proposed for videos (linking to a particular time in a particular video on a web page)
I was surprised to learn that the Media Fragments URI spec actually is supported for video file URLs (although not embedded into pages) in most browsers.
Thanks, I do think these will help us think about what is possible. The bare video URL must work like a bare image/* URL, where the browser knows the video is the only one on the page, so its able to honour the fragment.
changed the title [-]Define the ability to parse the URL fragment and zoom to the parameters if applicable[/-][+]Zoom to fragment of <map-a href> else zoom to extent of linked resource[/+]on Apr 8, 2021
Ahmad and I converted this issue to be specifically about links in maps from features to other map content / layers.
The default view-changing behaviour should be overridable by whoever puts the link in the feature. So if you want the map view to not change, you should be able to include a <map-a inplace href="..."><map-a>inplace attribute to tell the map not move. The default should definitely be to move, but I also think the inplace attribute should win / take precedence over both the fragment and the remote resource's extent.
Activity
Malvoz commentedon Mar 31, 2021
A few notes:
This is essentially Text Fragments, but for maps. Something similar has been proposed for videos (linking to a particular time in a particular video on a web page) but I don't think I need to reference that from here.
Related UCR sections:
Related MapML section: https://maps4html.org/MapML/spec/#fragments
Also, hopefully this shouldn't hijack the back button 😄
Malvoz commentedon Mar 31, 2021
I was surprised to learn that the Media Fragments URI spec actually is supported for video file URLs (although not embedded into pages) in most browsers.
If you visit this URL: https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm#t=2,4 the video should start playing at 2 seconds and stop playing at 4 seconds.
Perhaps one or both these related specs can serve as guidance, e.g. for fragment syntax.
prushforth commentedon Mar 31, 2021
Thanks, I do think these will help us think about what is possible. The bare video URL must work like a bare image/* URL, where the browser knows the video is the only one on the page, so its able to honour the fragment.
[-]Define the ability to parse the URL fragment and zoom to the parameters if applicable[/-][+]Zoom to fragment of <map-a href> else zoom to extent of linked resource[/+]prushforth commentedon Apr 8, 2021
Ahmad and I converted this issue to be specifically about links in maps from features to other map content / layers.
The default view-changing behaviour should be overridable by whoever puts the link in the feature. So if you want the map view to not change, you should be able to include a
<map-a inplace href="..."><map-a>inplaceattribute to tell the map not move. The default should definitely be to move, but I also think theinplaceattribute should win / take precedence over both the fragment and the remote resource's extent.