🔍 endless magnification zoomability after max tile zoom level is reached

This commit is contained in:
Michael Straßburger 2016-11-03 07:04:53 +01:00
parent ea879a77f7
commit 24434052cb
4 changed files with 8 additions and 7 deletions

View File

@ -69,7 +69,7 @@ No web browser around? No worries - discover the planet in your console!
* [ ] Viewport
* [x] start with zoom level which shows full vector tile
* [X] boundary based on current zoom & size
* [ ] determain tiles to show
* [X] determain tiles to show
* [X] zoom while keeping center
* [ ] calculate tile areas
* [X] center based on mercator
@ -94,7 +94,7 @@ No web browser around? No worries - discover the planet in your console!
* [ ] line drawing
* [x] support for stroke width
* [ ] support for dashed/dotted lines?
* [x] feature selection for priority rerendering (roads -> warter -> roads:bridges)
* [ ] feature selection for priority rerendering (roads -> warter -> roads:bridges)
* [ ] label drawing
* [x] support for point labels

View File

@ -36,6 +36,7 @@
"request-promise": "^4.1.1",
"sphericalmercator": "^1.0.5",
"term-mouse": "^0.1.1",
"tilebelt": "^1.0.1",
"vector-tile": "^1.3.0",
"x256": "0.0.2"
}

View File

@ -19,7 +19,6 @@ utils = require './utils'
module.exports = class Renderer
cache: {}
config:
baseZoom: 4
fillPolygons: true
language: 'de'
@ -27,6 +26,7 @@ module.exports = class Renderer
tileSize: 4096
projectSize: 256
maxZoom: 14
#"poi_label", "water",
drawOrder: [
@ -115,7 +115,7 @@ module.exports = class Renderer
@lastDrawAt = Date.now()
_visibleTiles: (center, zoom) ->
z = Math.max 0, Math.floor zoom
z = Math.min @config.maxZoom, Math.max 0, Math.floor zoom
xyz = tilebelt.pointToTileFraction center.lon, center.lat, z
tiles = []
@ -222,7 +222,7 @@ module.exports = class Renderer
@output.write output
_scaleAtZoom: (zoom) ->
baseZoom = Math.floor Math.max 0, zoom
baseZoom = Math.min @config.maxZoom, Math.floor Math.max 0, zoom
(@config.tileSize/@config.projectSize)/Math.pow(2, zoom-baseZoom)
_drawFeature: (layer, data, scale, zoom) ->
@ -256,6 +256,7 @@ module.exports = class Renderer
when "Point"
text = feature.properties["name_"+@config.language] or
feature.properties["name_en"] or
feature.properties["name"] or
feature.properties.house_num or
#@config.icons[feature.properties.maki] or

View File

@ -46,9 +46,8 @@ module.exports = class Termap
lat: 49.0189
lon: 12.0990
minZoom: null
maxZoom: 14.9
maxZoom: 18
constructor: (options) ->
@config[key] = val for key, val of options