/// <summary> /// Create a CIMPointGaphic which can be added to the MapView overlay. /// </summary> /// <param name="point">The location for the point (as a CIM point)</param> /// <returns></returns> public CIMPointGraphic MakeCIMPointGraphic(PointN point) { CIMMarker marker = SymbolFactory.ConstructMarker(Red, 10, SimpleMarkerStyle.Star); CIMSymbolLayer[] layers = new CIMSymbolLayer[1]; layers[0] = marker; CIMPointSymbol pointSymbol = new CIMPointSymbol(); pointSymbol.SymbolLayers = layers; pointSymbol.ScaleX = 1; CIMSymbolReference symbolRef = new CIMSymbolReference(); symbolRef.Symbol = pointSymbol; CIMPointGraphic pointGraphic = new CIMPointGraphic(); ArcGIS.Core.Geometry.SpatialReference spatialRef = SpatialReferenceBuilder.CreateSpatialReference(point.SpatialReference.WKID); MapPoint mapPoint = MapPointBuilder.CreateMapPoint(point.X, point.Y, spatialRef); pointGraphic.Location = mapPoint; pointGraphic.Symbol = symbolRef; return(pointGraphic); }
/// <summary> /// Method for applying the selected character to the point feature layer /// </summary> /// <returns></returns> private async Task ApplyFontAsMarker() { var charIndex = 0; charIndex = SelectedCharacter.Character; var fontName = SelectedFontFamily.ToString(); var styleName = SelectedTypeFace.ToString(); if (MapView.Active != null) { GetSelectedPointFeatureLayer(); //the selected point feature layer in the TOC } var cimMarker = SymbolFactory.ConstructMarker(charIndex, fontName, styleName, Size); //creating the marker from the Font selected var pointSymbolFromMarker = SymbolFactory.ConstructPointSymbol(cimMarker); //create a symbol from the marker await SetFeatureLayerSymbolAsync(PointFeatureLayer, pointSymbolFromMarker); if (IsFavorites) { await CreateStyleItem(); if (FontMarkerStyleProjectItem != null && pointSymbolFromMarker != null && !FontMarkerStyleProjectItem.IsReadOnly()) { await AddStyleItemToStyle(FontMarkerStyleProjectItem, pointSymbolFromMarker); //selected marker is added to the FontMarker style } } }
private static void SetupOverlaySymbols() { QueuedTask.Run(() => { var markerCoordPoint = SymbolFactory.ConstructMarker(ColorFactory.GreenRGB, 12, SimpleMarkerStyle.Circle); _pointCoordSymbol = SymbolFactory.ConstructPointSymbol(markerCoordPoint); }); }
/// <summary>Create a linesymbol with circle markers on the ends</summary> internal static Task <CIMLineSymbol> CreateLineSymbolAsync() { return(QueuedTask.Run(() => { var lineStroke = SymbolFactory.ConstructStroke(ColorFactory.RedRGB, 4.0); var marker = SymbolFactory.ConstructMarker(ColorFactory.RedRGB, 12, SimpleMarkerStyle.Circle); marker.MarkerPlacement = new CIMMarkerPlacementOnVertices() { AngleToLine = true, PlaceOnEndPoints = true, Offset = 0 }; return new CIMLineSymbol() { SymbolLayers = new CIMSymbolLayer[2] { marker, lineStroke } }; })); }
/// <summary> /// Method for applying the selected character to the point feature layer /// </summary> /// <returns></returns> private async Task ApplyFontAsMarker() { var charIndex = 0; charIndex = SelectedCharacter.Character; var fontName = SelectedFontFamily.ToString(); var styleName = SelectedTypeFace.ToString(); if (MapView.Active != null) { GetSelectedPointFeatureLayer(); //the selected point feature layer in the TOC } var cimMarker = SymbolFactory.ConstructMarker(charIndex, fontName, styleName, Size); //creating the marker from the Font selected var pointSymbolFromMarker = SymbolFactory.ConstructPointSymbol(cimMarker); //create a symbol from the marker await SetFeatureLayerSymbolAsync(PointFeatureLayer, pointSymbolFromMarker); }