openmaptiles / openmaptiles

OpenMapTiles Vector Tile Schema Implementation
https://openmaptiles.org
Other
2.52k stars 596 forks source link

stiles not works #1681

Open proton5000 opened 2 months ago

proton5000 commented 2 months ago

I started the tile server according to your instructions https://github.com/openmaptiles/openmaptiles/blob/master/QUICKSTART.md

git clone https://github.com/openmaptiles/openmaptiles.git
cd openmaptiles
./quickstart.sh ukraine

make start-tileserver

then going to http://localhost:8080 I see the maps, but they have a standard style I decided to use the style https://github.com/openmaptiles/osm-bright-gl-style I used your instructions https://github.com/openmaptiles/openmaptiles/blob/master/style/README.md copied the style.json file to the style folder, then make download-fonts and make build-style

make start-tileserver

but the map style has not changed, it is still the same by default

tell me, please, how I can update the map style?

TomPohys commented 1 month ago

Hi, all the styles in OpenMapTiles organization (e.g. also https://github.com/openmaptiles/maptiler-basic-gl-style/tree/gh-pages or https://github.com/openmaptiles/fiord-color-gl-style/tree/gh-pages) have the branch gh-pages where the style and sprites are available.

https://github.com/openmaptiles/osm-bright-gl-style/tree/gh-pages

You will probably have to adjust path for sprites, glyphs and source tiles (based on OMT style).

nikolaydyankov commented 3 weeks ago

@TomPohys I believe he was asking how to add an additional style to the tileserver, so that it shows in http://localhost:8080

image

I still can't figure it out. In the README.md it says:

You can start from several GL styles supporting the OpenMapTiles vector schema.

You click MapTiler Basic and you are taken to a repo with a style.json and no instructions how to use it. You check the /style dir in the main repo and it contains config.json and style-header.json.

Where should I put the style?

I run make build-style and it generates build/style/style.json. How do I add an additional style? I replace the contents of this dir with https://github.com/openmaptiles/maptiler-basic-gl-style, restart the tileserver but nothing has changed.

Either I'm missing something obvious, or the docs could use some love :)

nikolaydyankov commented 3 weeks ago

Figured it out:

  1. Add the style to style/config.json:
{
  "options": {
    "paths": {
      "fonts": "/data/fonts",
      "sprites": "/build/style",
      "styles": "/build/style"
    }
  },
  "styles": {
    "OSM OpenMapTiles": {
      "style": "style.json",
      "tilejson": {
        "type": "overlay"
      }
    },
    "Basic GL": {
      "style": "style-basic-gl.json",
      "tilejson": {
        "type": "overlay"
      }
    }
  },
  "data": {
    "openmaptiles": {
      "mbtiles": "/data/tiles.mbtiles"
    }
  }
}
  1. Download the style.json file from https://github.com/openmaptiles/maptiler-basic-gl-style
  2. In the file, replace sources.url, glyphs and sprite with values from the original style.json
  3. Rename it to style-basic-gl.json
  4. Move it to build/style/style-basic-gl.json

EDIT: The only issue is that make clean deletes build/style