Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tristen/chart-to-map
Experimental utility for matching SVG elements to Mapbox GL style templates.
https://github.com/tristen/chart-to-map
Last synced: 19 days ago
JSON representation
Experimental utility for matching SVG elements to Mapbox GL style templates.
- Host: GitHub
- URL: https://github.com/tristen/chart-to-map
- Owner: tristen
- License: other
- Created: 2018-03-26T16:51:12.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-15T11:09:34.000Z (over 5 years ago)
- Last Synced: 2024-11-15T23:12:30.751Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
chart-to-map
---Utility for matching SVG layers to Mapbox GL style templates.
### Installation
**Prerequisite**: Node 6 (or higher)
```sh
git clone [email protected]:mapbox/chart-to-map
cd chart-to-map
npm link
```### Usage
```sh
Usage
$ chart2map --from --toOptions
--from, -f Provide a from input. This is where changes will be read from. Must be a SVG file or Mapbox style template.
--to, -t Provide a to input. This is where changes will updated on. Must be a SVG file or Mapbox style template.Examples
$ chart2map --from foo.svg --to style.json
$ chart2map --from style.json --to foo.svg
```### Setup
There's some initial setup for this to work:
- **A map template** complete with the layers required to style the map. It
doesn't need to be styled but it does need to have layers pointing to the
sources required.- **An SVG file** The file can have any number of arbitrary objects. The only
layers the converter cares about are layers with names matching layer names
in the style, followed by double underscore, followed by either `all` to
represent all layers or a number to represent what zoom stop the style should
be applied on. Here's a couple examples:- background__all
- water__2
- water__12