Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/spencermountain/somehow-maps

make a map without thinking
https://github.com/spencermountain/somehow-maps

Last synced: about 1 month ago
JSON representation

make a map without thinking

Awesome Lists containing this project

README

        


somehow-maps


— part of somehow

WIP svelte infographics



by
Spencer Kelly









npm install somehow-maps

this library just hoodwinks some d3 projection methods into Svelte components -

- so that basic SVG maps can be made in a leisurely way.
- **work-in-progress!**

```js

import { Globe, Line, Graticule, Dot, Latitude } from 'somehow-map'





```

![image](https://user-images.githubusercontent.com/399657/92409352-494f6e80-f10e-11ea-82cf-51c8bdc8e4c0.png)

### Components

these two are the containers, and should be mostly interchangeable

- ``
- ``
both of these accept a 'focus' param, what zooms the map projection to fit a geojson object.

these are the basic primitives

- ``
- ``
- ``

these are continual lines around the whole world:

- ``
- ``

these are some helpers

- ``
- ``
- ``

### Misc

to generate ad-hoc topojson shapes (without using QGIS):

- grab shapefiles from [natural earth](https://www.naturalearthdata.com/downloads/)
- draw a new shape in [geojson.io](http://geojson.io)
- add them both to [mapshaper.org](https://mapshaper.org/)
- run `mapshaper -clip myshape.geojson`
- export as **topojson**

---

to generate ad-hoc topojson shapes from openstreetmap:

- download some pbf data from [geofabrik.de](http://download.geofabrik.de/)

- use James Halliday's nodejs [pbf parser](https://github.com/substack/osm-pbf-parser) to filter down [specific tags](https://wiki.openstreetmap.org/wiki/Key:amenity)

### See also

- [somehow](https://github.com/spencermountain/somehow)
- [thensome.how](https://thensome.how)

MIT