Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fishcharlie committed Dec 27, 2023
1 parent 31b45fe commit 0a48ceb
Show file tree
Hide file tree
Showing 8 changed files with 4,704 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 rrainn
Copyright (c) 2023 rrainn, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
45 changes: 45 additions & 0 deletions README.md
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.
7 changes: 7 additions & 0 deletions jest.config.js
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"]
};
Loading

0 comments on commit 0a48ceb

Please sign in to comment.