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

Replace wkid/w/s/n/e in WMS URL templates #5738

Merged
merged 1 commit into from
Jan 20, 2019
Merged

Replace wkid/w/s/n/e in WMS URL templates #5738

merged 1 commit into from
Jan 20, 2019

Conversation

1ec5
Copy link
Collaborator

@1ec5 1ec5 commented Jan 19, 2019

Added support for {wkid}, {w}, {s}, {n}, and {e} tokens in WMS-style background imagery templates, as described in this JOSM documentation.

The {wkid} token is particularly handy for exportImage endpoints in ArcGIS ImageServer services. (In fact, it appears multiple times, whereas the previous code only replaced each token once.) Currently, osmlab/editor-layer-index#611 works around the lack of this token by hard-coding a projection, but JOSM can use the projection property correctly: osmlab/editor-layer-index@95680b2#r31964799. Once this PR lands, we can modify the editor layer index’s tests to accept {wkid} as an alternative to {proj}.

Thanks to @don-vip for making me aware of these additional tokens.

@1ec5 1ec5 self-assigned this Jan 19, 2019
@1ec5
Copy link
Collaborator Author

1ec5 commented Jan 19, 2019

The only other unsupported token is {header(…, …), which was requested in #4812. Apparently the Fetch API does support custom headers, but that’s different enough that it should be a separate PR. Moreover, #4812 requested Referer, which is immutable. (I’d expect that overriding the referrer would only be necessary if one is using an endpoint without permission.)

@bhousel
Copy link
Member

bhousel commented Jan 20, 2019

The only other unsupported token is {header(…, …), which was requested in #4812. Apparently the Fetch API does support custom headers, but that’s different enough that it should be a separate PR. Moreover, #4812 requested Referer, which is immutable. (I’d expect that overriding the referrer would only be necessary if one is using an endpoint without permission.)

The problem here is that we don't request the imagery via XHR or Fetch - the browser requests the imagery when we create <img> tags.

@1ec5
Copy link
Collaborator Author

1ec5 commented Jan 20, 2019

Ah, good point. 😅 So in other words, this PR gets us to parity with JOSM to the extent possible.

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.

2 participants