void Apply_Colors() { // find the Radiation Devices feature layer FeatureLayer featureLayer = MobileApplication.Current.Project.FindFeatureLayer("Dose Rates"); // get the current team that is using the application string whereClause = "VALUE_USV < 1"; // creates a new queryfilter and where clause QueryFilter pQFilter = new QueryFilter(); pQFilter.WhereClause = whereClause; // queries the feature layer and selects the rows from the datatable FeatureDataTable fDataTable = featureLayer.GetDataTable(pQFilter); fDataTable = featureLayer.GetDataTable(); //**Missing how to add the selected feature to geometry collection //creates a new symbol with different colors PointPaintOperation ppo = new PointPaintOperation(Color.AliceBlue,2,1,Color.Beige,1,4,PointPaintStyle.Circle); Symbol symbol = new Symbol(ppo as PaintOperation); //**Missing how to add this new color scheme to a graphic layer and render on map }
glSelected = new GraphicLayer(); //create brush for fill System.Windows.Media.SolidColorBrush myBrush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Aqua); // Create a Pen to add to the GeometryDrawing created above. System.Windows.Media.Pen myPen = new System.Windows.Media.Pen(); myPen.Brush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Aquamarine); glSelected.Fill = myBrush; glSelected.DrawingPen = myPen; _map.MapGraphicLayers.Add(glSelected); //.....get geometry glSelected.GeometryBag.Add(m_geometry);
void Apply_Colors2() { // find the Radiation Devices feature layer FeatureLayer featureLayer = MobileApplication.Current.Project.FindFeatureLayer("Dose Rates"); // get the current team that is using the application string whereClause = "VALUE_USV < '1'"; // creates a new queryfilter and where clause QueryFilter pQFilter = new QueryFilter(); pQFilter.WhereClause = whereClause; // queries the feature layer and selects the rows from the datatable FeatureDataTable fDataTable = featureLayer.GetDataTable(pQFilter); fDataTable = featureLayer.GetDataTable(); Feature feature; Geometry geometry; GraphicLayer glSelected = new GraphicLayer(); System.Windows.Media.SolidColorBrush myBrush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Aqua); System.Windows.Media.Pen myPen = new System.Windows.Media.Pen(); myPen.Brush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Aquamarine); glSelected.Fill = myBrush; glSelected.DrawingPen = myPen; using (FeatureDataReader fDataReader = featureLayer.GetDataReader(pQFilter)) { while (fDataReader.Read()) { feature = ?????; geometry = feature.Geometry; glSelected.GeometryBag.Add(geometry); } } ESRI.ArcGIS.Mobile.WPF.Map mMap = MobileApplication.Current.Map; mMap.MapGraphicLayers.Add(glSelected); }
Have you tried:feature = new Feature(fDataReader) geometry = feature.Geometry; orgeometry = fDataReader[fDataReader.GeometryColumnIndex] as GeometrySteve
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.