|
POST
|
I would suggest researching into WPF and how one creates a toolbar within XAML and the WPF framework. ArcObjects and ArcGIS Runtime are very different development platforms. You cannot really port an application from ArcObjects to ArcGIS Runtime, they are far too different for that thinking. Making a toolbar in WPF/XAML is actually quite easy and a quick search would provide many samples. Once you understand how the toolbar is designed you can than link the event of clicking the toolbar to execute the desired functionality
... View more
07-18-2017
09:57 AM
|
0
|
0
|
2087
|
|
POST
|
I usually send a WebRequest to the Url and see if I get a response to confirm connectivity prior to calling the method when this is a concern.
... View more
07-14-2017
10:42 AM
|
0
|
3
|
3561
|
|
POST
|
It is a two step process because for some reason when you query for the contents of a group you need the group id not the group name. This will get you the PortalGroup object private async Task<PortalGroup> GroupFromTitle(string groupTitle)
{
PortalQueryParameters parameters = PortalQueryParameters.CreateForGroups("", groupTitle);
PortalQueryResultSet<PortalGroup> groupResultSet = await _portal.FindGroupsAsync(parameters);
PortalGroup offlineGroup = groupResultSet.Results.FirstOrDefault();
return offlineGroup;
} You can pass in the group from above and this will return the items in that group. private async Task LoadItemsFromGroup(PortalGroup portalGroup, PortalItemType itemType)
{
PortalQueryParameters groupParameters = PortalQueryParameters.CreateForItemsOfTypeInGroup(itemType, portalGroup.GroupId);
PortalQueryResultSet<PortalItem> queryResultSet = await portalGroup.Portal.FindItemsAsync(groupParameters);
foreach (var portalItem in queryResultSet.Results)
{
PortalItems.Add(new PortalListItem(portalItem));
}
}
... View more
07-11-2017
12:28 PM
|
3
|
1
|
2535
|
|
POST
|
That would probably be the better approach. But I had no intention of using as a Dictionary/Hash key so took the lazy approach.
... View more
07-11-2017
06:40 AM
|
0
|
0
|
1773
|
|
POST
|
You would have to implement your own IEqualityComparer to define what "Equal" means in this case. Your Assert would then need to be .IsTrue(A.Equals(B, MyComparer). internal class FeatureComparer : IEqualityComparer<Feature>
{
public bool Equals(Feature x, Feature y)
{
try
{
if ( x == null ) return false;
if ( y == null ) return false;
Field xField = x.FeatureTable.Fields.First(f => f.FieldType == FieldType.GlobalID);
Field yField = y.FeatureTable.Fields.First(f => f.FieldType == FieldType.GlobalID);
return x.GetAttributeValue(xField).Equals(y.GetAttributeValue(yField));
}
catch
{
return false;
}
}
public int GetHashCode(Feature obj)
{
return obj.GetHashCode();
}
}
... View more
07-11-2017
06:10 AM
|
1
|
0
|
1773
|
|
POST
|
The location of the overlay relative to the input location is based on the HorizontalAlignment and VerticalAlignment of the UserControl. From your description it seems these are set to Left and Bottom (which I think are default). You would need to have these as bound properties and based on the location that the point is on the screen it would change the Alignment properties.
... View more
07-11-2017
04:47 AM
|
0
|
0
|
1102
|
|
POST
|
Is the issue not knowing how to query a group or not seeing the group event though you are a member? The former would be answered using the method described above, and there are various ways to query groups. I have come across the latter issue which required a Portal reboot. I don't understand why this is, just know it solved the problem. I had groups that I was a member, I could log onto Portal through the browser and see the group and content, however, when I queried from Runtime the groups were not found. After pulling out my hair for a few hours decided to reboot Portal and that fixed the issue.
... View more
07-11-2017
04:35 AM
|
0
|
3
|
2535
|
|
POST
|
As I was doing some group searches I notice some very odd results. If I do a group search by user name and the search string contains a trailing space two of the three groups owned by that user are returned. If I do the same search without the trailing space two of three groups are returned. One group is returned in both searches and the other group returned is different in each search. Obviously, the users name does not have a trailing space in it (users are added from Windows AD). Yes I have confirmed there is no trailing space in the group title, even re-saving to confirm. If someone could explain this I would love to understand why and how I am supposed to actually search correctly. This was discovered because I get really bizarre results when doing group searches from a Runtime application and I wanted to compare to search results in Portal itself. -Joe
... View more
07-06-2017
08:46 AM
|
0
|
0
|
457
|
|
POST
|
My understanding of move (at least with point) is you do not drag. But instead click the new location of the point and then call CompleCommand:Execute(null). At least I have never been able to drag the point, which would certainly be a nice feature. This seems to be how the sample works. Sketch graphics on the map—ArcGIS Runtime SDK for .NET Samples | ArcGIS for Developers
... View more
07-06-2017
06:41 AM
|
0
|
1
|
1794
|
|
POST
|
The former would seem to be the issue. The tile cache is projected into the local reference system used by the company. This is purchased product will have to look into if we can get a copy in 3857. The latter is turned out to be a little more complicated than it would seem. I cannot just set another variable to Map.OperationalLayers because this is just a pointer to the same LayerCollection so calling :Clear clears out the other variable. I ended up this this, which does seem to be working: private void ResetMapProperties(Map map)
{
LayerCollection operationalLayers = new LayerCollection();
Layer[] tempLayers = new Layer[RuntimeControls.MapView.Map.OperationalLayers.Count];
RuntimeControls.MapView.Map.OperationalLayers.CopyTo(tempLayers, 0);
foreach (var operationalLayer in tempLayers)
{
RuntimeControls.MapView.Map.OperationalLayers.Remove(operationalLayer);
operationalLayers.Add(operationalLayer);
}
RuntimeControls.MapView.Map.OperationalLayers.Clear(); //just in case
Envelope extent = RuntimeControls.MapView.VisibleArea.Extent;
map.InitialViewpoint = new Viewpoint(extent);
map.OperationalLayers = operationalLayers;
} This is giving the TOC control in the toolkit some fits and throws an unhandled exceptions in ObservableLayerContentList trying to refresh the list but for now that is a problem for another day. Thanks for the help -joe
... View more
07-05-2017
06:49 AM
|
0
|
1
|
3094
|
|
POST
|
I have been looking through this and while promising the one key I was really hoping for is not resolved: Limitations Advanced symbols are supported only if they are defined in the original service. Any overrides with advanced symbols will result in empty symbols in an offline map. geometries that cross the dateline are not currently supported. If more that one feature layer in a map refers to the same feature service end point only one feature layer will be taken offline. The other feature layers will raise an error. This still seems to be the holy grail of the new replication model. While the new features are nice and would work well in a situation where (1) the service area could be broken out into small areas and (2) the workforce relatively small. I like the idea of being able to download only the schema which could be very useful in situation where the need is for a field inventory that can then be compared to the existing GIS back at the enterprise. Also I think this gives the ability to develop a custom application with a Collector like workflow. However, for our purposes there is a significant flaw and that is that there is not included functionality (that I observed) to register the offline map onto another machine. It seems the workflow is to use the OfflineMapTask to download all the services and then Sync with the OfflineMapSyncTask, which will sync all the layers in the map. This means for every user you need to do a full download of the map and that includes creating the replicas which is a performance nightmare for a large service area that cannot be broken out. Combine that with 500+ users and it really is not a possible deployment workflow. The offline map package does look to basically just be a folder that holds the offline replicas along with some information about WebMap configuration. So, it seems a possible workaround would be to side load the map package and then loop through the services using the existing register replica methods. A downside here is that with a large service area and a number of layers the map package (even zipped) is going to be rather large. Plus you run into the limitation highlighted above that if you want two layers pointing to the same class you need to come up with another method to get those layers setup on the client and included in the map. A goal I have been trying to achieve is to give the user a similar experience both in portal and when disconnected and to have all configuration done in portal. I have written a server tool that offers the similar functionality that is being offered the new classes, while certainly more limited. It loops through through the layers and does a download on each layer and then used the rest API and calls the /data on the item and grabs all the popup configuration and capabilities, etc. This is bundled up and doing a bit of extending JSON.net the configuration can be re hydrated into the popup definition classes and associated to the layers when they load on the client. Using the capabilities property it can be determined which layers are editable on the client. Because I just download each service as it's own autonomous geodatabase, there is no limitation about having multiple layers pointing to the same feature classes as long as they are not in the same service. Granted this does mean we sync the same data multiple times because those duplicated layers are synced individually, however, there is really no way (that I see) around that. Once generated on the server the layers are zipped up and placed in portal. The client downloads, unzips, and calls register so we avoid having to generate a replica for each client and because the replicas are small downloading updates that might result due to a schema change or because something went awry performs well. On the server performance is good because the replication is all done in parallel so it only takes as long as the largest replica to generate and upload the entire map. On the client a similar approach makes even the initial deployment download perform well. Cheers -Joe Michael Branscomb
... View more
07-03-2017
08:01 AM
|
1
|
1
|
1964
|
|
POST
|
I have a situation where we have an offline tile cache used for a basemap for imagery. We also want to be able to use the online streets basemap if connected. This seems straightforward, however, does not work. If I initially load a tiles layer as basemap I am unable to switch the basemap to a basemap that uses service layers and vice-versa. So if I initially load tiles: var tileCache = new TileCache(@"D:\Mobile\Imagery\Layers");
ArcGISTiledLayer imageLayer = new ArcGISTiledLayer(tileCache);
map = new Esri.ArcGISRuntime.Mapping.Map(new Basemap(imageLayer)) { InitialViewpoint = new Viewpoint(extent) }; The offline cache loads correctly. However, when I try to switch the reference to a service based basemap RuntimeControls.MapView.Map.Basemap = Basemap.CreateStreets(); The base map simply disappears (in the above RuntimeControls is used to share the MapView across the application. If instead of the first code block I start with: map = new Esri.ArcGISRuntime.Mapping.Map(Basemap.CreateImageryWithLabelsVector()) { InitialViewpoint = new Viewpoint(extent) }; Switching basemaps in the second block works fine. The opposite behavior is also observed. If I initially start with a Streets layer for basemap, I am unable to switch the basemap to the TileCache. However, when I switch back to the TileCache after the failed attempt to change to streets the basemap is displayed. The only thing that works is to create a new Map instance. The problem with this is the OperationalLayers are lost. I tried a workaround to see if I can recreate the map. Along these lines RuntimeControls.MapView.Map.Basemap = Basemap.CreateStreets();
LayerCollection operationalLayers = RuntimeControls.MapView.Map.OperationalLayers;
Envelope extent = RuntimeControls.MapView.VisibleArea.Extent;
RuntimeControls.MapView.Map = null;
Map map = new Map(Basemap.CreateStreets()) { InitialViewpoint = new Viewpoint(extent) };
foreach (var layer in operationalLayers.OfType<FeatureLayer>())
{
FeatureLayer featureLayer = new FeatureLayer(layer.FeatureTable);
map.OperationalLayers.Add(featureLayer);
} This, though, throws an exception: Esri.ArcGISRuntime.ArcGISRuntimeException was unhandled ErrorCode=24 HResult=-2146233088 Message=Object already owned.: Already owned. Source=Esri.ArcGISRuntime I put the line setting the map to null in there hoping it would release the layer ownership, I even tried to force a garbage collection to see if that would release it, but no luck. Any thoughts? This is a pretty critical aspect to our application users need to be able to see a streets map when they are connected Thanks -Joe
... View more
07-03-2017
06:08 AM
|
0
|
7
|
5076
|
|
POST
|
Hi, I am curious if anyone else sees the same issue. I am unable to generate a replica through the API for any service that is created in ArcGIS Pro. These are feature services which use referenced data (not hosted). The database is archive enabled non-versioned data following the esri suggested approach. I create the service in Pro, go to Server Manager to enable replication and then trying to create the replica via the API fails. Always!. I have seen this behavior on two different AGS/Portal servers and have tried using Pro 2.0. If I use the same exact data and the exact same code but create the Feature Service in ArcMap everything works fine. Replica created and downloaded as expected. I cannot believe this would not have been tested during development, so would love some insight into why I see this issue Thanks -Joe
... View more
06-26-2017
06:18 AM
|
0
|
0
|
1184
|
|
POST
|
Did you ever get this figured out? Take a look at this thread: Map Failed To Download (Thread 2). But to summarize, my experience is the Referenced data services published from ArcGIS Pro (even after going into Server Manager and turning on Sync) will not download. If you publish from ArcMap all works fine
... View more
06-22-2017
03:21 PM
|
0
|
0
|
2976
|
|
POST
|
I have noticed something setting up Web Maps which causes a serious issue in trying to use these maps from a Runtime application. There are two scenarios for publishing a Web Map which should produce identical Web Maps. Prior to setting up the Web Maps all layers are published from ArcGIS Pro as Feature Services to our local Portal I setup maps in ArcGIS Pro adding the layers created earlier from Portal. This map is then published to Portal as a WebMap. I setup a WebMap in Portal using the Map Viewer On the surface the WebMap produced are the same. There is one critical difference, though. The layers in the WebMap produced through Pro are just services (the same layer type you would get using the "Add Service From the Web" approach in Portal) The layers in the map created in Portal are Portal Items. From a Runtime development standpoint this difference makes (for our purposes) the map produced in Pro useless. We need access to the underlying Portal item of the Feature Service to get to properties of the item. In the WebMap produced in Pro there does not seem to be a way to get access to that underlying Portal Item. Why this would be? I added the layers in Pro from Portal, not from services they should be treated as Portal Items. Is there any chance this would be fixed in ArcGIS Pro 2.0? This is a huge issue for us, because it means that we are unable to use Pro as part of our proposed workflow for publishing WebMaps which will result in much greater time spent producing the required Web Maps Michael Branscomb
... View more
06-22-2017
08:03 AM
|
0
|
0
|
848
|
| 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
|