public void RemoveMe() { Measurement.RemoveMeasurementPoint(PointId); }
public void LookAtMeasurement() { Measurement?.LookAtMeasurement(ApiPoint); }
public void OpenNearestImage() { Measurement?.OpenNearestImage(ApiPoint); }
public async Task UpdatePointAsync(ApiMeasurementPoint measurementPoint, int index) { if (!_updatePoint) { _updatePoint = true; Index = index; ApiPoint = measurementPoint; double x = measurementPoint.x; double y = measurementPoint.y; double z = measurementPoint.z; Point = await CoordSystemUtils.CycloramaToMapPointAsync(x, y, z); LastPoint = LastPoint ?? Point; MapView thisView = MapView.Active; Geometry geometry = await thisView.GetCurrentSketchAsync(); if (geometry != null) { var ptColl = await Measurement.ToPointCollectionAsync(geometry); int nrPoints = Measurement.PointNr; if ((ptColl != null) && Measurement.IsSketch) { if (_intId <= nrPoints) { MapPoint pointC = ptColl[_intId - 1]; if (!IsSame(pointC)) { await QueuedTask.Run(() => { MapPoint point = MapPointBuilder.CreateMapPoint(Point.X, Point.Y, Point.Z, Point.M, geometry.SpatialReference); if (Measurement.IsPointMeasurement) { thisView.SetCurrentSketchAsync(point); } else { ptColl[_intId - 1] = point; if ((_intId == 1) && ((nrPoints + 1) == ptColl.Count)) { ptColl[ptColl.Count - 1] = point; } if (Measurement.IsGeometryType(GeometryType.Polygon)) { geometry = PolygonBuilder.CreatePolygon(ptColl, geometry.SpatialReference); } else if (Measurement.IsGeometryType(GeometryType.Polyline)) { if (ptColl.Count == 1) { ptColl.Add(ptColl[0]); } geometry = PolylineBuilder.CreatePolyline(ptColl, geometry.SpatialReference); } thisView.SetCurrentSketchAsync(geometry); } }); } } else { await QueuedTask.Run(() => { MapPoint point = MapPointBuilder.CreateMapPoint(Point.X, Point.Y, Point.Z, Point.M, geometry.SpatialReference); int nrPoints2 = ptColl.Count; switch (nrPoints2) { case 0: ptColl.Add(point); if (geometry is Polygon) { ptColl.Add(point); } break; case 1: ptColl.Add(point); break; default: if (_intId <= (nrPoints + 1)) { if ((_intId - 1) != nrPoints2) { ptColl.Insert((_intId - 1), point); } else { ptColl.Add(point); } } break; } if (Measurement.IsGeometryType(GeometryType.Polygon)) { geometry = PolygonBuilder.CreatePolygon(ptColl, geometry.SpatialReference); } else if (Measurement.IsGeometryType(GeometryType.Polyline)) { if (ptColl.Count == 1) { ptColl.Add(ptColl[0]); } geometry = PolylineBuilder.CreatePolyline(ptColl, geometry.SpatialReference); } else if ((Measurement.IsPointMeasurement) && (ptColl.Count == 1)) { geometry = ptColl[0]; } thisView.SetCurrentSketchAsync(geometry); }); } } else { if (geometry is MapPoint) { await QueuedTask.Run(() => { if (geometry.IsEmpty) { if ((!double.IsNaN(Point.X)) && (!double.IsNaN(Point.Y))) { if (!_added) { _added = true; MapPoint point = MapPointBuilder.CreateMapPoint(Point.X, Point.Y, Point.Z, Index); thisView.SetCurrentSketchAsync(point); _added = false; } } } else { var pointC = geometry as MapPoint; if (!IsSame(pointC)) { if ((!double.IsNaN(Point.X)) && (!double.IsNaN(Point.Y))) { MapPoint point = MapPointBuilder.CreateMapPoint(Point.X, Point.Y, Point.Z, Index); thisView.SetCurrentSketchAsync(point); } } } }); } } } _updatePoint = false; } await RedrawPointAsync(); }
public void OpenPoint() { Open = true; Measurement?.OpenPoint(PointId); SetDetailPane(); }
public void RemoveObservation(MeasurementObservation observation) { Measurement.RemoveObservation(PointId, observation?.ImageId); }