public async Task SelectGeometries(List <SqlGeometry> geometries, VisualParameters visualParameters, System.Windows.Media.Geometry pointSymbol = null) { Debug.WriteLine("SelectGeometries 675 start [MapPresenter]"); await this.RequestSelectGeometries?.Invoke(geometries, visualParameters, pointSymbol); Debug.WriteLine("SelectGeometries 675 end [MapPresenter]"); }
public static EditableFeatureLayerOptions CreateDefaultForDrawingMeasure(bool isEdgeLabelVisible, bool isMultipartSupportAvailable, bool isManualInputAvailable, bool isOptionsAvailable = true) { return(new EditableFeatureLayerOptions() { Visual = VisualParameters.GetDefaultForMeasurements(), IsCancelButtonVisible = true, IsDeleteButtonVisible = false, IsEdgeLabelVisible = isEdgeLabelVisible, IsFinishButtonVisible = true, IsManualInputAvailable = isManualInputAvailable, IsMeasureVisible = true, IsMeasureButtonVisible = false, IsMultiPartSupportAvailable = isMultipartSupportAvailable, IsNewDrawing = true, IsOptionsAvailable = isOptionsAvailable, //IsEdgeLabelVisible = isEdgeLabelVisible, //IsOptionsAvailable = isOptionsAvailable, //IsManualInputAvailable = isManualInputAvailable, //IsMultiPartSupportAvailable = isMultipartSupportAvailable }); }
private void AddShapefile(IShapeCollection shapes, string title) { this.Presenter.ShapeCollections.Add(new ShapeCollection(shapes, title)); var geometries = shapes.Select(i => i.AsSqlGeometry(0)).ToList(); var vertexes = shapes.ExtractPoints().Select(i => (((Ham.SpatialBase.IPoint)i).AsSqlGeometry(0))).ToList(); this.map.DrawGeometries(geometries, Guid.NewGuid().ToString(), VisualParameters.CreateNew(.7)); this.map.DrawGeometries(vertexes, Guid.NewGuid().ToString(), VisualParameters.CreateNew(.9)); }
public void AddPolyBezierLayer(string name, List <Ham.SpatialBase.Point> bezierPoints, System.Windows.Media.Geometry symbol, VisualParameters decorationVisuals, bool showSymbolOnly) { this.RequestAddPolyBezier?.Invoke(name, bezierPoints, symbol, showSymbolOnly, decorationVisuals); }
public void DrawGeometry(SqlGeometry geometry, string name, VisualParameters parameters) { DrawGeometries(new List <SqlGeometry> { geometry }, name, parameters); }
public void DrawGeometries(List <SqlGeometry> geometry, string name, VisualParameters parameters) { this.RequestAddGeometries?.Invoke(geometry, name, parameters); }
public void DrawGeometryLablePairs(GeometryLabelPairs geometries, string name, VisualParameters parameters, LabelParameters labelParameters) { this.RequestDrawGeometryLablePairs?.Invoke(geometries, name, parameters, labelParameters); }
private async Task <DrawingItem> MakeShapeItem(DrawMode mode, string name) { this.IsPanMode = true; //ResetMode(mode); var drawing = await this.GetDrawingAsync(mode, true); if (drawing == null) { return(null); } var shapeItem = new DrawingItem() { Geometry = drawing }; shapeItem.Title = name; shapeItem.RemoveAction = () => { this.DrawingItems.Remove(shapeItem); this.RemoveLayer(shapeItem.AssociatedLayer); this.Refresh(); }; shapeItem.EditAction = async() => { this.RemoveLayer(shapeItem.AssociatedLayer); var edittedShape = await this.Edit(shapeItem.Geometry, new EditableFeatureLayerOptions() { IsDeleteButtonVisible = true, IsCancelButtonVisible = true, IsFinishButtonVisible = true }); if (edittedShape != null) { shapeItem.Geometry = edittedShape; shapeItem.AssociatedLayer = new VectorLayer(shapeItem.Title, new List <SqlGeometry>() { edittedShape.AsSqlGeometry() }, VisualParameters.GetRandomVisualParameters(), LayerType.VectorLayer, RenderingApproach.Default, RasterizationApproach.DrawingVisual); this.SetLayer(shapeItem.AssociatedLayer); Refresh(); } }; shapeItem.RequestZoomToGeometry = (g) => { this.ZoomToExtent(g.Geometry.GetBoundingBox()); }; shapeItem.RequestDownload = (s) => { //this.OnRequestShowDownloadDialog?.Invoke(s); }; shapeItem.AssociatedLayer = new VectorLayer(shapeItem.Title, new List <SqlGeometry>() { drawing.AsSqlGeometry() }, VisualParameters.GetRandomVisualParameters(), LayerType.VectorLayer, RenderingApproach.Default, RasterizationApproach.DrawingVisual); return(shapeItem); }
protected Task <PolyBezierLayer> GetBezier(System.Windows.Media.Geometry symbol, VisualParameters decorationVisual) { if (RequestGetBezier != null) { return(RequestGetBezier(symbol, decorationVisual)); } else { return(new Task <PolyBezierLayer>(null)); } }
public void ApplyParameters(VisualParameters parameters) { parameters.Apply(_renderers.ToArray()); }