- 
                Notifications
    
You must be signed in to change notification settings  - Fork 131
 
Description
This lines will cause requests to a third-party server:
Lines 158 to 161 in f85e5ff
| export function getFonts( | |
| fonts, | |
| templateUrl = 'https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css' | |
| ) { | 
ol-mapbox-style/src/stylefunction.js
Lines 1209 to 1218 in f85e5ff
| font = mb2css( | |
| getFonts | |
| ? getFonts( | |
| fontArray, | |
| glStyle.metadata ? glStyle.metadata['ol:webfonts'] : undefined | |
| ) | |
| : fontArray, | |
| textSize, | |
| textLineHeight | |
| ); | 
Lines 356 to 365 in f85e5ff
| style = applyStyleFunction( | |
| layer, | |
| glStyle, | |
| sourceOrLayers, | |
| resolutions, | |
| spriteData, | |
| spriteImageUrl, | |
| getFonts, | |
| options.getImage | |
| ); | 
This is not really documented, in the stylefunction docs you find this:
Function that receives a font stack and the url template from the GL style's metadata['ol:webfonts'] property (if set) as arguments, and returns a (modified) font stack that is available. Font names are the names used in the Mapbox Style object. If not provided, the font stack will be used as-is. This function can also be used for loading web fonts.
In the fonts part of the docs you find this:
If no metadata['ol:webfonts'] property is available on the Style object, Fontsource Fonts will be used. It is also possible for the application to load other fonts. If a font is already available in the browser, ol-mapbox-style will not load it.
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.