Skip to content

Zoom to fragment of <map-a href> else zoom to extent of linked resource #378

Closed

Description

@prushforth

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.

Activity

  1. Malvoz commented on Mar 31, 2021

    @Malvoz
    Member

    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 😄

  2. Malvoz commented on Mar 31, 2021

    @Malvoz
    Member

    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.

    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.

  3. prushforth commented on Mar 31, 2021

    @prushforth
    MemberAuthor

    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.

  4. 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
  5. prushforth commented on Apr 8, 2021

    @prushforth
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions