-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
Style definition to allow relative paths in URLs #182
Comments
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This is the GL Style for ESRI World_Basemap_v2, for example. I've only tried it as a new base map in Israel Hiking. |
This won't work, the relative path are for a server somewhere not related to Israel Hiking. I know Israel Hiking is replacing the fonts and glyphs so you can't really test this. |
I think the idea is to interpret the paths relativ to the style as baseurl, instead of relativ to the current location maplibre-gl-js is running from. I am correct in my understanding @zstadler? This actually seems to be the more useful way to handle relativ pathes and easy enough to implement. There could be installations out there which depend on the current behaviour of course, but as this styles are non-standard anyway I would not consider that change as breaking the api. |
The question of "relative to what" seems like a complex question to me - what if you are using a tileJson to define the location of the tiles and this tilejson is on another server - do you look for the tiles relative to it or relative to where the style is? |
We need to agree on the right thing to do first :-). I would have expected tile urls in a tilejson to be relativ to that tilejson and tile urls directly in the style to be relativ to that style. So the least surprising and most useful way to handle relativ paths for me is to always interpret them relativ to the json file they occur in, just like relative paths in html are by default relativ to that html file itself. |
The above suggestion seems like the right logic to me, I tend to think there are a lot of edge cases for this request, but if you feel confident about it go ahead :-) We can always solve these later on... |
Yes. For example, Sprite access will be done to Similarly, and
will be interpreted as
|
Thanks @xabbu42 for taking this task in#645! |
Discussed today on the SC meeting. +1 for the idea - it seems to be a nice general implementation. Thanks for the effort! Could we update the documentation in Especially:
|
Will relative URLs be available in a specific version? |
I think this might be possible using |
As already discussed in #645, this can't be implemented with transformRequest. |
Thanks, my question was more aiming at if an implementation of this is already planned for inclusion in a coming version. |
@Kai-W might have a solution for an issue similar to this one, maybe he could share what can be a workaround/solution to this issue as well. |
I had urls relative to the pages origin (e.g. /fonts/{fontstack}/{range}.pbf) |
It is true for the general case. The described transformRequest uses the same base for all urls and therefore only works in specific scenarios. So you can work around the missing feature for your situation where you know what urls to expect and what the correct base is. There is no way to write a transformRequest that can handle arbitrary styles with relative urls as they all may have different bases. |
As this initial issue also talks about relative sprite URLs the problem of #3897 also applies, because the sprite url can't be rewritten, as it's parsed before |
@KiwiKilian Thanks, ok so this remains a problem. |
Great, thanks for the clarification @Kai-W! |
Ad suggested in #4962, This should be possible using |
Motivation
ArcGIS REST API has a Vector Tile Style service that returns styles for vector tiles in Mapbox GL Style specification.
While the Mapbox Style requires that the URLs for
glyphs
,sprite
, andsources
must be absolute, the ArcGIS styles uses relative URLs. One advantage of this approach is that a style file can be used by different providers without modification.It would be great if MapLibre is able to directly support style definitions with relative URLs.
An example from the above page:
Design Alternatives
Design
Mock-Up
Concepts
Implementation
The text was updated successfully, but these errors were encountered: