Open rrrnld opened 6 years ago
The easiest is to launch OpenMapTiles Server (which has a web wizard for the config): https://openmaptiles.com/server/
I went through the wizard and selected an export json from the maputnik style editor. But advancing to publish the style file which I selected was not shown as an additional style. Is adding styles a restriction of the evaluation version the OpenMapTiles Server? Or it might be that something is not right with the setup that files cannot be uploaded but I didn't see any error messages in the log of the OpenMapTiles Server.
Could you please retry with the latest version of OpenMapTiles Server - it should run. If not - please provide us with link to the JSON file - so we can reproduce the problem on our side and fix it.
I'm running into the same issue. I've setup OpenMapTiles Server and uploaded a custom style in the advanced option with 'styles' when running setup. I tried adding the Klokantech Terrain style (not modified). I can select the json file from the file picker, but when proceeding with setup, this style is not added to the list of available styles. I used this style:
ffs I followed tutorials and setup mod_tile and renderd. For what?
Hi @klokan , same error here using the docker image of tileserver GL. Just for the record, I extensively use Docker for my developments. I work on a Linux Ubuntu 16.04 LTS machine. Here are:
docker run -it -v $(pwd):/data -p 8080:80 klokantech/tileserver-gl --verbose
config.json
file:
{
"options": {
"paths": {
"root": "/data",
"fonts": "fonts",
"sprites": "sprites",
"styles": "styles",
"mbtiles": "tiles"
},
"domains": [
"localhost:8080",
"127.0.0.1:8080"
],
"formatQuality": {
"jpeg": 80,
"webp": 90
},
"maxScaleFactor": 3,
"maxSize": 2048,
"pbfAlias": "pbf",
"serveAllFonts": true,
"serveStaticMaps": true
},
"styles": {
"basic": {
"style": "style-local.json",
"tilejson": {
"type": "overlay",
"bounds": [8.44806, 47.32023, 8.62537, 47.43468]
}
}
},
"sources": {
"world": {
"url": "mbtiles://planet.mbtiles",
"type": "vector"
}
},
"data": {
"world-vector": {
"mbtiles": "planet.mbtiles"
}
}
}
--- 02_docker/tileserver_gl » docker run -it -v $(pwd):/data -p 8080:80 klokantech/tileserver-gl --verbose
Waiting 3 seconds for xvfb to start...
Starting tileserver-gl v2.3.1
Using specified config file from config.json
Starting server
ERROR: data "v3" not found!
Otherwise, I have downloaded the tiles from your server and renamed the file, as you can see in the config.json
. The same with the pbf
fonts. The same with the style
files.
All folders are populated and well recognized by the config.json
file (it would complain otherwise). The only one which has no data included is the sprites
folder, but I assumed it was not a big deal.
Also, I do not understand the purpose of declaring both sources
and data
in the config.json
. Please explain.
Best,
Stephen
@heyarne Try to rename "berlin-vector" to "v3" in your config file. Also look at the positron style json file and check that it is referencing it in the sources field:
"sources": { "openmaptiles": { "type": "vector", "url": "mbtiles://{v3}" }
@asitemade4u Could you check this?
Hello everyone,
I'm struggling to find out how to add custom styles to OpenMapTiles Server. This it what I run:
docker run --rm -it -v $(pwd)/data:/data -p 8080:80 --name tileserver-gl maptiler/tileserver-gl:latest -c config.json
The -c
parameter doesn't seem to be taken into account, here is what the terminal returns:
Starting Xvfb on display 99
xdpyinfo: unable to open display ":99".
xdpyinfo: unable to open display ":99".
Starting tileserver-gl v3.0.0
No MBTiles specified, using tiles.mbtiles
[INFO] Automatically creating config file for tiles.mbtiles
[INFO] Only a basic preview style will be used.
[INFO] See documentation to learn how to create config.json file.
Run with --verbose to see the config file here.
Starting server
Listening at http://[::]:80/
Startup complete
Any idea what I'm doing wrong ? Thanks!
Well, it was simplier than expected. I just had to put the config.json
file in my data
folder (no need for -c
parameter). 👌
I am running on a related problem when running
docker run --name tileserver-gl -it -v $(pwd)/data:/data -p 8085:80 maptiler/tileserver-gl:latest -c my_config.json
The terminal output seems promising
Starting tileserver-gl v3.1.1
Using specified config file from my_config.json
Starting server
Listening at http://[::]:8080/
Startup complete
But I get a "this site can't be reached" at localhost:8085
.
Here is the structure of my_config.json
:
{
"options": {
"paths": {
"root": "/data",
"styles": "styles",
"mbtiles": ""
},
"formatEncoding": {
"png": 6,
"jpeg": 80,
"webp": 90
}
},
"styles": {
"my_style": {
"style": "my_style.json"
}
},
"data": {
"malta-vector": {
"mbtiles": "tiles.mbtiles"
}
}
}
The my_stile.json
file is a slight modification of the osm-liberty
style done with maputnik, and I also later modified the sources
key as:
"sources": {
"openmaptiles": {
"type": "vector",
"url": "mbtiles://{malta-vector}"
},
"natural_earth_shaded_relief": {
"maxzoom": 6,
"tileSize": 256,
"tiles": [
"https://klokantech.github.io/naturalearthtiles/tiles/natural_earth_2_shaded_relief.raster/{z}/{x}/{y}.png"
],
"type": "raster"
}
},
The $(pwd)/data
structure is the following
.
├── malta.bbox
├── malta.osm.pbf
├── my_config.json
├── quickstart_checklist.chk
├── styles
│ └── kc_style.json
└── tiles.mbtiles
What am I doing wrong?
Weirdly, I get a "this site can't be reached" at localhost:8085
also when running
docker run --name tileserver-gl -it -v $(pwd)/data:/data -p 8085:80 maptiler/tileserver-gl:latest -V
while works perfectly without the verbose option.
Hi! I just tried getting the app up and running via docker on a local machine with a custom extract and it worked flawlessly, really cool! I was surprised how easy it was. When I however tried to get it up and running with a custom style I struggled a bit until I figured that it's probably faster to just ask for help.
I started with creating a
config.json
and tried to replicate the default styles at first; when I copied it from the docs it gave me various errors about missing folders. I then tried to build the standard styles by runningnode publish.js
(I commented out the last bit that's runningnpm publish
) and copied the resulting foldersstyles
andfonts
to mytilebox-gl
folder, after which sprites were missing. I removed the sprites directory inconfig.json
, resulting in thisconfig.json
:This gave me the following result:
And now I'm here. My folder structure looks like this:
What my original goal was: Serving raster tiles for either https://github.com/openmaptiles/positron-gl-style or, preferably https://github.com/openmaptiles/mapbox-studio-light.tm2. I figure the mapbox studio light style has the wrong format, so I aimed for positron first. What exactly are the steps to configure the docker image to serve positron raster and vector files?
Thanks a lot for any help.