POST
|
Hi, I want to update a Label-Content from values found in a QueuedTask. How can I access the GUI? ArcGISpro 2.9, VS2019, .NET 4.8 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using ArcGIS.Core.Data; using ArcGIS.Desktop.Core; using ArcGIS.Desktop.Framework.Threading.Tasks; using ArcGIS.Desktop.Mapping; using System.Windows.Threading; namespace AttributeValues { /// <summary> /// Interaction logic for ProWindow1.xaml /// </summary> public partial class ProWindow1 : ArcGIS.Desktop.Framework.Controls.ProWindow { public ProWindow1() { InitializeComponent(); } private void Button_1_Click(object sender, RoutedEventArgs e) { var map = MapView.Active?.Map; FeatureLayer layer = map.FindLayers("streets").FirstOrDefault() as FeatureLayer; getNames(layer); } private static async Task getNames(FeatureLayer layer) { QueuedTask.Run(() => { try { string sWhereClause = "42 = 42"; string sPostfixClause = "ORDER BY name"; string sSubFields = "name"; QueryFilter queryFilter = new QueryFilter(); queryFilter.WhereClause = sWhereClause; queryFilter.PostfixClause = sPostfixClause; queryFilter.SubFields = sSubFields; RowCursor rows = layer.Search(queryFilter); while (rows.MoveNext()) { var curRow = rows.Current; string sName = curRow.GetOriginalValue(curRow.FindField("name")).ToString(); // Write sName to Label_1 in ProWindow1 to see the progress!!! // DO SOMETHING WITH THE STREET ... System.Diagnostics.Debug.Print(sName); } // while return true; } // try catch (Exception exc) { System.Windows.MessageBox.Show(exc.Message); return false; } }).Wait(); } } }
... View more
01-16-2024
01:28 AM
|
0
|
2
|
419
|
POST
|
Hi, oView.hitTest works, but throws error: (index):104 [esri.views.2d.layers.FeatureLayerView2D] Error: Connection closed at p.t.invoke ((index):1488) at w.<anonymous> (FeatureLayerView2D.js:31) at Generator.next (<anonymous>) at h ((index):36) at e ((index):40) Any idea? Thanks!
... View more
11-11-2021
04:39 AM
|
0
|
0
|
461
|
POST
|
4.18 does not support MS Edge Legacy, try 4.17 or Chrome
... View more
01-05-2021
06:37 AM
|
0
|
1
|
1144
|
POST
|
How can I set the Position of Attribution (Copyright Text) to the Bottom of the Map?
... View more
09-12-2019
02:23 AM
|
0
|
2
|
665
|
POST
|
Hi, A js-api-script is calling an asynchronous ArcGis-Server-Geoprocessing-Service: gp = new Geoprocessor(<url>/GPServer/..."); gp.submitJob(params, completeCallback, statusCallback, jobFailed); The Geoprocessing-Service executes the Tool "Calculate Value", which contains a Python script. What is the way to send the return-value (String) of the Python-Script back to the completeCallback-Function on Client? gp.getResultData seems to be the wrong way. Or is there any other posibility to get access to the return-value in the js ? Thanks, Chris
... View more
08-14-2017
12:40 AM
|
0
|
0
|
478
|
POST
|
Hi, A js-api-script is calling an asynchronous ArcGis-Server-Geoprocessing-Service: gp = new Geoprocessor(<url>/GPServer/..."); gp.submitJob(params, completeCallback, statusCallback, jobFailed); The Geoprocessing-Service executes the Tool "Calculate Value", which contains a Python script. What is the way to send the return-value (String) of the Python-Script back to the completeCallback-Function on Client? gp.getResultData seems to be the wrong way. Or is there any other posibility to get Access to the return-value in the js ? Thanks, Chris
... View more
08-09-2017
05:31 AM
|
0
|
1
|
1084
|
POST
|
The Problem seemed to be simple: Calculate the difference between two attributes from a Featureclass during runtime, generate Classbreaks from the difference-Attribute and rerender the map. I think I have to look for other Solutions ...
... View more
03-09-2017
06:42 AM
|
0
|
1
|
785
|
POST
|
Thank you for the answer. Example: (app.Layer is a FeatureLayer) //adding a new Field for (feature in app.Layer.graphics) { var attributes = app.Layer.graphics[feature].attributes; attributes["DIFF"] = <someValue>; } Debugging app.Layer.graphics.attributes shows "DIFF" with the contents <someValue> //here creating the ClassBreaksDefinition, GenerateRendererTask //here Comes the error: unable to find classificationField generateRenderer.execute(params, applyRenderer, errorHandler);
... View more
03-09-2017
06:14 AM
|
0
|
1
|
785
|
POST
|
Thanks for the hint. GenerateRendererTask requires a Featurelayer , therefor it's impossible to work with arrays. Now I try to append one Calculation-Field to the Featurelayer to commit this as classificationField.
... View more
03-08-2017
01:18 AM
|
0
|
3
|
785
|
POST
|
var classDef = new ClassBreaksDefinition(); <<< classDef.classificationField = app.currentAttribute; >>> <<< assign an Array here instead of the line before >>> //Known values: natural-breaks | equal-interval | quantile | standard-deviation | geometrical-interval classDef.classificationMethod = "natural-breaks"; classDef.breakCount = 5; classDef.baseSymbol = app.symbol;
... View more
03-01-2017
02:53 AM
|
0
|
7
|
1557
|
Online Status |
Offline
|
Date Last Visited |
03-05-2024
08:04 AM
|