🎨 adding landuse and new base dark style

This commit is contained in:
Michael Straßburger 2016-11-09 03:08:40 +01:00
parent 74a4dffbe7
commit d10ed9159f
4 changed files with 1546 additions and 105 deletions

View File

@ -14,7 +14,7 @@ Styler = require './Styler'
Tile = require './Tile' Tile = require './Tile'
utils = require './utils' utils = require './utils'
simplify = require 'simplify-js' #simplify = require 'simplify-js'
module.exports = class Renderer module.exports = class Renderer
cache: {} cache: {}
@ -29,17 +29,20 @@ module.exports = class Renderer
#"poi_label", "water", #"poi_label", "water",
drawOrder: [ drawOrder: [
"admin" "landuse"
"water" "water"
"marine_label" "marine_label"
"building" "building"
"road" "road"
"admin"
"country_label" "country_label"
"state_label" "state_label"
"water_label" "water_label"
"place_label" "place_label"
"rail_station_label" "rail_station_label"
"poi_label" "poi_label"
"road_label"
"housenum_label" "housenum_label"
] ]
@ -243,8 +246,12 @@ module.exports = class Renderer
if @labelBuffer.writeIfPossible text, x, point[1], feature, margin if @labelBuffer.writeIfPossible text, x, point[1], feature, margin
@canvas.text text, x, point[1], feature.color @canvas.text text, x, point[1], feature.color
else if @config.layers[feature.layer]?.cluster and @labelBuffer.writeIfPossible "X", point[0], point[1], feature, 3 break
else if @config.layers[feature.layer]?.cluster and
@labelBuffer.writeIfPossible "X", point[0], point[1], feature, 3
@canvas.text "", point[0], point[1], feature.color @canvas.text "", point[0], point[1], feature.color
break
true true
@ -254,7 +261,7 @@ module.exports = class Renderer
lastY = null lastY = null
outside = false outside = false
scaled = [] scaled = []
#seen = {} # seen = {}
for point in points for point in points
x = Math.floor tile.position.x+(point.x/tile.scale) x = Math.floor tile.position.x+(point.x/tile.scale)
@ -291,7 +298,7 @@ module.exports = class Renderer
return [] return []
# else # else
# scaled = ([point.x, point.y] for point in simplify scaled, 2, false) # scaled = ([point.x, point.y] for point in simplify scaled, 2, false)
#
# if filter # if filter
# if scaled.length is 2 # if scaled.length is 2
# if @_seen[ka = (scaled[0]<<8)+scaled[1]] or # if @_seen[ka = (scaled[0]<<8)+scaled[1]] or

View File

@ -20,7 +20,7 @@ module.exports = class Termap
source: "http://nachbar.io/data/osm2vectortiles/" source: "http://nachbar.io/data/osm2vectortiles/"
#source: __dirname+"/../mbtiles/regensburg.mbtiles" #source: __dirname+"/../mbtiles/regensburg.mbtiles"
styleFile: __dirname+"/../styles/bright.json" styleFile: __dirname+"/../styles/dark.json"
initialZoom: null initialZoom: null
maxZoom: 18 maxZoom: 18

View File

@ -72,7 +72,7 @@ class Tile
# TODO: monkey patching test case for tiles with a reduced extent 4096 / 8 -> 512 # TODO: monkey patching test case for tiles with a reduced extent 4096 / 8 -> 512
# use feature.loadGeometry() again as soon as we got a 512 extent tileset # use feature.loadGeometry() again as soon as we got a 512 extent tileset
geometries = feature.@_reduceGeometry feature, 8 geometries = feature.loadGeometry() #@_reduceGeometry feature, 8
if style.type is "fill" if style.type is "fill"
nodes.push @_addBoundaries true, nodes.push @_addBoundaries true,

File diff suppressed because it is too large Load Diff