mirror of
https://github.com/rastapasta/mapscii.git
synced 2024-11-25 01:23:58 +01:00
🛀 cleaning up, removing obsolete dev tiles and scripts
This commit is contained in:
parent
d229842a0f
commit
f705cf4cd4
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@ bundle*
|
||||
*.log
|
||||
tmp
|
||||
mbtiles
|
||||
tiles
|
||||
|
@ -1,4 +1,4 @@
|
||||
# MapSCII - Map Viewer for your console
|
||||
# MapSCII - the whole world in your console.
|
||||
|
||||
No web browser around? Don't worry - and discover the planet in your console!
|
||||
|
||||
@ -8,7 +8,7 @@ No web browser around? Don't worry - and discover the planet in your console!
|
||||
* Discover the globe or zoom in to explore your neighbourhood
|
||||
* See Point-of-Interest around any given location
|
||||
* Use an online map server or work offline with VectorTile/MBTiles
|
||||
* Highly customizable styling (reuse your [mapbox-gl-style](https://github.com/mapbox/mapbox-gl-styles)s)
|
||||
* Highly customizable styling (reuse your [mapbox-gl-styles](https://github.com/mapbox/mapbox-gl-styles))
|
||||
* Compatible with Linux' and OS X' terminals, Windows support via [PuTTY](http://www.putty.org/)
|
||||
* 99% pure Coffee-/JavaScript! :sunglasses:
|
||||
|
||||
@ -20,9 +20,7 @@ No web browser around? Don't worry - and discover the planet in your console!
|
||||
|
||||
`npm install -g mapscii`
|
||||
|
||||
## How to use it?
|
||||
#### Basic usage
|
||||
* Start `mapscii` with
|
||||
* Start it with
|
||||
|
||||
`mapscii`
|
||||
|
||||
|
@ -1,46 +0,0 @@
|
||||
###
|
||||
termap - Terminal Map Viewer
|
||||
by Michael Strassburger <codepoet@cpan.org>
|
||||
|
||||
just a tool to make development easier
|
||||
|
||||
Input: Mapbox Studio map style file
|
||||
Output: Reduced map style file (only supported attributes are kept)
|
||||
###
|
||||
fs = require 'fs'
|
||||
|
||||
cleanStyle = (file) ->
|
||||
json = JSON.parse fs.readFileSync(file).toString()
|
||||
|
||||
cleanedStyle =
|
||||
name: json.name
|
||||
layers: []
|
||||
|
||||
for layer in json.layers
|
||||
continue if layer.ref
|
||||
|
||||
cleanLayer =
|
||||
type: layer.type
|
||||
id: layer.id
|
||||
paint: {}
|
||||
'source-layer': layer['source-layer']
|
||||
|
||||
|
||||
for key in ['filter', 'minzoom']
|
||||
cleanLayer[key] = layer[key] if layer[key]
|
||||
|
||||
if layer.layout?['text-size']
|
||||
cleanLayer.layout = 'text-size': layer.layout?['text-size']
|
||||
|
||||
for key in ['fill-color', 'line-color', 'text-color', 'background-color']
|
||||
cleanLayer.paint[key] = layer.paint[key] if layer.paint?[key]
|
||||
|
||||
if Object.keys(cleanLayer.paint).length
|
||||
cleanedStyle.layers.push cleanLayer
|
||||
|
||||
JSON.stringify cleanedStyle, null, ' '
|
||||
|
||||
console.log unless process.argv[2]
|
||||
"usage: coffee cleanStyle.coffee <inputJSON>"
|
||||
else
|
||||
cleanStyle process.argv[2]
|
@ -1,29 +0,0 @@
|
||||
###
|
||||
termap - Terminal Map Viewer
|
||||
by Michael Strassburger <codepoet@cpan.org>
|
||||
|
||||
just a dev tool to make development easier
|
||||
###
|
||||
fs = require 'fs'
|
||||
|
||||
mergeStyle = (from, to) ->
|
||||
from = JSON.parse fs.readFileSync(from).toString()
|
||||
to = JSON.parse fs.readFileSync(to).toString()
|
||||
|
||||
fromLayers = {}
|
||||
for layer in from.layers
|
||||
fromLayers[layer.id] = layer
|
||||
|
||||
for id, layer of to.layers
|
||||
continue unless from = fromLayers[layer.id]
|
||||
|
||||
# -> logic for what ever should be merged
|
||||
if width = from.paint['line-width']
|
||||
to.layers[id].paint['line-width'] = width
|
||||
|
||||
JSON.stringify to, null, ' '
|
||||
|
||||
console.log unless process.argv[2] and process.argv[3]
|
||||
"usage: coffee mergeStyle.coffee <sourceJSON> <destinationJSON>"
|
||||
else
|
||||
mergeStyle process.argv[2..3]...
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user