Added 5 second delay to saving

This commit is contained in:
2019-08-31 02:05:38 -04:00
parent 14094447e5
commit 382d045f32
2 changed files with 35 additions and 20 deletions

View File

@ -188,23 +188,23 @@ export class MapComponent implements OnInit {
this.route.params.subscribe(params => {
this.code = params['code'];
this.syncService.load(this.code);
// Handle drawing the map after updates
this.syncService.mapSymbols.pipe(filter(s => !!s)).subscribe((map: MapData) => {
this.map.deleteAll();
if (map.circles) map.circles.forEach(c => this.map.newCircle(c));
if (map.markers) map.markers.forEach(m => this.map.newMarker(m));
if (map.measurements) map.measurements.forEach(m => this.map.newMeasurement(m));
if (map.polygons) map.polygons.forEach(p => this.map.newPolygon(p));
if (map.polylines) map.polylines.forEach(p => this.map.newPolyline(p));
if (map.rectangles) map.rectangles.forEach(r => this.map.newRectangle(r));
})
})
}
ngOnInit() {
this.map = new MapService('map');
// Handle drawing the map after updates
this.syncService.mapSymbols.pipe(filter(s => !!s)).subscribe((map: MapData) => {
this.map.deleteAll();
if (map.circles) map.circles.forEach(c => this.map.newCircle(c));
if (map.markers) map.markers.forEach(m => this.map.newMarker(m));
if (map.measurements) map.measurements.forEach(m => this.map.newMeasurement(m));
if (map.polygons) map.polygons.forEach(p => this.map.newPolygon(p));
if (map.polylines) map.polylines.forEach(p => this.map.newPolyline(p));
if (map.rectangles) map.rectangles.forEach(r => this.map.newRectangle(r));
});
// Handle opening symbols
this.map.click.pipe(filter(e => !!e && e.item)).subscribe(e => {
if (e.item instanceof L.Marker) {