Giter Site home page Giter Site logo

utagawal / cyclosm-basic-gl-style Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cyclosm/cyclosm-basic-gl-style

0.0 0.0 0.0 29 KB

Cycle oriented GL Style using OpenMapTiles.

Home Page: https://phyks.github.io/cyclosm-basic-gl-style/

License: Other

Shell 4.01% JavaScript 95.99%

cyclosm-basic-gl-style's Introduction

CyclOSM

Important note: This GL style was historically the first version of CyclOSM. We shifted back to a more traditional CartoCSS style and the GL style is no longer maintained and left here for historical reasons. For the up to date and latest CyclOSM source code, check out https://github.com/cyclosm/cyclosm-cartocss-style/.

This is a Mapbox GL basemap style using the vector tile schema of OpenMapTiles, with cycling in mind.

It is based on the Klokantech basic GL style. Icons are taken from OSM Bright GL style.

Note: This is currently a Work In Progress and therefore requires some OpenMapTiles schema updata to have a full render. An up to date OpenMapTiles branch is available here. PRs will be systematically submitted to OpenMapTiles for each new addition.

Demo

A demo with tiles generated for Ile-de-France area is available here (using OpenLayers) or here (using Mapbox GL JS).

Use the style

You should update the style.json file and replace

  • {{ TILE_URL }} with the URL of your OpenMapTiles provider.
  • {{ SPRITE_URL }} with the URL of the built sprites (see below).
  • {{ GLYPHS_URL }} with an URL serving the fonts.

You can have a look at the examples folder for usage examples with OpenLayers or Mapbox GL JS with tiles generated for Ile-de-France area.

Build the sprites

To use this style, you should build sprites from the icons in the icons/ folder.

This requires nodejs <= 8.x and mapnik 3.0.x. On Ubuntu, you can apt-get install libmapnik-dev and use this Node v8.x repo.

Note: If you have a higher version of Node, you will have to install mapnik from source. This is due to node-mapnik being required to build the sprites. [email protected] requires NodeJS version 8 or lower and mapnik 3.0.x and [email protected] is compatible with higher versions of NodeJS but requires a Git version of mapnik.

Then, you can install the required JS dependencies with

$ npm install

and use ./scripts/build.sh to build the sprites. Everytime you update the icons, you should run ./scripts/build.sh again, to rebuild the sprites.

Note: If you get "Error: libmapnik.so.4.0: cannot open shared object file: No such file or directory" when running build.sh script, try to prefix it with LD_LIBRARY_PATH. For instance, LD_LIBRARY_PATH=/usr/local/lib ./scripts/build.sh.

Edit the Style

Use the Maputnik CLI to edit and develop the style. After you've started Maputnik open the editor on localhost:8000.

$ maputnik --watch --file style.json

Sources of inspiration

License

Code is licensed under BSD-3-Clause and design is licensed under CC BY 4.0. Full details on the license can be found in the LICENSE.md file.

cyclosm-basic-gl-style's People

Contributors

phyks avatar

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.