@ecogis/maps-ruler
v1.0.2
Published
Measure distance between points on a map
Downloads
121
Readme
📏 @ecogis/maps-ruler
Control to measure distance between points on a map.
npm i @ecogis/maps-rulerimport RulerControl from '@ecogis/maps-ruler';
import '@ecogis/maps-ruler/src/index.css';
map.addControl(new RulerControl(), 'bottom-right');
map.on('ruler.on', () => console.log('Ruler activated'));
map.on('ruler.off', () => console.log('Ruler deactivated'));Events
| event | description | | --------- | ----------------- | | ruler.on | ruler activated | | ruler.off | ruler deactivated |
Methods
Methods are useful for programmatic control (when option invisible is true):
activate(): void;- activate controlsdeactivate(): void;- deactivate controladdCoordinate(coordinate: [number, number]): void;- add new coordinate
