GithubHelp home page GithubHelp 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

Terms of service: for more information about CARTO basemaps use, pricing and terms of service, please double check https://carto.com/basemaps

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

Service public info: https://carto.com/location-data-services/basemaps/ The structure of the URLs to call the service is the following: https://{s}.basemaps.cartocdn.com/{style}/{z}/{x}/{y}{scale}.png , where:

  • {s}: one of the available subdomains, either [a,b,c,d]
  • {z} : Zoom level. We support from 0 to 20 zoom levels in OSM tiling system.
  • {x},{y}: Tile coordinates in OSM tiling system
  • {scale}: OPTIONAL "@2x" for double resolution tiles
  • {style}: Map style, possible value is one of:
light_all,
dark_all,
light_nolabels,
light_only_labels,
dark_nolabels,
dark_only_labels,
rastertiles/voyager,
rastertiles/voyager_nolabels,
rastertiles/voyager_only_labels,
rastertiles/voyager_labels_under

Sample with Leaflet JS:

layer = L.tileLayer('https://{s}.basemaps.cartocdn.com/{z}/{x}/{y}' + (L.Browser.retina ? '@2x.png' : '.png'), {
   attribution:'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, &copy; <a href="https://carto.com/attributions">CARTO</a>',
   subdomains: 'abcd',
   maxZoom: 20,
   minZoom: 0
 });

Styles

  • Style is written in CartoCSS using Mapbox Studio Classic (https://www.mapbox.com/mapbox-studio-classic/), and shared here as Mapbox Studio Classic project
  • Raster tiles generated by Mapnik tilelive-vector using Mapnik-XML styling.
  • File folder in this repo: /cartocss/web

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
  • You can try our experimental https://github.com/CartoDB/mobile-style-editor app to edit mobile basemap styles with a mobile device: Android tablet or iPad. This gives you direct user experience of your style right on mobile.
  • Technical details how our Mobile CartoCSS is different from web CartoCSS: https://github.com/CartoDB/mobile-sdk/wiki/CartoCSS-notes . There are some mobile-specific extensions and also some limits.
  • How to use the styles as custom styles in your mobile app: https://github.com/CartoDB/mobile-sdk/wiki/Creating-custom-basemap-styles
  • 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 in mobile

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
  • Use it 'as is', not supported or developed anymore by CARTO

basemap-styles's People

Contributors

aitorch avatar jaakla avatar jvillarf avatar makella avatar nikituh avatar srtena avatar victorvelarde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

basemap-styles's Issues

Positron and other CARTO base map labels don't overlay layers

The town/city/state labels do not overlay layers, which makes it harder for users to locate specific places.

New Carto
image

Old Carto
image

Using Google Maps base maps solves this issue, but those base maps are worse for a number of reasons

  • border aliasing is worse than carto base maps
  • for some reason google maps layering forces label interaction, creating these unwanted popovers
  • the google maps positron text is hard to read overtop of colored maps
    image

Thanks if you can improve this!!

Support for WebP and/or Avif?

I'm not sure if this is the right place to ask, but is there a way to use the webp or avif instead of png image format? The documentation only mentions .png.
https://github.com/CartoDB/basemap-styles?tab=readme-ov-file#1-web-raster-basemaps

Browser support for these is great:

More info on the formats:
https://www.smashingmagazine.com/2021/09/modern-image-formats-avif-webp/

Possibly relevant:
openstreetmap/operations#902

Update maps

Hello.
Please update your maps.
We are from Ukraine, we have many new street names, but we see their old names.

About licence

Can I use https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}/{r}.png for commercial?

Improve documentation for creating new styles with the styler .py (or release labels_only versions!)

I've used Carto basemaps for leaflet before. I'm trying to update my practices to use deck.gl and/or mapbox js gl.

I want to continue using carto basemaps as I change! With leaflet, there were both no-labels and labels-only variations of each of the carto styles! So i could sandwich my data between the two to make layers on top of the data, and give users an option to toggle the labels on/off.

I'm not experienced changing .json files, so it'd be helpful to have more ready-made layers, as were available for leaflet, including roads, labels-only, and no-labels (instead of only no-labels). Failing that, the documentation could be improved (Do i change the {style}_vars.json to make parts of the map I don't want to include "transparent"? Or do I delete them? Or an alternative?) Documentation on what vars are what could be helpful too -- for example what are the layers suffixed with _case? (i.e, "road_service_case", road_minor_case")

Thank you!

Render public_transport markers

Hello,

I'm using Open Street Map with Leaftlet. I would like to know if it's possible to render on the map the public transports stops and highway stops ?

    const map = L.map(id, { scrollWheelZoom: false }).setView([this.lat, this.lng], 16)

    L.tileLayer(
      'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png',
      {
        attribution:
          '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> | Map tiles by Carto, under CC BY 3.0. Data by OpenStreetMap, under ODbL.',
        minZoom: 1,
        maxZoom: 20,
      }
    ).addTo(this.map)

thanks

IPv6 support

CARTO basemap ({s}.basemaps.cartocdn.com) lacks IPv6 addresses and thus resources from it can't be received using IPv6.

Since the CDN seems to be served by Fastly, which has great IPv6 support, it should hopefully be a simple fix by asking Fastly support to enable IPv6 on the map, as per their IPv6 documentation.

Thank you.

Recent rendering changes

One of our E2E tests has shown one change half an hour ago. The difference is minor and the test seems to be non-deterministic since after re-running it, it showed the original reference image.

We would like to know if there have been changes recently in the basemaps (style or data), to know if the reason of this non-determinism is on CARTO VL / Mapbox GL side.
reference
reference_out

Ok to store basemap files for antique, flat blue, midnight in this repo?

Hey @jaakla

Besides Voyager, Positron, and Dark Matter, we also have a few other CARTO basemaps available in Builder like Antique, Flat Blue, and World Midnight Commander.

These basemaps live in a specific CARTO account.

@javitonino and I were talking today about a place where we could put the assets for the maps (image markers, pattern fills) as well as copies of the .carto files to have as backup.

Since we have this repo with all of our other basemap-related items, I thought this would be a good place to store those files as well.

Would that be ok?

cc @javitonino

French region in english

Hello,

We use our positron basemap and we like this in brittany!
But from somes years, the name of 3 region in France is in english.
Could you translate this in french like this?

Brittany => Bretagne
Normandy => Normandie
Upper France => Haut de France

Thank's

Best regards,
Loïc

Rename City "Munich" to "München" on lower zoom levels

I have noticed that most of the german cities are displayed correctly with the correct german name except for Munich which is München in german. When zooming out from München, it suddenly changes to Munich. Can you change this so that the name "München" is used at all zoom levels?

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.