Allow `?key=...` in URLs of custom style-based maps and overlays
Feature
What I expect to happen
Allow IHM to show custom style-based maps and overlays with URLs with parameters, such as ?key=..., similar to the ability to give parameters to XYZ tile and MapServer sources.
An example for such a map are the MapTiles vector map styless that require a personal key.
What really happened
The URL is no recognized as a style and the custom source cannot be used.
What I did that caused the issue - step by step
- Define a new overlay layer using this style URL
- The NASA 2020 light pollution overlay should show

- The NASA 2020 light pollution overlay should show
- Append
?key=1234to the URL- The overlay will no longer show
- Copy the modified URL and open it in a new tab/window
- The
?key=1234suffix is ignored by the style server and the JSON of the style definition is shown
- The
Please describe the problem statement and not the proposed solution. Also I don't know what part of this is not covered by "sharing"/cloud save which is the preferred way in terms of UX for the site & app. Better describe the problem statement using the following template: As a -kind of user- I would like to be able to -do something- so that -this will be the outcome-.
I'd like to add MapTiler's Topo style as a basemap.
The URL for it is
https://api.maptiler.com/maps/topo/style.json?key=YourPersonalKey
I thought this was a feature requests, my mistake. In any case, the root cause of this issue is how the site is recognizing raster layers which can be seen here: https://github.com/IsraelHikingMap/Site/blob/3b6dfbf3c7cbb02dc24a7f779298c27ffbd1a0ec/IsraelHiking.Web/src/application/components/map/automatic-layer-presentation.component.ts#L122
I think the current implementation is super naive and the code that translates the address to raster layer assumes all kind of stuff we might be able to reverse it: I.e. A raster layer is one that has mapserver or "{z}" for example. IDK...