Open simonseyock opened 11 months ago
@simonseyock If that's made opt-in, 99% of all maps will be displayed with incorrect fonts. So I don't think this would be practical. Especially given the fact that most users will be using maps that also come from a 3rd party server.
If you have a suggestion for a doc improvement, feel free to create a pull request.
Ok, you are probably right. I see if I can improve the docs here.
Note: Ideally, map publishers like MapTiler or basemap.de should include an ol:webfonts
entry in their style jsons, and provide web fonts next to their map tiles. The ol:webfonts
metadata option was added after FOSS4G 2022, to give map publishers a direct way to avoid having to use 3rd party font servers.
@simonseyock, I think you're closer to basemap.de than I am, so maybe you can remind them to update their style jsons. And maybe @klokan can help to get the same done at MapTiler. For reference, here is the documentation: https://github.com/openlayers/ol-mapbox-style#font-handling.
how is this supposed to work when used in conjunction directly with a mapbox url? I cannot seem to find where I would be able to intercept the style object or style object request to inject the webfonts attribute
You cannot, but I think ot would make sense to ads an option for that.
@simonseyock, I think you're closer to basemap.de than I am, so maybe you can remind them to update their style jsons. And maybe @klokan can help to get the same done at MapTiler. For reference, here is the documentation: https://github.com/openlayers/ol-mapbox-style#font-handling.
I try to establish a contact here :+1:
I mention some people close to the basemap.de Team: @stenderg @sratjens @TheCartographerDev
See #1058
This lines will cause requests to a third-party server:
https://github.com/openlayers/ol-mapbox-style/blob/f85e5ff3e06a6d96a9b832f03c93406049ee5c22/src/text.js#L158-L161
https://github.com/openlayers/ol-mapbox-style/blob/f85e5ff3e06a6d96a9b832f03c93406049ee5c22/src/stylefunction.js#L1209-L1218
https://github.com/openlayers/ol-mapbox-style/blob/f85e5ff3e06a6d96a9b832f03c93406049ee5c22/src/apply.js#L356-L365
This is not really documented, in the stylefunction docs you find this:
In the
fonts
part of the docs you find this:This does not make it clear that by default a third-party server will be requested.
Also in my personal opinion this should be an opt-in feature instead of the default behavior.