-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31b45fe
commit 0a48ceb
Showing
8 changed files
with
4,704 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: CI | ||
on: | ||
push: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# MapToImage | ||
|
||
## Description | ||
|
||
This is a Node.js package that allows you to convert a map to an image. You can set the dimensions of the image, the zoom level, the center of the map, and the tile servers you wish to use. | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install maptoimage | ||
``` | ||
|
||
## Usage | ||
|
||
```js | ||
const { mapToImage } = require("maptoimage"); | ||
(async () => { | ||
mapToImage({ | ||
"image": { | ||
"dimensions": { | ||
"width": 1280, | ||
"height": 720 | ||
} | ||
}, | ||
"map": { | ||
"center": { | ||
"lat": 39.67321, | ||
"lng": -104.95140 | ||
}, | ||
"zoom": 5, | ||
"layers": [ | ||
"https://tile.openstreetmap.org/{z}/{x}/{y}.png", | ||
// https://mesonet.agron.iastate.edu/GIS/ridge.phtml | ||
"https://mesonet.agron.iastate.edu/cache/tile.py/1.0.0/ridge::USCOMP-N0Q-0/{z}/{x}/{y}.png", | ||
] | ||
} | ||
}); | ||
})(); | ||
``` | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. | ||
|
||
Please remember that the tile servers you use may have their own licenses. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
"preset": "ts-jest", | ||
"testEnvironment": "node", | ||
"testMatch": ["**/src/**/*.test.[jt]s?(x)"], | ||
"coverageReporters": ["json", "lcov", "text", "html"], | ||
"transformIgnorePatterns": ["dist/.+\\.js"] | ||
}; |
Oops, something went wrong.