Replies: 1 comment 1 reply
-
|
I also ran into this and have resorted to defining the styles in my application where the URL can be configured dynamically. It would be nice to know if there is a solution to this as a quick scan of the source code didn't show up anything obvious. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Since Martin can now provide fonts, glyphs and styles together, I wonder if you can somehow set the URLs within the style.json relatively or with a placeholder so that you don't have to specify the absolute URL. (The MapLibre style spec expects an absolute URL there)
"glyphs": "https://example.com/map/font/{fontstack}/{range}",But I don't want to hard-code the domain of my server into the style.json, because I run a test server and a prod server, which have different domains. So far I had to store different style.json there (with the URL example.com and example-dev.com)
You could, for example, store the base URL in Martin's config and work with a placeholder in the URL, which Martin replaces when delivering the JSON file.
Or if you want it to be completely dynamic, Martin reads the request URL and inserts it there automatically. Then you could also run several domains in parallel without having to reconfigure Martin.
With placeholder
"glyphs": "{BASE_URL}/map/font/{fontstack}/{range}",or simply a relative URL wich will be completed by martin
"glyphs": "/map/font/{fontstack}/{range}",Beta Was this translation helpful? Give feedback.
All reactions