2.1.3 • Published 6 months ago
@2gis/mapgl-ruler v2.1.3
mapgl-ruler
Ruler plugin for Mapgl
Usage
Install with NPM
npm install @2gis/mapgl-rulerUse ruler directly
Import the Ruler class to your project and use it:
import { Ruler } from '@2gis/mapgl-ruler';
const map = new mapgl.Map('container', {
center: [55.31878, 25.23584],
zoom: 13,
key: 'Your API access key',
});
const ruler = new Ruler(map, {
points: [
[55.31878, 25.23584],
[55.35878, 25.23584],
[55.35878, 25.26584],
]
});Use ruler via RulerControl
Import the RulerControl class to your project and use it:
import { RulerControl } from "@2gis/mapgl-ruler";
const map = new mapgl.Map('container', {
center: [55.31878, 25.23584],
zoom: 13,
key: 'Your API access key',
});
const control = new RulerControl(map, { position: 'centerRight' })Contributing
Mapgl-ruler uses github-flow to accept & merge fixes and improvements. Basic process is:
- Fork the repo.
- Create a branch.
- Add or fix some code.
- Run testing suite with
npm run docker:testand make sure nothing is broken - Add some tests for your new code or fix broken tests.
- Commit & push.
- Create a new pull request to original repo.
Pull requests with failing tests will not be accepted.
Also, if you modify packages or add them to package.json, make sure you use npm and update package-lock.json.
Tests
Run tests
npm run docker:testUpdate screenshots
npm run docker:screenshot:updateRelease
npm
- Update the package version by running
npm version patch|minor|major. This command returns a new package version. Let assume it's 1.2.3 - Push changes to github and merge them to the «master» branch
- Go to https://github.com/2gis/mapgl-ruler/releases/new
- Click the «Choose tag» button and create a new tag according to the version in package.json, for example v1.2.3
- Make sure the release target is the «master» branch
- Paste the release tag into the «Release title» field, for example v1.2.3
- Add a release description
- Click the «Publish release» button
- Go to https://github.com/2gis/mapgl-ruler/actions and wait for completing the release workflow
Demo
- Just execute
npm run deploy-gh-pageson your local machine from a commit you want to deploy as a demo.
2.1.2
6 months ago
2.1.1
6 months ago
2.1.3
6 months ago
2.1.0
1 year ago
2.0.9
1 year ago
2.0.10
1 year ago
2.0.8
2 years ago
2.0.7
2 years ago
2.0.3
3 years ago
2.0.5
3 years ago
2.0.4
3 years ago
2.0.6
3 years ago
2.0.2
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago