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

Text-field for cluster layer break display of clusters #2341

Open
NorbWeb opened this issue Apr 3, 2023 · 9 comments
Open

Text-field for cluster layer break display of clusters #2341

NorbWeb opened this issue Apr 3, 2023 · 9 comments
Labels
bug Something isn't working need more info Further information is requested

Comments

@NorbWeb
Copy link

NorbWeb commented Apr 3, 2023

I tried to make an own cluster map out of example from docs. Cant make the labels of cluster be displayed. If I tried to just check the example in code pen, the problem occures there as well.

It may be an issue with the 'text-field': '{point_count_abbreviated}' in layout, because if I comment this line out, the clusters will be displayed on the map.

maplibre-gl-js version: 2.4.0

browser: Chrome, Firefox

Steps to Trigger Behavior

  1. Undo the comment in line 55 from codepen example
  2. clusters no longer be displayed

Link to Demonstration

link to codepen

Expected Behavior

Clusters with labels.

Actual Behavior

Clusters will not be displayed

@HarelM
Copy link
Collaborator

HarelM commented Apr 7, 2023

Thanks for taking the time to open this issue.
I have no clue what causes this.
I also don't know why this can be presented in the examples page properly while opening the jsbin or codepen from there doesn't work.

@HarelM HarelM added bug Something isn't working PR is more than welcomed Extra attention is needed labels Apr 7, 2023
@viapip
Copy link

viapip commented May 15, 2023

I tried to make an own cluster map out of example from docs. Cant make the labels of cluster be displayed. If I tried to just check the example in code pen, the problem occures there as well.

It may be an issue with the 'text-field': '{point_count_abbreviated}' in layout, because if I comment this line out, the clusters will be displayed on the map.

maplibre-gl-js version: 2.4.0

browser: Chrome, Firefox

Steps to Trigger Behavior

  1. Undo the comment in line 55 from codepen example
  2. clusters no longer be displayed

Link to Demonstration

link to codepen

Expected Behavior

Clusters with labels.

Actual Behavior

Clusters will not be displayed

Hi, I had the same issue and it turned out to be related to font connectivity. Now in the map settings of your example, I set to use the local font Roboto Regular and everything works. Also, it's likely that a separate server may be required for connecting multiple fonts.
your example

@HarelM
Copy link
Collaborator

HarelM commented May 15, 2023

Please let me know if the analysis above is enough and this issue can be closed.

@HarelM HarelM added need more info Further information is requested and removed PR is more than welcomed Extra attention is needed labels May 15, 2023
@NorbWeb
Copy link
Author

NorbWeb commented May 16, 2023

Hi, I tried @pandochka-y solution, but it did not work for me. So, the local font thingy makes no difference, but there is something strange going on with the fonts itself. I tried different fonts with different results.

Works:

  • 'text-font': ['Open Sans Regular'],
  • 'text-font': ['Open Sans Bold'],
  • 'text-font': ['Roboto Regular'],

Doesn't work:

It's more a work-around and I have no clue why this occurs and what is the problem behind.

@HarelM
Copy link
Collaborator

HarelM commented Nov 19, 2023

Can you create a small reproduction of the issue? The smaller the better, preferably everything in the same html page (no external link to map style etc).

@Placentra
Copy link

I just have exactly the same issue. clusters are totaly not working, invisible. no matter what I try. And even when I just run the example code (without any change) from the guide page. Can anyone please remove this bug?

@HarelM
Copy link
Collaborator

HarelM commented Nov 7, 2024

I can make the cluster example work in codepen.
I'm still waiting for a proper minimal reproduction.
If the clusters shows but the text doesn't, I would recommend checking the fonts, if they are well defined and exist in the backend server.

@wiesehahn
Copy link

I just came across the same issue.
Locally running the example from https://maplibre.org/maplibre-gl-js/docs/examples/cluster/ (except with a different style as it does not work locally with that key) did not show the clusters or labels, but unclustered points are shown.
As mentioned above, changing the font to e.g. ['Open Sans Regular'] works, while changing to e.g. ["Open Sans Regular","Arial Unicode MS Regular"] does not work.

Maybe it would be benefitial to change the font in the example to something which works on more systems, to avoid confusion when copying examples.

ps: Also would it be possible to change the style in all examples to some style which works without API key? Although Maplibre is kind of connected to Maptiler and not long ago there were barely any open vector tiles available this changed recently and it would be awesome if examples could simply be copied and run without making any changes.

@HarelM
Copy link
Collaborator

HarelM commented Jan 12, 2025

Changing the examples to use a free vector source is under discussion by the board as noted here:
#4813 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need more info Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants