Added square tool
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import {BehaviorSubject} from "rxjs";
|
||||
import {latLngDistance} from "../utils";
|
||||
import {environment} from "../../environments/environment";
|
||||
import {Circle, LatLng, Marker, Measurement} from "../models/mapSymbol";
|
||||
import {Circle, LatLng, Marker, Measurement, Rectangle} from "../models/mapSymbol";
|
||||
|
||||
declare const L;
|
||||
|
||||
@ -151,6 +151,14 @@ export class MapService {
|
||||
return group;
|
||||
}
|
||||
|
||||
newRectangle(r: Rectangle) {
|
||||
if(!r.color) r.color = '#ff4141';
|
||||
let rect = new L.Rectangle([r.latlng, r.latlng2], r).addTo(this.map);
|
||||
rect.symbol = r;
|
||||
rect.on('click', e => this.click.next({event: e, symbol: rect}));
|
||||
return rect;
|
||||
}
|
||||
|
||||
startDrawing() {
|
||||
this.lock();
|
||||
this.drawListener = e => {
|
||||
|
Reference in New Issue
Block a user