Code Monkey home page Code Monkey logo

basemap-styles's Introduction

CARTO basemap styles

CARTO Basemap styles for web and mobile, raster and vector. Preview and compare with different viewers here.

This repository has working copies of basemap cartographic styles for different targets

Source data

The styles are based on current version of OpenMapTiles data schema and vector tiles: https://openmaptiles.org/schema

The cartography

All the styles are "soft" in a sense that they are meant to be used as background or basemap below data layers. These are not really meant to be used as stand-alone map by itself, something you'l get from Google, Here and other general maps.

  1. Voyager - colored map, the default basemap in CARTO Builder
  2. Positron - light gray map, good for point data
  3. Dark Matter - dark gray map, good for polygon/line data

voyager positron dark-matter

1. Web raster basemaps

File structure

Styles use as much shared styling as possible. Shared cartocss (.mss) files are in /shared folder, and linked with symlinks to different style projects, as MB Studio requires files in single folder. Same symlink-based sharing is used for Fonts and Images subfolders. Every style has following unique files:

  • project.yml - main project file. It is important to have here list of layers, as this determines order of layer rendering
  • style.mss - specific values for style variables
  • project.xml - generated file by MB Studio Classic. Normally is not edited manually, but real server uses this for real styling

2. CARTO Mobile SDK live basemaps

  • folder cartocss/mobile-sdk-styles
  • these are taken from "Web Basemaps" .mss files (CartoCSS) and are modified to have vector rendering specifics - e.g. language and 3D display, smooth zoom variables
  • Style modification from web basemap to mobile basemap is manual process
  • Every style has mobile-specific .json metafile (e.g. voyager.json). This is SDK-specific format, somewhat similar to project.yml file in MB Studio Classic. Defines also order of layers, and some SDK-specific additional parameters. It has also file sizes and checksums, this is used in online style server to identify style updates.
  • Note that MBStudio generated .xml is not used here

3. Vector styles for web

Mapbox-gl style

  • folder: /mapboxgl
  • Master style is file /tools/style_tpl.json . It uses template placeholders for variable values for different styles
  • Different styles are /style-name/style-name_vars.json files
  • You should use tools/styler.py script to generate specific style from template and _vars.json file. The ready-made style-name.json files are generated and for reference only.
  • Master style and variables files are manually created from a working style

Openlayers

Tangram styles

  • folder: /tangram
  • Can be edited using Tangram Play

basemap-styles's People

Contributors

jaakla avatar nikituh avatar

Watchers

 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.