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

Add support for #map= hash prefix #7725

Closed
wants to merge 3 commits into from

Conversation

JesseWeinstein
Copy link

@JesseWeinstein JesseWeinstein commented Dec 22, 2018

This enables URLs used by OSM to be copied directly, without breakage.

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs (there are none)
  • post benchmark scores
  • manually test the debug page
  • tagged @mapbox/studio and/or @mapbox/maps-design if this PR includes style spec changes (it doesn't)

This enables URLs used by OSM to be copied directly, without breakage.
@JesseWeinstein
Copy link
Author

I know various of the Launch Checklist aren't done yet -- this seemed worth providing, at a minimum as documentation of the problem for the benefit of others who hit it.

@mourner
Copy link
Member

mourner commented Jan 2, 2019

This enables URLs used by OSM to be copied directly, without breakage.

Can you elaborate on this? I'm not sure I'm following why we should add special code for easier URL copying from osm.org. Can you just copy the part after map= for the same effect?

@JesseWeinstein
Copy link
Author

Thank you for asking!

I noticed this when using OpenInfraMap, e.g. https://openinframap.org/#8.09/34.281/-118.48 . With this (tiny) code change, I can go from an OSM link like https://www.openstreetmap.org/#map=5/45.525/-124.201 to the equivalent on OpenInfraMap (or anything else using mapbox-gl-js) by simply changing the host. Without it, I have to remember to strip out the "map=" part, or it crashes with a URL like: https://openinframap.org/#NaN/NaN/NaN , losing the details and requiring me to dig them back up from wherever I previously had them.

Ideally, everyone could settle on ONE standard way to represent this same info; but until we get there, it seems basic neighborliness to at least accept the format used by the main source of Mapbox's data, OSM. I plan to make a similar PR on their end to accept the format without the "map=".

I hope that clarifies things.

@andrewharvey
Copy link
Collaborator

See also #8596 a proposal to let the developer choose any hash name.

@asheemmamoowala
Copy link
Contributor

Closing this in favor of #8603

@JesseWeinstein
Copy link
Author

@asheemmamoowala Does #8603 actually accomplish the same purposes as this? It doesn't look like it does, from my (cursory) review of it...

@andrewharvey
Copy link
Collaborator

@asheemmamoowala Does #8603 actually accomplish the same purposes as this? It doesn't look like it does, from my (cursory) review of it...

No #8603 is not the same, but it does allow the developer to choose what hash prefix they want, it's un-opinionated. So if you want your maps to use the #map= prefix you can tell it too.

@JesseWeinstein
Copy link
Author

Right, that's very different from what this achieves, which is to enable all maps using this software to transparently, automatically handle the format used by OSM, the primary source for the data displayed with this software.

@asheemmamoowala -- please re-open this, as it is not handled by the other PR.

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.

4 participants