Added some circle drawing tool

This commit is contained in:
2019-08-25 12:04:15 -04:00
parent b8bb4aed2b
commit 30b74dd91c
4 changed files with 20 additions and 10 deletions

View File

@ -115,7 +115,8 @@ export class MapService {
if(this.weatherLayer) this.weatherLayer.layer.addTo(this.map);
}
newCircle(latlng: LatLng, radius: number, opts: any={}) {
newCircle(latlng: LatLng, radius?: number, opts: any={}) {
if(!radius) radius = 100_000 / this.map.getZoom();
opts.radius = radius;
let circle = L.circle(latlng, opts).addTo(this.map);
circle.on('click', e => this.click.next({event: e, symbol: circle}));