google-maps-drawing-tools
Version:
Unified drawing tools for Google Maps
44 lines (29 loc) • 931 B
Markdown
Have you noticed that Google Maps has two ways to draw and both have different options? Well this
library tries to have a unified way to draw that allows exporting geojson and restoring drawings from
existing geojson.
```sh
npm install --save google-maps-drawing-tools
```
```js
import DrawingManager from 'google-maps-drawing-tools';
const map = new google.maps.Map(element, mapOptions);
const manager = new DrawingManager({ map });
// Load geojson
manager.data.addGeoJson(geoJson);
// Can also use 'line', 'circle', 'rectangle' and 'marker'
manager.changeTool('polygon');
// Draw a polygon on the map..
manager.data.toGeoJson((geojson) => {
// access the geojson
});
```
[][api]
- [ ] Add Text Label
- [ ] Add measurement option
- [ ] Add measurement units option
- [ ] etc..
[]: https://knownasilya.github.io/google-maps-drawing-tools/