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

POI subclass icons not used ? #146

Closed
etiennejourdier opened this issue Aug 23, 2024 · 2 comments · Fixed by #147
Closed

POI subclass icons not used ? #146

etiennejourdier opened this issue Aug 23, 2024 · 2 comments · Fixed by #147

Comments

@etiennejourdier
Copy link

Hello,

(I previously posted this as a comment in issue #113 but since it is closed I prefer to open a new issue)

Since issue #113 the expression "icon-image": ["match", ["get", "subclass"], ["florist", "furniture"], ["get", "subclass"], ["get", "class"]] is used to try to find the subclass icon of a POI instead of the class icon (right?)

It seems to me that this is not working in the case of the sport icon (subclass) versus the pitch icon (class).

(In the 2 examples below, I printed the subclass instead of the name in the text layout field, and the captures are from maputnik website)

For example, I was expecting the match expression to give this result, with different icons for soccer and tennis pitches:
360673350-620d4d35-fc97-4385-ba1e-d92366fe7e01
(To get this result I had to used "icon-image": "{subclass}" which is not satisfactory because it does not have the fallback)

whereas the match expression gives this result, with always the pitch icon whatever the sport:
360674080-ab6dc69e-a9da-4315-a775-b971ba45333f

I did not check if it is working for other subclass icons (when the class is not pitch).

@pathmapper
Copy link
Member

Since issue #113 the expression "icon-image": ["match", ["get", "subclass"], ["florist", "furniture"], ["get", "subclass"], ["get", "class"]] is used to try to find the subclass icon of a POI instead of the class icon (right?)

In general, yes, but the above expression only takes into account the subclass 'Florist' and the subclass 'Furniture'.

From #64 (comment) :

Contributions also for POI subclass welcome, see #119 for an example.

To style other subclass values we need,
a) an icon in the sprites
b) add the subclass to the match expression.

Since both icons for tennis/soccer are already included in the sprites, I added them in #147.

@etiennejourdier
Copy link
Author

etiennejourdier commented Aug 26, 2024

Thanks @pathmapper for the explanation, and for the PR!
I noticed that a few other sport sprites already exist but are not used yet, could you add them as well in the list ?

  • american_football, baseball, basketball, cricket: in subclass
  • swimming_pool : in class but the sprite is named swimming

But I also wonder: why not use the more general expression ["coalesce", ["get", "subclass"], ["get", "class"]]? It works fine for pitches. Does it cause problems for other classes?

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

Successfully merging a pull request may close this issue.

2 participants