-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Custom WMS imagery #6915
Custom WMS imagery #6915
Conversation
I gave it a try on https://deploy-preview-6915--ideditor.netlify.com/ (preview is pretty cool btw!) on the first WMS service I could find on the web: link Unfortunately, Firefox won't let me use that site due to same origin policy - CORS header ‘Access-Control-Allow-Origin’ missing. The error popup reports a: TypeError: NetworkError when attempting to fetch resource. |
Unlike JOSM, iD is subject to CORS and that’s going to be a challenge for any WMS workflow. One possibility would be to fall back to an upload form (or text area) where the user can provide the contents of the GetCapabilities XML file. This PR does make it possible to take the |
It looks like a good start, but I can't merge it as-is, so this might have to sit for a while. |
Yeah, I’m not ready to call it done either. Say, I only went down the path of trying to support GetCapabilities URLs because I wasn’t sure if people could be comfortable deriving the WMS URL templates manually. But what if we land support for WMS URL parameters (9fbf0c3) first, then figure out the UI for GetCapabilities separately? |
I ended up including a limited version of this in #7428.. For now, iD can support custom wms templates but we will assume EPSG:3857 for the projection. (I didn't have time to add an input field for the user to type in some different projection or validate it against the limited list of projections iD actually supports) |
A custom background imagery URL template can now include WMS tokens like
{bbox}
. A new button in the Custom Background Settings dialog generates a URL template from a WMS GetCapabilities URL.The WMS GetCapabilities UI and the logic for converting the GetCapabilities document into a URL template are rather crude for now, and I’m also not wedded to the idea of a separate dialog. Should the Custom Background Settings dialog just accept the GetCapabilities URL in its main text field and asynchronously fetch the GetCapabilities XML when clicking OK? Should that dialog have a separate tab for WMS, to keep the instructions from getting unwieldy? Whatever the case, the JavaScript
prompt()
will need to be replaced by a proper custom dialog, since some WMS servers require the user to choose from among multiple named layers.Fixes #4977.