|
POST
|
Use GraphicsOverlayCollection instead of ObservableCollection<GraphicsOverlay>
... View more
11-01-2018
12:56 PM
|
0
|
0
|
2806
|
|
POST
|
The behavior as described is exactly what I see. I had a WebMap with labeling defined in the WebMap but not on the service. When I load the WebMap in Runtime (100.4) no labels appear. I just went back and added labels into the Map in Pro and republished the service, the labels now show-up. Even if the labels are turned off in the WebMap it honors the labeling defined on the service. Thanks -Joe
... View more
10-24-2018
10:39 AM
|
0
|
0
|
1845
|
|
POST
|
Just noticed the WebMap labels are ignored. Seems a pretty big deficiency to me. It gives you no way to have different label configurations if they need to be done at the service level
... View more
10-24-2018
10:24 AM
|
0
|
0
|
1845
|
|
POST
|
A different question related to custom LocationDataSource. I have a DataSource that receives data from a Bluetooth source. It all seems to work as expected except for one critical aspect, when UpdateLocation is called it does not seem to actually fire LocationChanged. I have other DataSources which work in basically the same manner and the event is being fired as expected, however, in this one case nothing happens the event handler never receives anything and you never see the location on the map Any thoughts? Thanks -Joe
... View more
10-22-2018
11:49 AM
|
0
|
1
|
2076
|
|
POST
|
Racking my brain on this an hoping someone has some insight. I am using a custom LocationDataSource developed to use with specific GPS units. When the custom LocationDataSource is attached to the MapView.LocationDisplay.DataSource the symbol is grey instead of the blue symbol that should be shown. I cannot figure out why this is. I have looked at the symbol definitions for the symbols on the LocationDisplay and they look the same in both cases. CustomLocationDataSource SystemLocationDataSource I have gone so far as to reload the symbols after copying the ones defined by the LocationDisplay when it uses the SystemLocationDataSource, including loading the image stored in the API resources. Nothing I do seems to get me the blue symbol. What am I missing? Thanks -Joe
... View more
10-21-2018
12:06 PM
|
0
|
5
|
2373
|
|
POST
|
Are there any samples of MultilayerSymbol json files. All help really seems to indicate is that you can only load these from json, but not seeing any sample of what this json would like like and how to compose. Thanks -Joe
... View more
10-19-2018
11:33 AM
|
0
|
9
|
4603
|
|
POST
|
This does work if I get rid of IWA and just use portal authentication. But I cannot believe we cannot query a FeatureLayer in python if using IWA.
... View more
10-18-2018
04:10 PM
|
0
|
1
|
2486
|
|
POST
|
Are you aware if this offline area functionality will be added to ArcGIS Enterprise anytime soon?
... View more
10-18-2018
04:08 PM
|
0
|
0
|
2286
|
|
POST
|
I am trying to query a FeatureLayer. I can connect to the GIS (using IWA), I validate the connection by checking the User, so I know the GIS object is valid. Create a FeatureLayer object using a valid Url (the FeatureLayer object is created). But when I run query I get RuntimeError: Token Required (Error Code: 499). See full stack trace below. Pretty simple code gis = GIS(portal, '', '') # IWA
# get the webmap to use offline
offline_map_item = gis.content.get(webmap)
offline_webmap = WebMap(offline_map_item)
featureLayer = FeatureLayer(projects_url, gis)
features = featureLayer.query() The issue is I see no way you would pass a token to this method. I passed the GIS object when initializing the FeatureLayer and the server is federated so I would think this passes the required tokens. Can some please help explain how I should be passing a token to this method from an IWA configured portal to a federated server in this call. Thanks -Joe Stack trace: RuntimeError Traceback (most recent call last)
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in _hydrate(self)
7577
-> 7578 self._refresh()
7579
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in _refresh(self)
7544 else:
-> 7545 dictdata = self._con.post(self.url, params, token=self._lazy_token)
7546
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\connection.py in post(self, path, postdata, files, ssl, compress, is_retry, use_ordered_dict, add_token, verify_cert, token, try_json, out_folder, file_name, force_bytes, add_headers)
1155
-> 1156 self._handle_json_error(resp_json['error'], errorcode)
1157 return None
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\connection.py in _handle_json_error(self, error, errorcode)
1176 errormessage = errormessage + "\n(Error Code: " + str(errorcode) +")"
-> 1177 raise RuntimeError(errormessage)
1178
RuntimeError: Token Required
(Error Code: 499)
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last)
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in _hydrate(self)
7586 self._lazy_token = None
-> 7587 self._refresh()
7588
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in _refresh(self)
7544 else:
-> 7545 dictdata = self._con.post(self.url, params, token=self._lazy_token)
7546
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\connection.py in post(self, path, postdata, files, ssl, compress, is_retry, use_ordered_dict, add_token, verify_cert, token, try_json, out_folder, file_name, force_bytes, add_headers)
1155
-> 1156 self._handle_json_error(resp_json['error'], errorcode)
1157 return None
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\connection.py in _handle_json_error(self, error, errorcode)
1176 errormessage = errormessage + "\n(Error Code: " + str(errorcode) +")"
-> 1177 raise RuntimeError(errormessage)
1178
RuntimeError: Token Required
(Error Code: 499)
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last)
<ipython-input-12-554803401d1a> in <module>
2
3 featureLayer = FeatureLayer(projects_url, gis)
----> 4 features = featureLayer.query()
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\layer.py in query(self, where, out_fields, time_filter, geometry_filter, return_geometry, return_count_only, return_ids_only, return_distinct_values, return_extent_only, group_by_fields_for_statistics, statistic_filter, result_offset, result_record_count, object_ids, distance, units, max_allowable_offset, out_sr, geometry_precision, gdb_version, order_by_fields, out_statistics, return_z, return_m, multipatch_option, quantization_parameters, return_centroid, return_all_records, result_type, historic_moment, sql_format, return_true_curves, return_exceeded_limit_features, **kwargs)
567
568 params['returnCountOnly'] = True
--> 569 record_count = self._query(url, params)
570 if 'maxRecordCount' in self.properties:
571 max_records = self.properties['maxRecordCount']
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\layer.py in _query(self, url, params)
1194 """ returns results of query """
1195 result = self._con.post(path=url,
-> 1196 postdata=params, token=self._token)
1197 if 'error' in result:
1198 raise ValueError(result)
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in _token(self)
7606 return self._lazy_token
7607 else:
-> 7608 self._hydrate()
7609 return self._lazy_token
7610
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in _hydrate(self)
7594 # try token in the provided gis
7595 self._lazy_token = self._con.token
-> 7596 self._refresh()
7597
7598 if err is not None:
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in _refresh(self)
7543 dictdata = self._con.get(self.url, params, token=self._lazy_token)
7544 else:
-> 7545 dictdata = self._con.post(self.url, params, token=self._lazy_token)
7546
7547 self._lazy_properties = PropertyMap(dictdata)
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\connection.py in post(self, path, postdata, files, ssl, compress, is_retry, use_ordered_dict, add_token, verify_cert, token, try_json, out_folder, file_name, force_bytes, add_headers)
1154 verify_cert=verify_cert, is_retry=True)
1155
-> 1156 self._handle_json_error(resp_json['error'], errorcode)
1157 return None
1158
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\connection.py in _handle_json_error(self, error, errorcode)
1175
1176 errormessage = errormessage + "\n(Error Code: " + str(errorcode) +")"
-> 1177 raise RuntimeError(errormessage)
1178
1179 class _StrictURLopener(request.FancyURLopener):
RuntimeError: Token Required
(Error Code: 499)
... View more
10-18-2018
09:47 AM
|
0
|
4
|
3259
|
|
POST
|
Clearing my cache as suggested by Adrien Hafner worked for me
... View more
10-11-2018
10:10 AM
|
1
|
0
|
5192
|
|
POST
|
I have a replica that I have tried to generate multiple times. It always returns this error when trying to open var gdb = await Geodatabase.OpenAsync(file.FullName); The only thing I can think of different from all the other successful offline replicas I have used is that this contains features in a geometric network. Is it not possible to load features from a geometric network?
... View more
09-07-2018
08:26 AM
|
0
|
4
|
3037
|
|
POST
|
Not sure if the Runtime team will like this approach, but the .geodatabase is just a SqLite database. If you just need to get the values to populate a list you could use the System.Data.SQLite API. I'm sure it will be a LOT faster than trying to query the table and find the values. Something along these lines string connectioString = $"Data Source={filename}";
using (SQLiteConnection connection = new SQLiteConnection(connectioString))
{
connection.Open();
string query = "Select Distinct(fieldname)from thetable";
SQLiteCommand command = new SQLiteCommand(query, connection);
var reader = command.ExecuteReader();
while ( reader.Read() )
{
uniqueValuesList.Add(reader[fieldname].ToString()});
}
} We do some direct queries of the table to get information about the replica in the GDB_Items table. We do these queries before the table is open in the map so I am not sure if there would be an issue if you were doing when the .geodatabases where loaded into the map
... View more
08-29-2018
12:38 PM
|
0
|
1
|
2475
|
|
POST
|
I know this discussion is old and maybe has been beaten like the proverbial dead horse, however, as we are making some large scale changes to our application I thought I would revisit the architecture of how identify is being done. First to explain our application architecture, we are using a module application built on top of the prism framework. Unity is used as a DI framework. Modules are discovered at run time so different application configurations can be deployed based on what modules are present on a system. While it is not required to use this approach, some MVVM framework that provides robust event aggregation is required. Something like MVVM Light would also fit the bill. I don't really understand trying to build a large scale application using MVVM without a good framework to support better command and event patterns. I will also continue to argue that the MapView does need to be exposed (and also that the provided sample is in actuality doing just that). One place dependent on this is the Table of Contents control. Because this is binds to the MapView and is in its own module there has to be a way to expose the MapView to the rest of the application or at minimum outside of the UserControl containing the MapView. All that said...As was pointed out and shown in the example the Controller approach is a really nice clean way to expose the MapView. This basically uses the same approach as in the example except it just is used to expose the MapView. So as in the example, but with a little renaming. public class MapViewExtensions : DependencyObject
{
/// <summary>
/// Creates a MapViewController property
/// </summary>
public static readonly DependencyProperty MapViewControllerProperty = DependencyProperty.RegisterAttached(
nameof(MapViewController),
typeof(MapViewController),
typeof(MapViewExtensions),
new PropertyMetadata(null, OnMapViewControllerChanged));
/// <summary>
/// Invoked when the MapViewController's value has changed
/// </summary>
private static void OnMapViewControllerChanged(DependencyObject dependency, DependencyPropertyChangedEventArgs args)
{
if (args.NewValue is MapViewController)
{
((MapViewController)args.NewValue).MapView = dependency as MapView;
}
}
/// <summary>
/// MapViewController getter method
/// </summary>
public static MapViewController GetMapViewController(DependencyObject d)
{
return (d as MapView)?.GetValue(MapViewControllerProperty) as MapViewController;
}
/// <summary>
/// MapViewController setter method
/// </summary>
public static void SetMapViewController(DependencyObject d, MapViewController value)
{
(d as MapView)?.SetValue(MapViewControllerProperty, value);
}
} And the simplified controller public class MapViewController : DependencyObject
{
/// <summary>
/// Gets or sets the MapView on which to perform identify operations
/// </summary>
public virtual MapView MapView { get; set; }
} This gets to the fun part. Identify is done using a TriggerAction which can then be attached to the MapView. Also something to note is that our application identifies all the layers in the map, not just a single or multiple pre-defined layer . Here is where the EventAggregator comes in, this is set as a DependencyProperty so it can be bound from the ViewModel. The Map is also bound to the TriggerAction. /// <summary>
/// Custom action fired on GeoviewTappedEvent. Either bind a Layer collection
/// of Layers to be identified or bind Map if want to identify all visible layers
/// </summary>
public class IndentifyAction : TriggerAction<MapView>
{
private bool _doubleTapped = false;
protected override async void Invoke(object parameter)
{
await Task.Delay(250);
if ( _doubleTapped )
{
_doubleTapped = false;
return;
}
if (!(AssociatedObject is MapView mapView)) return;
if (!(parameter is GeoViewInputEventArgs args)) return;
double tolerance = 10d;
if ( Map != null )
{
var identifyLayerResults = new List<IdentifyLayerResult>();
Mouse.OverrideCursor = Cursors.Wait;
for (int i = Map.OperationalLayers.Count - 1; i >= 0; i--)
{
FeatureLayer mapLayer = Map.OperationalLayers[i] as FeatureLayer;
if (mapLayer?.PopupDefinition == null || mapLayer.IsVisible == false ) continue;
if ( mapLayer.FeatureTable.TableName == null ) continue;
var result = await mapView.IdentifyLayerAsync(mapLayer, args.Position, tolerance, false, 10);
identifyLayerResults.Add(result);
}
Mouse.OverrideCursor = Cursors.Arrow;
EventAggregator.GetEvent<IdentifyEvent>().Publish(new IdentifyEventArgs(args.Location, identifyLayerResults));
return;
}
if (Layers != null)
{
//TODO
}
}
protected override void OnAttached()
{
base.OnAttached();
if (!(AssociatedObject is MapView mapView)) return;
//This seems silly to me, but a GeoViewDoubleTapped fires both a tapped and a double tapped.
//This indicates was double tapped
mapView.GeoViewDoubleTapped += (s, e) => { _doubleTapped = true; };
}
//Bound Layers to be identified.
public static readonly DependencyProperty LayersProperty = DependencyProperty.Register(
"Layers", typeof(IEnumerable<Layer>), typeof(IndentifyAction), new PropertyMetadata(default(IEnumerable<Layer>)));
public IEnumerable<Layer> Layers
{
get => (IEnumerable<Layer>) GetValue(LayersProperty);
set => SetValue(LayersProperty, value);
}
public static readonly DependencyProperty MapProperty = DependencyProperty.Register(
"Map", typeof(Map), typeof(IndentifyAction), new PropertyMetadata(default(Map)));
public Map Map
{
get => (Map) GetValue(MapProperty);
set => SetValue(MapProperty, value);
}
public static readonly DependencyProperty EventAggregatorProperty = DependencyProperty.Register(
"EventAggregator", typeof(IEventAggregator), typeof(IndentifyAction), new PropertyMetadata(default(IEventAggregator)));
public IEventAggregator EventAggregator
{
get => (IEventAggregator) GetValue(EventAggregatorProperty);
set => SetValue(EventAggregatorProperty, value);
}
} The Xaml for the View containing the MapView looks like this. <Grid>
<esri:MapView x:Name="MapView" Map="{Binding Map}"
framework:MapViewExtensions.MapViewController="{Binding MapViewController}">
<esri:MapView.Resources>
<Style TargetType="esri:Callout">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{DynamicResource ApplicationBackgroundColorLight}"/>
<Setter Property="Padding" Value="0"/>
</Style>
</esri:MapView.Resources>
<i:Interaction.Triggers>
<i:EventTrigger EventName="GeoViewTapped">
<identify:IndentifyAction Map="{Binding Map}" EventAggregator="{Binding EventAggregator}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</esri:MapView>
</Grid> That pretty much does the trick. At this point all that is needed is someone to listen for the event and show a popup if desired. There is one kind of annoying thing I did do and that is use the wait cursor. This is not needed and because this is async method if there is not a listener the identify just happens on a background thread and the user is none the wiser. That does need some reconsideration. There is now a module specific to identify. It has the Controller injected through the constructor public PopupViewModel(MapViewController controller)
{
PopupPages = new ObservableCollection<PopupPage>();
_controller = controller;
Height = 200;
Width = 370;
} Subscribe to the event EventAggregator.GetEvent<IdentifyEvent>().Subscribe(OnIdentify); And respond to the event private void OnIdentify(IdentifyEventArgs args)
{
PopupPages.Clear();
PopupPageCount = 0;
CurrentFeatures.Clear();
//How to be MVVM and still have a custom popup? Not sure this fits the bill...
//Stuff my popup view in a hidden region
UIElement popupView = (UIElement)RegionManager.Regions[RegionNames.PopupRegion].Views.FirstOrDefault();
Location = args.Location;
if ( popupView == null ) return;
foreach (var featureLayerResult in args.IdentifyLayerLayerResults)
{
foreach (var feature in featureLayerResult.GeoElements.OfType<Feature>())
{
if ( featureLayerResult.LayerContent is FeatureLayer featureLayer )
{
AddPopupPage(feature, featureLayer);
}
}
}
_controller.MapView.ShowCalloutAt(Location, popupView);
} And here one could say the MVVM is blown-up. A custom control is used for the popup and this view does come into the ViewModel in order to be shown. If a standard CalloutDefinition was used this would not be required. In the back recesses of my mind I am trying to come up with a way you could do this with Navigation but that will take a lot more to figure out.
... View more
08-24-2018
09:27 AM
|
1
|
1
|
3878
|
|
POST
|
You would need to start by installing the setup project extension Microsoft Visual Studio 2015 Installer Projects - Visual Studio Marketplace At that point I think you would just need to include the ArcGISRuntime100.3 folder in your application folder where the project output is being installed.
... View more
08-16-2018
05:53 AM
|
0
|
3
|
2171
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-11-2026 09:07 AM | |
| 1 | 10-23-2025 12:16 PM | |
| 1 | 10-19-2022 01:08 PM | |
| 1 | 09-03-2025 09:25 AM | |
| 1 | 04-16-2025 12:37 PM |
| Online Status |
Offline
|
| Date Last Visited |
06-23-2026
12:26 PM
|