Render transparent tiles if command line flag is set.

This commit is contained in:
Sascha L. Teichmann
2014-10-26 18:36:47 +01:00
parent 2aa9ee0e24
commit 8452a26fcd
8 changed files with 198 additions and 77 deletions

View File

@ -48,6 +48,7 @@ func order(a, b int) (int, int) {
func createBaseLevel(
address string,
xMin, zMin, xMax, zMax int,
transparent bool,
colorsFile, outDir string,
numWorkers int) (err error) {
@ -71,7 +72,7 @@ func createBaseLevel(
return
}
done.Add(1)
btc := common.NewBaseTileCreator(client, colors, baseDir, false)
btc := common.NewBaseTileCreator(client, colors, transparent, baseDir, false)
go createTiles(btc, jobs, &done)
}

View File

@ -21,6 +21,7 @@ func main() {
numWorkers int
skipBaseLevel bool
skipPyramid bool
transparent bool
)
flag.IntVar(&port, "port", 6379, "port to of mtredisalize server")
@ -39,6 +40,8 @@ func main() {
flag.BoolVar(&skipBaseLevel, "sb", false, "Do not generate base level tiles (shorthand)")
flag.BoolVar(&skipPyramid, "skip-pyramid", false, "Do not generate pyramid tiles")
flag.BoolVar(&skipPyramid, "sp", false, "Do not generate pyramid tiles (shorthand)")
flag.BoolVar(&transparent, "transparent", false, "Render transparent blocks.")
flag.BoolVar(&transparent, "t", false, "Render transparent blocks (shorthand).")
flag.Parse()
@ -46,7 +49,12 @@ func main() {
if !skipBaseLevel {
address := fmt.Sprintf("%s:%d", host, port)
if err = createBaseLevel(
address, xMin, zMin, xMax, zMax, colorsFile, outDir, numWorkers); err != nil {
address,
xMin, zMin, xMax, zMax,
transparent,
colorsFile,
outDir,
numWorkers); err != nil {
log.Fatalf("Creating base level tiles failed: %s", err)
}
}