GithubHelp home page GithubHelp logo

Comments (3)

ZeLonewolf avatar ZeLonewolf commented on August 12, 2024 2

For the purpose of development, the desired behavior is:

  1. A style JSON (we'll call it americana.json) is generated at compile time and posted to gh-pages where it is used in favor of the currently dynamically generated object.
  2. Code for generating the style is located in separate folders from the code needed for style runtime (i.e. for shield loading)
  3. Documentation is added that's sufficient for a style user to host their own copy, including shields. The Americana runtime would include compiled sprites, the style JSON, and a javascript library for dynamic shield generation.

from openstreetmap-americana.

ZeLonewolf avatar ZeLonewolf commented on August 12, 2024

Yes, it is possible to generate a style.json. In the following location, the americanaLayers object contains all the style, and you could use JSON.stringify() to turn it into a standalone JSON object. We are planning to create a generated JSON version of the style for deployment so that each client doesn't have to generate the style each time.

layers: americanaLayers,

However, there is a big update to add concurrent highway shields that's in the works. That update will depend on the styleimagemissing hook to generate highway shields, rather than the icon-based version that is currently in the map (which only supports single shields). So, you'd still need to hook into javascript to do shield generation even with a separate style.json. The concurrent shield work in progress can be found here:

https://github.com/ZeLonewolf/openstreetmap-americana/tree/openmaptilers-new-features-test

from openstreetmap-americana.

boldtrn avatar boldtrn commented on August 12, 2024

Thanks a lot, I wasn't aware of the shield issue, so I will wait a bit before actually trying to host the style on my server :)

from openstreetmap-americana.

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.