mirror of
https://github.com/rastapasta/mapscii.git
synced 2025-05-29 06:27:52 +02:00
🔍 endless magnification zoomability after max tile zoom level is reached
This commit is contained in:
parent
ea879a77f7
commit
24434052cb
@ -69,7 +69,7 @@ No web browser around? No worries - discover the planet in your console!
|
|||||||
* [ ] Viewport
|
* [ ] Viewport
|
||||||
* [x] start with zoom level which shows full vector tile
|
* [x] start with zoom level which shows full vector tile
|
||||||
* [X] boundary based on current zoom & size
|
* [X] boundary based on current zoom & size
|
||||||
* [ ] determain tiles to show
|
* [X] determain tiles to show
|
||||||
* [X] zoom while keeping center
|
* [X] zoom while keeping center
|
||||||
* [ ] calculate tile areas
|
* [ ] calculate tile areas
|
||||||
* [X] center based on mercator
|
* [X] center based on mercator
|
||||||
@ -94,7 +94,7 @@ No web browser around? No worries - discover the planet in your console!
|
|||||||
* [ ] line drawing
|
* [ ] line drawing
|
||||||
* [x] support for stroke width
|
* [x] support for stroke width
|
||||||
* [ ] support for dashed/dotted lines?
|
* [ ] 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
|
* [ ] label drawing
|
||||||
* [x] support for point labels
|
* [x] support for point labels
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
"request-promise": "^4.1.1",
|
"request-promise": "^4.1.1",
|
||||||
"sphericalmercator": "^1.0.5",
|
"sphericalmercator": "^1.0.5",
|
||||||
"term-mouse": "^0.1.1",
|
"term-mouse": "^0.1.1",
|
||||||
|
"tilebelt": "^1.0.1",
|
||||||
"vector-tile": "^1.3.0",
|
"vector-tile": "^1.3.0",
|
||||||
"x256": "0.0.2"
|
"x256": "0.0.2"
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ utils = require './utils'
|
|||||||
module.exports = class Renderer
|
module.exports = class Renderer
|
||||||
cache: {}
|
cache: {}
|
||||||
config:
|
config:
|
||||||
baseZoom: 4
|
|
||||||
fillPolygons: true
|
fillPolygons: true
|
||||||
language: 'de'
|
language: 'de'
|
||||||
|
|
||||||
@ -27,6 +26,7 @@ module.exports = class Renderer
|
|||||||
|
|
||||||
tileSize: 4096
|
tileSize: 4096
|
||||||
projectSize: 256
|
projectSize: 256
|
||||||
|
maxZoom: 14
|
||||||
|
|
||||||
#"poi_label", "water",
|
#"poi_label", "water",
|
||||||
drawOrder: [
|
drawOrder: [
|
||||||
@ -115,7 +115,7 @@ module.exports = class Renderer
|
|||||||
@lastDrawAt = Date.now()
|
@lastDrawAt = Date.now()
|
||||||
|
|
||||||
_visibleTiles: (center, zoom) ->
|
_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
|
xyz = tilebelt.pointToTileFraction center.lon, center.lat, z
|
||||||
|
|
||||||
tiles = []
|
tiles = []
|
||||||
@ -222,7 +222,7 @@ module.exports = class Renderer
|
|||||||
@output.write output
|
@output.write output
|
||||||
|
|
||||||
_scaleAtZoom: (zoom) ->
|
_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)
|
(@config.tileSize/@config.projectSize)/Math.pow(2, zoom-baseZoom)
|
||||||
|
|
||||||
_drawFeature: (layer, data, scale, zoom) ->
|
_drawFeature: (layer, data, scale, zoom) ->
|
||||||
@ -256,6 +256,7 @@ module.exports = class Renderer
|
|||||||
|
|
||||||
when "Point"
|
when "Point"
|
||||||
text = feature.properties["name_"+@config.language] or
|
text = feature.properties["name_"+@config.language] or
|
||||||
|
feature.properties["name_en"] or
|
||||||
feature.properties["name"] or
|
feature.properties["name"] or
|
||||||
feature.properties.house_num or
|
feature.properties.house_num or
|
||||||
#@config.icons[feature.properties.maki] or
|
#@config.icons[feature.properties.maki] or
|
||||||
|
@ -46,9 +46,8 @@ module.exports = class Termap
|
|||||||
lat: 49.0189
|
lat: 49.0189
|
||||||
lon: 12.0990
|
lon: 12.0990
|
||||||
|
|
||||||
|
|
||||||
minZoom: null
|
minZoom: null
|
||||||
maxZoom: 14.9
|
maxZoom: 18
|
||||||
|
|
||||||
constructor: (options) ->
|
constructor: (options) ->
|
||||||
@config[key] = val for key, val of options
|
@config[key] = val for key, val of options
|
||||||
|
Loading…
x
Reference in New Issue
Block a user