Skip to content
Permalink
Browse files

Merge branch 'master' into upgrade-dependencies

  • Loading branch information...
jaller94 committed Jun 17, 2019
2 parents 7d4cd33 + eac7cb4 commit 421d71255f6292c55d7c21972402842a194ad80a
Showing with 84 additions and 142 deletions.
  1. +0 −1 .travis.yml
  2. +6 −0 AUTHORS
  3. +2 −1 LICENSE
  4. +3 −11 README.md
  5. +37 −101 package-lock.json
  6. +1 −1 package.json
  7. +4 −3 src/Mapscii.js
  8. +2 −5 src/Renderer.js
  9. +12 −15 src/Styler.js
  10. +5 −4 src/TileSource.js
  11. +12 −0 src/TileSource.spec.js
@@ -1,5 +1,4 @@
language: node_js
node_js:
- "6"
- "8"
- "10"
@@ -0,0 +1,6 @@
# This is the list of MapSCII authors for copyright purposes.
#
Michael Straßburger
Christian Paul (https://chrpaul.de)
Jannis R <mail@jannisr.de>
Alexander Zhukov (https://github.com/ZhukovAlexander)
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2016 Michael Straßburger
Copyright (c) 2017 Michael Straßburger
Copyright (c) 2019 The MapSCII authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -78,7 +78,7 @@ If your terminal supports mouse events you can drag the map and use your scroll
#### Juggling the vectors and numbers
* [`earcut`](https://github.com/mapbox/earcut) for polygon triangulation
* [`rbush`](https://github.com/mourner/rbush) for 2D spatial indexing of geo and label data
* [`breseham`](https://github.com/madbence/node-bresenham) for line point calculations
* [`bresenham`](https://github.com/madbence/node-bresenham) for line point calculations
* [`simplify-js`](https://github.com/mourner/simplify-js) for polyline simplifications
#### Handling the flow
@@ -132,13 +132,5 @@ You are free to copy, distribute, transmit and adapt our data, as long as you cr
The cartography in our map tiles, and our documentation, are licenced under the [Creative Commons Attribution-ShareAlike 2.0](http://creativecommons.org/licenses/by-sa/2.0/) licence (CC BY-SA).
### MapSCII
#### The MIT License (MIT)
Copyright (c) 2017 Michael Straßburger
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* [License](./LICENSE)
* [Authors](./AUTHORS)

Some generated files are not rendered by default. Learn more.

@@ -15,7 +15,7 @@
"mapscii": "./bin/mapscii.sh"
},
"engines": {
"node": ">=6.14.0"
"node": ">=8"
},
"keywords": [
"map",
@@ -5,6 +5,7 @@
UI and central command center
*/
'use strict';
const fs = require('fs');
const keypress = require('keypress');
const TermMouse = require('term-mouse');

@@ -83,8 +84,8 @@ class Mapscii {
}

_initRenderer() {
this.renderer = new Renderer(config.output, this.tileSource);
this.renderer.loadStyleFile(config.styleFile);
const style = JSON.parse(fs.readFileSync(config.styleFile, 'utf8'));
this.renderer = new Renderer(config.output, this.tileSource, style);

config.output.on('resize', () => {
this._resizeRenderer();
@@ -225,7 +226,7 @@ class Mapscii {
draw = false;
}

if (draw !== null) {
if (draw) {
this._draw();
}
}
@@ -16,14 +16,11 @@ const utils = require('./utils');
const config = require('./config');

class Renderer {
constructor(output, tileSource) {
constructor(output, tileSource, style) {
this.output = output;
this.tileSource = tileSource;
this.labelBuffer = new LabelBuffer();
}

loadStyleFile(file) {
this.styler = new Styler(file);
this.styler = new Styler(style);
this.tileSource.useStyler(this.styler);
}

0 comments on commit 421d712

Please sign in to comment.
You can’t perform that action at this time.