Coder Social home page Coder Social logo

rastapasta / mapscii Goto Github PK

View Code? Open in Web Editor NEW
7.4K 7.4K 242.0 14 MB

šŸ—ŗ MapSCII is a Braille & ASCII world map renderer for your console - enter => telnet mapscii.me <= on Mac (brew install telnet) and Linux, connect with PuTTY on Windows

License: MIT License

JavaScript 99.56% Shell 0.44%
ascii-art braille console console-application map openstreetmap vector-tiles

mapscii's People

Contributors

0xflotus avatar dependabot[bot] avatar derhuerst avatar jaller94 avatar jestin avatar quincylvania avatar rastapasta avatar self-perfection avatar sword-smith avatar zhukovalexander avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mapscii's Issues

Is there a text search option? [Support Quest Or Feature Request]

I'm currently implementing this is a system call in PSIFER, as one of the options the AI can do. Is there a way to get it to go to a specific location at startup, or would I specifically need to do a text search in mapscii?

If text search, which command do I do this?

Where is Iran and Iraq

Hi
its very good idea and so funny
but i dont know where is Iran and Iraq
it has Tehran BUT hasnt IRAN? :|

Getting promise errors

Whenever I try to pan with the mouse, I get errors similar to the following:

(node:26121) Warning: A promise was rejected with a non-error: [object:Undefined]

Reproduced in termite and alacritty with tmux.

Add continous integration testing

I would like to add Travis CI for running Jest tests, ideally with a coverage report.

As I do not have any experience with Travis CI yet, I am looking for help for an initial setup.

The current status is that I authorized Travis CI to read my repositories and I am looking to read the documentation.

vim keybinds

The problem

When I open this program my hands instinctively try to adjust the map using the vim keys. This is the natural mode of navigation for countless TUI programs.

Proposed solution

h,j,k, and l are the classic left, down, up, right controls. You could keep zooming as a and z, but I would love to use J and K.

Additional context

I don't believe these keybinds would interfere with any preexisting options, and non vim users could easily stick to the arrow keys.

This also provides a framework for more keybinds. For example if you implement a search feature, the / key is already most peoples go-to and it makes the program easy to learn.

user configurable config file

The problem

creating config and cache directories in $HOME quickly ends up with a cluttered $HOME by the time you have several apps running

I would like to see an option to user define the data/cache directory used

Proposed solution

one newer solution is to check the environment to see if $XDG_CACHE_HOME is defined and if so create a subdirectory under it named after the app and put any cache data there

see

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Alternative solutions

some developers solve it with an ENV variable pointing to the cache/data/config directories

others have a command line switch to define such a directory

Additional context

thanks for taking the time to read this

consider rendering offscreen

I haven't looked at the exact implementation yet, so forgive me if this is already the case.

It would be possible to render the map offscreen, e.g. in a worker process and then display it. By doing this, the UI wouldn't be blocked that long. Scrolling would have to be disabled or a new rendering attempt started (with the new zoom level) on scroll/move events.

support search for cities/addresses/points of interest

There should be a way to search for a city, a street address, or a point of interest nearby.

Example of search string that should possible :

  • New York
  • 28 Something Street, Somecity
  • United Kingdom
  • Bar (to show bars nearby)

We could imagine a shortcut such as / (so we'll be typing /seachstring) and then have a drop down menu if there is multiple results.

Add new contributors to the LICENSE file

Since I started accepting pull requests the repository has gained a couple new contributors.
According to the chosen licence MIT contributors get attributed.

  • I am in favour of a PR that adds their full names and/or GitHub nicknames (as @[email protected]) to the LICENCE file before the next release.

  • If that is the way contributors get their attribution, it should get mentioned in a Contributing.md.

  • And the repository should get a Pull Request template, asking with what name they would like to get attributed.

An icon / a logo for MapSCII

Some ideas:

  • A very simple, coloured world out of ascii chars
    • If it is round, which part of the world to show??
    • If it is like a map, it wonā€™t be square...
  • A terminal icon with some content
    • A map?
    • A town
    • Something similar to what the standard map apps use? (some streets an a locator) ā­ļø
  • The OSM logo as an Ascii art? (I am not a fan of the OSM logo in the first place. It looks to complicated.)

.deb package request

I don't use snap and wouldn't want to as well as others. If someone could make a .deb, it would be great.
Thanks

Add ability to pipe in coordinates and have these show on map

A great use for this system would be to view events (or alerts) on a map. For example, I have traffic sensors distributed throughout a city. It would be nice if I could pipe in an array of {lat, long} pairs and have markers appear on the map. Then mapscii becomes a great starting point for any monitoring service.

Great project! Keep with it. Thanks.

optimised rendering for large areas

Using breseham for drawing every shape is extremely convenient, but the visual noise is significant. It might be better to render continuous, large surfaces with a background color, e.g. using chalk.

the borders of the area would look different however, so this would require some further investigation.

Unimplemented type: 4

Steps to reproduce
linux 5.7.4.arch1-1, in either urxvt or xterm:

$ npx mapscii
Welcome to MapSCII! Use your cursors to navigate, a/z to zoom, q to quit.Error: Unimplemented type: 4
    at Pbf.skip (/usr/lib/node_modules/mapscii/node_modules/pbf/index.js:211:20)
    at Pbf.readFields (/usr/lib/node_modules/mapscii/node_modules/pbf/index.js:46:45)
    at new VectorTile (/usr/lib/node_modules/mapscii/node_modules/@mapbox/vector-tile/lib/vectortile.js:8:23)
    at Tile._loadTile (/usr/lib/node_modules/mapscii/src/Tile.js:33:17)
    at /usr/lib/node_modules/mapscii/src/Tile.js:24:19
renderer is busy

and nothing more appears - no map. Exactly the same when I run mapscii installed from AUR.

Unhandled rejection TypeError: require(...).setRawMode is not a function

windows10
node v10.1.0
gitbash

use npm install -g mapscii
and it works fine
then i try mapscii
it throw an error

Unhandled rejection TypeError: require(...).setRawMode is not a function
    at Mouse.start (C:\Users\c\AppData\Roaming\npm\node_modules\mapscii\node_modules\term-mouse\index.js:67:21)
    at Mapscii.module.exports.Mapscii._initMouse (C:\Users\c\AppData\Roaming\npm\node_modules\mapscii\src\Mapscii.coffee:73:12)
    at C:\Users\c\AppData\Roaming\npm\node_modules\mapscii\src\Mapscii.coffee:49:10
    at tryCatcher (C:\Users\c\AppData\Roaming\npm\node_modules\mapscii\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Users\c\AppData\Roaming\npm\node_modules\mapscii\node_modules\bluebird\js\release\promise.js:512:31)
    at Promise._settlePromise (C:\Users\c\AppData\Roaming\npm\node_modules\mapscii\node_modules\bluebird\js\release\promise.js:569:18)
    at Promise._settlePromiseCtx (C:\Users\c\AppData\Roaming\npm\node_modules\mapscii\node_modules\bluebird\js\release\promise.js:606:10)
    at Async._drainQueue (C:\Users\c\AppData\Roaming\npm\node_modules\mapscii\node_modules\bluebird\js\release\async.js:138:12)
    at Async._drainQueues (C:\Users\c\AppData\Roaming\npm\node_modules\mapscii\node_modules\bluebird\js\release\async.js:143:10)
    at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\c\AppData\Roaming\npm\node_modules\mapscii\node_modules\bluebird\js\release\async.js:17:14)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)

Working with the visually impaired/blind

Hey,

do you work hand in hand with visually impaired or blind users to develop this project further and doing improvements?

If yes, then how is it going like getting feedback, working hand in hand with such people, is the communication via internet or also in real life? Do you work for an organization working for and with people with visually impairments?

Pressing Escape crashes local Mapscii

Reproduce:

  1. Start Mapscii with npm run start
  2. Press Escape on the keyboard

Affected

Tested on

Only my local mapscii (version 1251e3f) is affected.

Expected:

Mapscii ignores this or quits.

Actual:

Mapscii crashes

  throw new ERR_OUT_OF_RANGE(type || 'offset',
  ^

RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 0. Received 1
    at boundsError (internal/buffer.js:58:9)
    at Buffer.readUInt8 (internal/buffer.js:148:5)
    at Mouse._onData (/home/jaller94/Git/github/mapscii/node_modules/term-mouse/index.js:81:24)
    at ReadStream.emit (events.js:198:15)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:276:11)
    at ReadStream.Readable.push (_stream_readable.js:231:10)
    at TTY.onStreamRead (internal/stream_base_commons.js:154:17)

Mapscii.me is down

I cant start mapscii because on the server is not responding.
Is it possible to run this without any server dependency?
Error;

center: 52.512, 13.42 zoom: 0.06 mouse: 76.832, -60.461 { FetchError: request to http://mapscii.me/0/0/0.pbf failed, reason: connect ECONNREFUSED 185.162.249.146:80
at ClientRequest. (/usr/lib/node_modules/mapscii/node_modules/node-fetch/index.js:133:11)
at ClientRequest.emit (events.js:180:13)
at Socket.socketErrorListener (_http_client.js:394:9)
at Socket.emit (events.js:180:13)
at emitErrorNT (internal/streams/destroy.js:64:8)
at process._tickCallback (internal/process/next_tick.js:114:19)

name: 'FetchError',
message: 'request to http://mapscii.me/0/0/0.pbf failed, reason: connect ECONNREFUSED 185.162.249.146:80',
type: 'system',
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED' }
center: 52.512, 13.42 zoom: 0.06 mouse: 57.148, -73.894 { FetchError: request to http://mapscii.me/0/0/0.pbf failed, reason: connect ECONNREFUSED 185.162.249.146:80
at ClientRequest. (/usr/lib/node_modules/mapscii/node_modules/node-fetch/index.js:133:11)
at ClientRequest.emit (events.js:180:13)
at Socket.socketErrorListener (_http_client.js:394:9)
at Socket.emit (events.js:180:13)
at emitErrorNT (internal/streams/destroy.js:64:8)
at process._tickCallback (internal/process/next_tick.js:114:19)

name: 'FetchError',
message: 'request to http://mapscii.me/0/0/0.pbf failed, reason: connect ECONNREFUSED 185.162.249.146:80',
type: 'system',
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED' }
center: 52.512, 13.42 zoom: 0.06 mouse: 57.148, -73.894 ^[[<51;31;16M%

How was the Telnet Setup?

How did you setup this node application to work over telnet? There arent any instructions in the repo, issues or google

local npm install: "Error: Unimplemented type: 4" - broken PBF cache

Steps to reproduce

  • Install mapscii by npm, or by snap (Kubuntu Linux 18.04.2 Bionic Beaver)
  • Run mapscii
  • Get error

Current behavior

  • sudo npm install -g mapscii
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
/usr/bin/mapscii -> /usr/lib/node_modules/mapscii/bin/mapscii.sh
+ [email protected]
added 27 packages from 20 contributors in 1.517s
  • mapscii
Error: Unimplemented type: 4
    at Pbf.skip (/usr/lib/node_modules/mapscii/node_modules/pbf/index.js:200:20)
    at Pbf.readFields (/usr/lib/node_modules/mapscii/node_modules/pbf/index.js:41:45)
    at new VectorTile (/usr/lib/node_modules/mapscii/node_modules/@mapbox/vector-tile/lib/vectortile.js:8:23)
    at Tile._loadTile (/usr/lib/node_modules/mapscii/src/Tile.coffee:31:13)
    at /usr/lib/node_modules/mapscii/src/Tile.coffee:26:24
    at tryCatcher (/usr/lib/node_modules/mapscii/node_modules/bluebird/js/release/util.js:16:23)                                                                                             
    at Promise._settlePromiseFromHandler (/usr/lib/node_modules/mapscii/node_modules/bluebird/js/release/promise.js:517:31)
    at Promise._settlePromise (/usr/lib/node_modules/mapscii/node_modules/bluebird/js/release/promise.js:574:18)
    at Promise._settlePromiseCtx (/usr/lib/node_modules/mapscii/node_modules/bluebird/js/release/promise.js:611:10)
    at _drainQueueStep (/usr/lib/node_modules/mapscii/node_modules/bluebird/js/release/async.js:142:12)
    at _drainQueue (/usr/lib/node_modules/mapscii/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/usr/lib/node_modules/mapscii/node_modules/bluebird/js/release/async.js:147:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/usr/lib/node_modules/mapscii/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)

Welcome to MapSCII! Use your cursors to navigate, a/z to zoom, q to quit.

Expected behavior

  • map displayed.

Steps to fix

  • rm -rf ~/.mapscii/cache
  • app starts normally

Binding events for external use

Is it possible to add custom events so via a click I can retrieve coordinates and then use them in other libraries, so mapscii can be used as a lib as well?

thanks

Can't seem to get this to work locally

I've followed the 'instructions', and looked around for what I can see myself, but can't find a proper reason for this happening when trying to run mapscii.

$ mapscii
Unhandled rejection TypeError: Object http://mapscii.me/ has no method 'startsWith'
    at TileSource.module.exports.TileSource.init (/usr/local/lib/node_modules/mapscii/src/TileSource.coffee:38:16)
    at Mapscii.module.exports.Mapscii._initTileSource (/usr/local/lib/node_modules/mapscii/src/Mapscii.coffee:61:17)
    at /usr/local/lib/node_modules/mapscii/src/Mapscii.coffee:51:8
    at tryCatcher (/usr/local/lib/node_modules/mapscii/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/mapscii/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/usr/local/lib/node_modules/mapscii/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromiseCtx (/usr/local/lib/node_modules/mapscii/node_modules/bluebird/js/release/promise.js:606:10)
    at Async._drainQueue (/usr/local/lib/node_modules/mapscii/node_modules/bluebird/js/release/async.js:138:12)
    at Async._drainQueues (/usr/local/lib/node_modules/mapscii/node_modules/bluebird/js/release/async.js:143:10)
    at Async.drainQueues (/usr/local/lib/node_modules/mapscii/node_modules/bluebird/js/release/async.js:17:14)
    at process._tickCallback (node.js:419:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:906:3

Rapidly pressing keys switches Braille mode on and off

Reproduce:

  1. Rapidly press any character or number on the keyboard and the left or right arrow key.
  2. Keep doing that until the mode switches.

Explanation:

The package keypress triggers the string 'escape' which might get interpreted letter by letter. As it includes Ā“cĀ“ it could change the mode state. (This is an assumption, however, unconfirmed.)

Affected

Tested on

Both the local mapscii and telnet version are affected.

Let's have a new release

@rastapasta
A lot has changed since the last release. Many dependencies changed, lots of bugs have been fixed.
Can we have a new release with an update of telnet and NPM release?

Also, is there a way for us to update the map data? The tiles have not been updated since I started mapping three years ago.

Scrambled map when wide characters are present

As the title says.

For example, zoom in at location 39.761, 116.424 (Beijing, China).

I have made sure that my terminal is showing wide characters in monospace (2 chars wide on Chinese characters for example).

Add unit testing

Ideally tests get added to all files, functions and execution paths to raise confidence into changes to the code base. The goal is to add continuous integration tests for an easier approval process of new changes.

I am in favour of adding Jest as a development dependency to write unit tests.

map not showing, timeout (snap and telnet)

Steps to reproduce

  1. sudo snap install mapscii
  2. mapscii

OS: fedora 29
terminal: terminator (also tried konsole)
shell: zsh (also tried bash)

Current behavior

 mapscii
center: 52.512, 13.42   zoom: -0.17   mouse: 57.908, -149.212 { FetchError: request to http://mapscii.me/0/0/0.pbf failed, reason: connect ETIMEDOUT 185.162.249.146:80
    at ClientRequest.<anonymous> (/snap/mapscii/3/lib/node_modules/mapscii/node_modules/node-fetch/index.js:133:11)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at Socket.socketErrorListener (_http_client.js:309:9)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at emitErrorNT (net.js:1281:8)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

  name: 'FetchError',
  message: 'request to http://mapscii.me/0/0/0.pbf failed, reason: connect ETIMEDOUT 185.162.249.146:80',
  type: 'system',
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT' }
center: -22.719, 71.841   zoom: -0.17   mouse: -63.713, 120.788

Expected behavior

A map being shown.

(On a side note telnet mapscii.me also doesn't work. Timeout trying to connect to 185.162.249.146)

show coordinates at mouse position

right now, mapscii shows something like "-66 40" at the bottom, i guess that's relative to the coordinates of the map center. what about showing the coordinates at the mouse position?

show current location

Would like to be able to center the map around my current location. I wrote location for this.

Will submit a PR if you don't mind.

The wrong tag

Taiwan is a part of China, and should not be displayed as separate parts,please modify

Option to not show borders

Sometimes the map is more clear without e.g. municipal or state borders.

It would be nice to have the option to hide them from the map.

wrong display ratio with 1:1 fonts

hello! is it possible to add a parameter to modify display ratio? I'm using IBM-like bitmap 8*8 fonts, so the map is displayed with the wrong ratio :)

2017-06-20-132630_2560x1440_scrot

After a series of operations, there is a line shows"renderer is busy".

throw new ERR_OUT_OF_RANGE(type || 'offset',
^

RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 0. Received 1
at boundsError (internal/buffer.js:54:9)
at Uint8Array.readUInt8 (internal/buffer.js:144:5)
at Mouse._onData (/usr/local/lib/node_modules/mapscii/node_modules/term-mouse/index.js:81:24)
at ReadStream.emit (events.js:187:15)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at ReadStream.Readable.push (_stream_readable.js:219:10)
at TTY.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.