Support for relative URLs #1396
Closed
sweco-semara
started this conversation in
Ideas
Replies: 2 comments
-
I think it's a valid goal to make Hajk fully support relative url:s! As you said, there could be more problematic places in the code base, but i can not think of any at the top of my head. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This idea is born ~Hajk v3.12RC2.
Idea: It would be handy if Hajk's map config supported relative URL:s and was fully portable between e.g. staging and production environments, without the need for absolute URL:s. That way version controlled config files would be portable between test/stage and prod without any manual intervention on the contents.
Currently, the layerswitcher's legend GetLegendGraphic functionality prevents this.
protocol
handling. If using relative links for WMS URL, e.g. layers.json WMS config"url": "/geoserver/nacka/wms"
this will result in invalid links being constructed for getting the legend image -https://geoserver/nacka/wms?
(...)To fix the problem above, one could either use absolute URL:s as WMS url, in layers.json add a customGetMapUrl to each layer in layers.json or - to centralize a work-around for only hard-coding URL prefix in one place - add a proxy setting in appConfig.json
proxy
with an absolute URL.I would like to discuss the idea that it should be a goal for Hajk to fully support relative URL:s. This makes it version control friendly and prevent mistakes from having non-portable config files requiring manual intervention (not copy/paste friendly). Any takers for this idea @jacobwod @Hallbergs? :-)
This is the one place I have currently found not supporting relative URL:s, there might be more. Most other places in Hajk will pick up the current location and use relative URL:s just fine. Maybe just removing the
protocol
code from ConfigMapper.js implements this idea fully, but I have not yet made a full analysis so therefore starting this as an idea and wanting to confirm the overall goal first. Thanks.Beta Was this translation helpful? Give feedback.
All reactions