openmaptiles / fonts

Font glyphs for GL Styles with open fonts
https://fonts.openmaptiles.org/
217 stars 97 forks source link

just Open Sans via glyphs link #6

Open musicformellons opened 6 years ago

musicformellons commented 6 years ago

When I add to my style:

 'glyphs': 'https://free.tilehosting.com/fonts/{fontstack}/{range}.pbf',

I get error in the browser console:

mutation loadMap @ 14:26:40.179
:8089/#7.3/50.055/14.001:1 Failed to load https://free.tilehosting.com/fonts/Noto%20Sans%20Regular/0-255.pbf: Redirect from 'https://free.tilehosting.com/fonts/Noto%20Sans%20Regular/0-255.pbf' to 'https://openmaptiles.com/hosting/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8089' is therefore not allowed access.

When I add to my style:

  'glyphs': 'https://free.tilehosting.com/fonts/{fontstack}/{range}.pbf?key={mySecretKey}',

the error is gone, but when changing fonts in the style just Open Sans is 'available/ shows'.

musicformellons commented 6 years ago

Ah, I now notice that I still get the CORS error, also with key... So my question boils down to: How can I solve the CORS issue and work with multiple fonts?