POST
|
Yes this is rubbish by ESRI - they need to re-instate this. Its just not helpful at all.
... View more
10-12-2022
08:43 AM
|
0
|
0
|
521
|
POST
|
If only it were that simple - you just end up screwing up the whole project. There is some dependency conflict going on here - and I've spent far too long trying to find out what's going on here.
... View more
10-10-2022
01:47 AM
|
0
|
0
|
251
|
POST
|
Hi Vidar, there are various options for caching credentials with Pro but not programmatically via the API. Consult the Pro help for more info, but generally speaking, it revolves around the "Sign me in automatically" checkbox on the Pro Sign in popup. https://pro.arcgis.com/en/pro-app/latest/help/projects/sign-in-to-your-organization.htm Also, I believe if the portal is configured for IWA, sign in is automatic regardless (assuming user login and portal login match).
... View more
09-16-2022
07:27 AM
|
0
|
0
|
244
|
POST
|
How do you handle when the token has expired and you have to input the password?
... View more
09-16-2022
01:40 AM
|
0
|
0
|
1198
|
POST
|
Uma's suggestion works only for group layers, if you want a more general way to traverse the layer hierarchy you have to use the Layers collection of the Map class, as suggest by Uma. But when you iterate through the layers you need to look at the real type of the layer object (in essence each class that derives from the Layer class) and if the derived type has a Layers collection you then iterate into that sub layer collection. Below is a sample implementation, however, the implementation is incomplete because it only looks at AnnotationLayers and CompositeLayers as 2nd level entries in the TOC (there are more classes the derive from the Layer class and that have a Layers collection). protected override void OnClick()
{
try
{
var mva = MapView.Active;
if (mva == null) return;
var layers = mva.Map.Layers;
StringBuilder sb = new();
GetLayers(layers, sb, "");
MessageBox.Show(sb.ToString());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private static bool GetLayers(ReadOnlyObservableCollection<Layer> layers, StringBuilder sb, string indent)
{
foreach (var layer in layers)
{
var lyrName = layer.Name.Substring(0, Math.Min(40, layer.Name.Length));
sb.AppendLine($@"{indent}{lyrName} {layer.GetType().Name}");
if (layer is AnnotationLayer annoLyr)
{
GetLayers(annoLyr.Layers, sb, indent + " ");
continue;
}
if (layer is CompositeLayer compositeLyr)
{
GetLayers(compositeLyr.Layers, sb, indent + " ");
continue;
}
}
return true;
}
... View more
08-22-2022
06:35 PM
|
1
|
0
|
423
|
POST
|
Hi, Can anyone point me to some example code that does the same behaviour as the Catalog, Portal, Living Atlas. When you hover over an item you get a nice popup floating inline with item which fades in and out. The screenshot below shows what I mean:
... View more
05-06-2022
09:46 AM
|
0
|
0
|
151
|
POST
|
I have an ESRI control, SearchTextBox on my dockpane which I intend to show a suggested list of known authors in autocomplete dropdown that appears underneath the control - this is inbuilt functionality. You have to populate the SuggestionSource with an ObservableCollection of type objects. In my case I am passing a list of strings (after the user types at least 2 letters). I assign my list of strings to ObservableCollection<object> AuthorList which is bound in XAML: <controls:SearchTextBox
x:Name="AuthorTextBox" SuggestionListMax="15"
SuggestionSource="{Binding AuthorList}" ShowMagnifier="False"
InfoText="Author" SearchMode="Manual"
TextChanged="AuthorTextBox_OnTextChanged">
</controls:SearchTextBox> As you can see this works to some extent (see below) - but it does not populate on every key press - it is very intermittent - even if you wait 1 minute! between each key press - sometimes nothing populates, then you can press delete and lose focus and click back, then add some letters and it populates, but it is very erratic in behaviour and this is very frustrating for me. So I am typing "Jones" - and I debug and I can clearly see that the list has been cleared and it is about to accept 15 new entries, however this seems to be ignored. When I go back to the application the control looks like this: Here is my code on the text changed event - it is retrieving a list of 15 authors in sub second speed, it is very fast. private async void AuthorTextBox_OnTextChanged(object sender, TextChangedEventArgs e)
{
if (AuthorTextBox.Text.Length > 2)
{
try
{
UriBuilder uriBuilder = new UriBuilder
{
Scheme = "https",
Host = "localhost",
Path = "service/AuthorBasic/1",
Port = 7269,
Query = $"name={AuthorTextBox.Text}"
};
var response = await CitationSearchVM.Client.GetAsync(uriBuilder.Uri);
if (response.IsSuccessStatusCode == false)
{
Log.Error("FAIL: " + response.StatusCode);
}
else
{
string jsonText = await response.Content.ReadAsStringAsync();
AuthorBasicResponse authorResponse = JsonConvert.DeserializeObject<AuthorBasicResponse>(jsonText);
Module1.CitationSearchVM.AuthorList.Clear();
Module1.CitationSearchVM.AuthorList.AddRange(authorResponse.Authors);
}
}
catch (Exception ex)
{
Log.Error(ex);
}
}
} I don't know whether its some race condition or something I must be subtlety doing wrong. If anyone can help it would be much appreciated.
... View more
05-05-2022
04:08 AM
|
0
|
0
|
364
|
POST
|
I'm bumping this as I still need an answer one way or the other. Just doesn't look very professional to our clients to see the word "Pop-up"
... View more
07-09-2021
01:42 AM
|
0
|
0
|
284
|
POST
|
1. After creating graphics programmatically - the last one created has these adjustment handles left on them - is there anyway to stop this from happening? 2. Also you can see each graphic being made in turn - is there a more elegant way for these to be shown to the user - preferably all at once.
... View more
06-24-2021
06:46 AM
|
0
|
0
|
307
|
POST
|
Overlay graphics that are only adding graphics to the MapView. Overlay graphics is meant to help with Interactive MapView feedback. Like Chris said above you have to use a graphics layer instead. I used this community sample code in the past for copy/paste inheritance: arcgis-pro-sdk-community-samples/Map-Authoring/GraphicsLayers at master · Esri/arcgis-pro-sdk-community-samples (github.com) If you download the 'Practical Dockpane' / '2021 Palm Springs' Dev Summit slides and sample code (Tech Sessions · Esri/arcgis-pro-sdk Wiki (github.com)) you can also look the 'CompReporter' sample that is included. The code creates a graphics layer on the fly and uses it in a layout view (and export).
... View more
06-16-2021
01:27 PM
|
1
|
0
|
1262
|
POST
|
To parse JSON returned by a service with a variable schema you would need to be able to retrieve schema definition to make sense of it. This means that you would need to know what constitutes a coordinate (x/y field names, or x/y/z, or long/lat or geometry type) , you would also need to know which fields are attributes and what type are those attribute fields are (date, number, string, ...). An example for this would be the ArcGIS Rest API. When you query an ArcGIS Rest API's feature service the JSON response would look like this: {
"objectIdFieldName": "<objectIdFieldName>",
"globalIdFieldName": "<globalIdFieldName>",
"geometryType": "<geometryType>", //for feature layers only
"spatialReference": <spatialReference>, //for feature layers only
"hasZ": <true|false>, //added in 10.1
"hasM": <true|false>, //added in 10.1
"fields": [
{"name": "<fieldName1>", "type" : "<fieldType1>", "alias" : "<fieldAlias1>", "length" : "<length1>"},
{"name": "<fieldName2>", "type" : "<fieldType2>", "alias" : "<fieldAlias2>", "length" : "<length2>"}
],
"features": [ //features will include geometry for feature layers only
<feature1>, <feature2>
]
} You can see from this example that the schema proceeds the actual feature data stored in the 'features' array. The first part of the JSON response is not variable and allows you to extract attribute column names and types. In order to parse this type of JSON and then process it you can utilize the C# dynamic type with Newtonsoft (aka Json.Net) as shown here: Querying JSON with dynamic (newtonsoft.com) Since your schema definition (the first part of the JSON response) has a known definition, as for example the fields array, you can now query all features and their attribute values, regardless of the column names coming back in a JSON response.
... View more
06-03-2021
07:30 AM
|
0
|
0
|
4640
|
POST
|
Ideally I want to issue rest requests via C# - and send my geometry along as the input - can that be done? If so do you have any links to docs or example code?
... View more
05-27-2021
03:18 PM
|
0
|
0
|
1199
|
POST
|
How do you query a feature service with many hundreds of points? I want a return a value from a field (let's call in "COUNTRY_NAME") that returns a country name (surprisingly!) for each point, and that's really important. I need a value for each point, 1 for 1. I have tried sending a multipoint query but it breaks (probably URL length). Even when I cut down the amount of points - if it finds values that are the same it seems to coalesce them all into one - very annoying and not useful. Here is a screenshot of what I have done for multipoint queries. Any help or pointers would be much appreciated as I am still finding my way with all this stuff.
... View more
05-27-2021
10:01 AM
|
1
|
0
|
331
|
POST
|
What is the best way to do something like this? I need to wait until a layout templated is loaded before updating some of its elements. *this example will not run since we can't return a Task<> with this call. //add the layout to the project and wait for import to complete Task t = await QueuedTask.Run<Task>(() => Project.Current.ImportItem(theItem, true)); t.Wait;
... View more
05-26-2021
02:14 PM
|
0
|
0
|
5230
|
POST
|
Is there anyone from ESRI who can give an official line on this - at the moment my add-in behaviour is horrible and clunky - I am having to add 10 rasters to my map before I can do my queries which is taking an inordinate amount of time and it looks clunky to the user. Plus I have to clean up and remove the layers after I have queried my rasters. It's just not an acceptable user experience.
... View more
05-05-2021
01:32 AM
|
1
|
0
|
1832
|
Title | Kudos | Posted |
---|---|---|
1 | 12-19-2023 01:36 AM | |
1 | 12-21-2023 04:02 AM | |
1 | 05-27-2021 10:01 AM | |
1 | 05-05-2021 01:32 AM | |
2 | 02-11-2021 08:46 AM |
Online Status |
Offline
|
Date Last Visited |
03-14-2024
04:02 PM
|