diff --git a/.gitignore b/.gitignore index bc49c33..9da2971 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules bundle* *.log +tmp diff --git a/main.js b/main.js index e88c0f7..dc92fd2 100644 --- a/main.js +++ b/main.js @@ -17,7 +17,7 @@ const Tile = require(__dirname+'/src/Tile') termap = new Termap(); // TODO: abstracing this class, create loader class -data = fs.readFileSync(__dirname+"/tiles/world.pbf.gz"); +data = fs.readFileSync(__dirname+"/tiles/regensburg.pbf.gz"); tile = new Tile(data); termap.renderer.features = tile.layers termap._draw(); diff --git a/src/Canvas.coffee b/src/Canvas.coffee index 708da4a..f123702 100644 --- a/src/Canvas.coffee +++ b/src/Canvas.coffee @@ -40,7 +40,7 @@ module.exports = class Canvas clear: -> @buffer.clear() - text: (text, x, y, color, center = true) -> + text: (text, x, y, color, center = false) -> position = @_project x, y @buffer.writeText text, position[0], position[1], color, center diff --git a/src/Renderer.coffee b/src/Renderer.coffee index 0bb91c2..79ee5c5 100644 --- a/src/Renderer.coffee +++ b/src/Renderer.coffee @@ -26,7 +26,6 @@ module.exports = class Renderer "building" "road" - "water_label" "place_label" "poi_label" "housenum_label" @@ -147,7 +146,7 @@ module.exports = class Renderer switch feature.type when "LineString" - width = style.paint['line-width']?.base or 1 + width = style.paint['line-width']?.base*1.4 or 1 @canvas.polyline points, colorCode, width for points in toDraw when "Polygon" @@ -166,12 +165,10 @@ module.exports = class Renderer x = point[0] - text.length margin = @config.layers[layer]?.margin or @config.labelMargin - write = (text) => @canvas.text text, x, point[1], colorCode, false - if @labelBuffer.writeIfPossible text, x, point[1], margin - write text - else if @config.layers[layer]?.cluster and @labelBuffer.writeIfPossible "X", x, point[1], 3 - write "◉" + @canvas.text text, x, point[1], colorCode + else if @config.layers[layer]?.cluster and @labelBuffer.writeIfPossible "X", point[0], point[1], 3 + @canvas.text "◉", point[0], point[1], colorCode _scaleAndReduce: (points, scale) -> lastX = null diff --git a/styles/bright.json b/styles/bright.json index 8ca2011..2d5505e 100644 --- a/styles/bright.json +++ b/styles/bright.json @@ -1799,7 +1799,7 @@ "type": "symbol", "id": "housenum_label", "paint": { - "text-color": "#333" + "text-color": "#444" }, "source-layer": "housenum_label" },