Coder Social home page Coder Social logo

Style also POI subclass? about osm-liberty HOT 2 CLOSED

maputnik avatar maputnik commented on August 17, 2024
Style also POI subclass?

from osm-liberty.

Comments (2)

pathmapper avatar pathmapper commented on August 17, 2024 1

I would consider styling of subclass optional.

One approach would be to introduce new poi_subclass layers using the same approach as for class -> "icon-image": "{subclass}_11" in combination with filters to avoid styling the class and subclass of a POI (exclude it from class styling when using the subclass and include it for subclass styling)

are there some features with an empty subclass?

good question 😉

if so, do we need a fallback?

no, because we would only style subclass intentional (if there is one)

will we accept to duplicate lots of icons?

no

or can we create aliases in sprite.json?

aliases could work, never tried it. but I think there is no need, because we would only want to style a subclass if there is a dedicated icon for it available.

from osm-liberty.

pathmapper avatar pathmapper commented on August 17, 2024 1

Giving this some more thoughts, I think we should keep the existing layers and use a match expression like the following to style subclass:

"icon-image": ["match", ["get", "subclass"], ["florist", "furniture"], ["concat", ["get", "subclass"], "_11"], ["concat", ["get", "class"], "_11"]]

After #115 the expression could be reduced to:

"icon-image": ["match", ["get", "subclass"], ["florist", "furniture"], ["get", "subclass"], ["get", "class"]]

from osm-liberty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.