-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 09b5e3b
Showing
24 changed files
with
4,139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.mbtiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM node:14 as font-builder | ||
|
||
RUN mkdir -p /output | ||
RUN git clone --single-branch --branch master https://github.com/mapbox/node-fontnik.git | ||
WORKDIR node-fontnik | ||
RUN npm ci | ||
COPY font-builder . | ||
RUN set -ex \ | ||
&& node process.js input | ||
|
||
|
||
FROM maptiler/tileserver-gl | ||
|
||
COPY --from=font-builder /output /data/fonts | ||
COPY styles /data/styles | ||
COPY maptiler-config.json /data/config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Map-Tile Server for Lume | ||
|
||
## Build | ||
|
||
The build process automatically imports styles and fonts into the docker image. | ||
To build run `docker build .` | ||
|
||
## Run | ||
|
||
For the Tile Server to run, you first need to download the mbtiles data on your worker. The file is obtainable at [data.maptiler.com](https://data.maptiler.com/downloads/planet/). | ||
|
||
Once you have the mbtiles file ready, start the container with: | ||
```sh | ||
docker run \ | ||
--rm -it \ | ||
-v $(pwd)/<yourfile>.mbtiles:/data/mapdata.mbtiles \ | ||
-p 8080:8080 \ | ||
<docker-img-tag> | ||
``` | ||
You may need to modify the ``pwd`` in the above command if the mbtiles file is not in your current working directory. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
var fontnik = require("."); | ||
var fs = require("fs"); | ||
var path = require("path"); | ||
|
||
var convert = function (fileName, outputDir) { | ||
var font = fs.readFileSync(path.resolve(__dirname + "/" + fileName)); | ||
fs.mkdir(outputDir, {recursive:true}, () => | ||
output2pbf(font, 0, 255, outputDir) | ||
); | ||
}; | ||
function output2pbf(font, start, end, outputDir) { | ||
if (start > 65535) { | ||
console.log("done!"); | ||
return; | ||
} | ||
fontnik.range({ font: font, start: start, end: end }, function (err, res) { | ||
var outputFilePath = path.resolve( | ||
outputDir + "/" + start + "-" + end + ".pbf" | ||
); | ||
fs.writeFile(outputFilePath, res, function (err) { | ||
if (err) { | ||
console.error(err); | ||
} else { | ||
output2pbf(font, end + 1, end + 1 + 255, outputDir); | ||
} | ||
}); | ||
}); | ||
} | ||
|
||
var process = require("process"); | ||
var args = process.argv.slice(2); | ||
|
||
fs.readdir(args[0], (err, files) => { | ||
files.forEach((file) => { | ||
convert( | ||
args[0].replace(/\/$/, "") + "/" + file, | ||
"/output/" + file.replace(/\.(otf|ttf)$/, "") | ||
); | ||
console.log("converted", file); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"options": { | ||
"paths": { | ||
"root": "/app/node_modules/tileserver-gl-styles", | ||
"fonts": "/data/fonts", | ||
"styles": "/data/styles", | ||
"mbtiles": "/data" | ||
} | ||
}, | ||
"styles": { | ||
"dark": { | ||
"style": "/data/styles/dark.json" | ||
}, | ||
"light": { | ||
"style": "/data/styles/light.json" | ||
} | ||
}, | ||
"data": { | ||
"v3": { | ||
"mbtiles": "mapdata.mbtiles" | ||
} | ||
} | ||
} |
Oops, something went wrong.