mapgl ruler
v2.1.0
Ruler plugin for Mapgl
Live demo
Install with NPM
npm install @2gis/mapgl-ruler
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],
]
});
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' })
Mapgl-ruler uses github-flow to accept & merge fixes and improvements. Basic process is:
npm run docker:test
and make sure nothing is brokenPull 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
.
npm run docker:test
npm run docker:screenshot:update
npm version patch|minor|major
. This command returns a new package version. Let assume it's 1.2.3npm run deploy-gh-pages
on your local machine from a commit you want to deploy as a demo.