Skip to content
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

Missing PBF font? #10

Open
edent opened this issue Sep 21, 2024 · 5 comments
Open

Missing PBF font? #10

edent opened this issue Sep 21, 2024 · 5 comments

Comments

@edent
Copy link

edent commented Sep 21, 2024

This is a brilliant service - thank you so much for providing it.

I'm trying to add clusters to a map, following this tutorial - https://maplibre.org/maplibre-gl-js/docs/examples/cluster/

If I replace https://api.maptiler.com/maps/streets/style.json?key=... with https://tiles.openfreemap.org/styles/liberty the tiles display, but no clusters appear.

I can see a 404 from a request to https://tiles.openfreemap.org/fonts/Open%20Sans%20Regular,Arial%20Unicode%20MS%20Regular/0-255.pbf

Looking through the source of https://unpkg.com/maplibre-gl/dist/maplibre-gl.js, it appears there's a hard-coded requirement for those fonts:

"text-font": {
    type: "array",
    value: "string",
    default: ["Open Sans Regular", "Arial Unicode MS Regular"],
    requires: ["text-field"],
    expression: {
        interpolated: !1,
        parameters: ["zoom", "feature"]
    },
    "property-type": "data-driven"
},

Within the HTML, I can set 'text-font': ['Whatever'] but it seems to require them to be hosted on the same environment as the tiles.

Would you consider adding these default fonts? Or tell me what obvious thing I'm missing 😆

Thanks

@hyperknot
Copy link
Owner

Hi @edent,

I never used clusters, I think it'd be great to ask the Maplibre GL JS devs about this particular limitation. I'd guess we should be able to specify the font being used.

Technically we can add Open Sans, but Arial Unicode MS Regular is a proprietary Microsoft font, we cannot host it here.

@edent
Copy link
Author

edent commented Sep 21, 2024

(Ignore my previous comment - too many tabs open!)

Open Sans would be great! I understand completely about the proprietary font issue.

@hyperknot
Copy link
Owner

hyperknot commented Sep 21, 2024

We can add a nginx regex location to serve Noto Regular for all missing fonts though. I have to look into the nginx specifics for that.

But let's ask the Maplibre GL JS guys first.

@pandeiro
Copy link

pandeiro commented Oct 3, 2024

Is this conversation with Maplibre trackable somewhere? Or is there any other possible workaround besides not rendering clusters?

Would love to switch a project I have over to openfreemap, but clusters are required for it.

@hyperknot
Copy link
Owner

I believe the font wasn't specified in the original example, but I'll have a look at the actual example code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants