|
POST
|
I'm developing a mobile product utilizing Esri.ArcGISRuntime.Xamarin.form nuget package and I'm having trouble adding a MapView to a Xamarin.Forms.AbsoluteView container. When I look at the documentation I see the mapview inherits from Xamarin.forms.view however when I go to add this child I'm receiving a message that the view is not what it needs to be. In VS2015 when I follow out the definitions of a mapview it takes me to Android.Views.View. ***************CODE SNIPPET*************** using Esri.ArcGISRuntime; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UI.Controls; using Xamarin.Forms; public class MapControlView : ContentPage { // Create and hold reference to the used MapView private MapView _myMapView = new MapView(); private void CreateLayout() { Xamarin.Forms.AbsoluteLayout simpleLayout = new Xamarin.Forms.AbsoluteLayout { VerticalOptions = LayoutOptions.FillAndExpand }; simpleLayout.Children.Add(_myMapView); // Show the layout in the app this.Content = new StackLayout { Children = {simpleLayout} }; } }
... View more
05-19-2017
08:25 AM
|
0
|
4
|
2399
|
|
POST
|
Quick background. I'm using 10.2.6 Runtime .net and I have a map tip overlay and it is surfaced by a mapviewtapped event. A user will have graphics displayed on the map and as they "tap" the map, a map tip will be launched. Within the map tip I have a text box and button ("More details"). If I use a mouse and click on the button within the map tip, a command will be executed. If I do this on a touch screen and click on the More details button with my finger, the click event wont fire and the map tapped event will fire. I read of a work around for walking the visual tree however I'm wondering if ESRI has a solution to this?
... View more
03-15-2016
01:42 PM
|
0
|
0
|
2299
|
|
POST
|
They do mention in the release notes about Windows 8 not being supported. I too was going to upgrade to 10.2.7 but when I saw this in the release notes, I opted out as I will have clients still running Windows 7 for the time being. https://developers.arcgis.com/net/desktop/guide/release-notes.htm Windows 8.0 is no longer supported as an app development or deployment platform with the 10.2.7 release. For more information please see: Deprecation Plan for ArcGIS
... View more
02-22-2016
08:26 AM
|
0
|
0
|
817
|
|
POST
|
In our applicaton (XAML) we have wired up to listen for all unhandled exceptions and if we put our device into airplane mode to simulate loss of network connectivity we are getting several hundred errors messages (see message below) from the map. We have a single base map layer (type of layer is in the subject line) and it appears if we can't hit the service to get the tiles, we throw exceptions. Is there a proper way to handle having a map with an internet map service and loss of connectivity? How we wire up to unhandled exceptions: TaskScheduler.UnobservedTaskException += (s, e) => HandleUnhandledException(e.Exception, "TaskScheduler.UnobservedTaskException"); 1 of the several hundred exceptions that we get (these exceptions are all thrown within a few seconds): 2016-02-19 11:30:21 AM: An unhandled exception occurred of type TaskScheduler.UnobservedTaskException, System.AggregateException: System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'services.arcgisonline.com' at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) --- End of inner exception stack trace --- at Esri.ArcGISRuntime.Http.ArcGISHttpClientHandler.ArcGISClientHandlerInternal.<SendAsync>d__2.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at Esri.ArcGISRuntime.Layers.ArcGISTiledMapServiceLayer.<>c__DisplayClass20.<<GetTileDataAsync>b__1f>d__22.MoveNext() --- End of inner exception stack trace --- ---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'services.arcgisonline.com' at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) --- End of inner exception stack trace --- at Esri.ArcGISRuntime.Http.ArcGISHttpClientHandler.ArcGISClientHandlerInternal.<SendAsync>d__2.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at Esri.ArcGISRuntime.Layers.ArcGISTiledMapServiceLayer.<>c__DisplayClass20.<<GetTileDataAsync>b__1f>d__22.MoveNext() ---> (Inner Exception #0) System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'services.arcgisonline.com' at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) --- End of inner exception stack trace --- at Esri.ArcGISRuntime.Http.ArcGISHttpClientHandler.ArcGISClientHandlerInternal.<SendAsync>d__2.MoveNext()<---
... View more
02-19-2016
12:02 PM
|
0
|
0
|
2588
|
|
POST
|
Thanks for the reply Antti I ended up coming up with a solution last night that seemed to work. I will add my code example below so others can see what I've done. The real issues comes from connecting to an invlaid url and capturing it within a try catch resolved the issue. private bool _alreadyLoadedMap; private async void MdsMapView_OnLoaded(object sender, RoutedEventArgs e) { //this gets triggered every time you leave the map view if (_alreadyLoadedMap) return; if (!string.IsNullOrEmpty(_localArcGisTileLocation)) { if(LoadLocalTilePackage(_localArcGisTileLocation)) { _alreadyLoadedMap = true; return; } } Task<bool> loadBaseMapTask = null; if (!string.IsNullOrEmpty(_onlineArcGisTileUrl)) { loadBaseMapTask = LoadOnlineTilePackage(_onlineArcGisTileUrl); if (!loadBaseMapTask.IsCompleted) { await loadBaseMapTask; } } if ((loadBaseMapTask != null && !loadBaseMapTask.Result) || loadBaseMapTask == null) { LoadDefaultOnlineTilePackage(); } _alreadyLoadedMap = true; } private bool LoadLocalTilePackage(string localTilePackage) { var agsTpkLayer = new ArcGISLocalTiledLayer(localTilePackage) { ID = localTilePackage }; var localTileTask = agsTpkLayer.InitializeAsync(); if (localTileTask.Exception != null) { foreach (var innerException in localTileTask.Exception.InnerExceptions) { FdmLogger.LogError("Trouble loading the local tile package: ", innerException.Message, " ", localTilePackage, " Will attempt to load an online map"); } return false; } else { MdsMapView.Map.Layers.Add(agsTpkLayer); MdsOverviewMapView.Map.Layers.Add(agsTpkLayer); return true; } } private async Task<bool> LoadOnlineTilePackage(string onlineTilePackage) { var tiledUri = new Uri(onlineTilePackage); var agsTiledLayer = new ArcGISTiledMapServiceLayer(tiledUri) { ID = onlineTilePackage }; try { await agsTiledLayer.InitializeAsync(); if (agsTiledLayer.InitializationException != null) { FdmLogger.LogError("Trouble loading the online ArcGISTiledMapServiceLayer: ", agsTiledLayer.InitializationException.Message, " ", onlineTilePackage, " Will attempt to load the default online map"); return false; } else { MdsMapView.Map.Layers.Add(agsTiledLayer); MdsOverviewMapView.Map.Layers.Add(agsTiledLayer); return true; } } catch (Exception ex) { FdmLogger.LogError("Trouble loading the online ArcGISTiledMapServiceLayer: ", ex.Message, " ", onlineTilePackage, " Will attempt to load the default online map"); return false; } }
... View more
02-19-2016
11:53 AM
|
0
|
0
|
806
|
|
POST
|
Hey Everyone I'm in the process of writing an application that allows a user to have a base map displayed one of three ways. 1. The client identifies a local tpk they wish to use 2. The client identifies a URL for an ArcGISTileMapServiceLayer 3. If the two options above fail, we have a defaulted URL identified for loading a ArcGISTileMapServiceLayer. I have proper handling in for dealing if a local TPKs can't be found; however I'm struggling with dealing with a bad URL being passed in. I'm coding for the notion that a client put in a type-o and provide them at worst with a default base map which we have identified. Here is my first function for testing for a local tpk: private bool LoadLocalTilePackage(string localTilePackage) { var agsTpkLayer = new ArcGISLocalTiledLayer(localTilePackage) { ID = localTilePackage }; var localTileTask = agsTpkLayer.InitializeAsync(); if (localTileTask.Exception != null) { foreach (var innerException in localTileTask.Exception.InnerExceptions) { FdmLogger.LogError("Trouble loading the local tile package: ", innerException.Message," ", localTilePackage, " Will attempt to load an online map"); } return false; } else { MdsMapView.Map.Layers.Add(agsTpkLayer); MdsOverviewMapView.Map.Layers.Add(agsTpkLayer); return true; } } Here is one version of the function I have tried so far in dealing with online tpk: private bool LoadOnlineTilePackage(string onlineTilePackage) { var tiledUri = new Uri(onlineTilePackage); var agsTiledLayer = new ArcGISTiledMapServiceLayer(tiledUri) { ID = onlineTilePackage }; var onlineTileTask = agsTiledLayer.InitializeAsync(); //the "Wait" below never comes back!! if (!onlineTileTask.IsCompleted) onlineTileTask.Wait(); if (onlineTileTask.Exception != null) { foreach (var innerException in onlineTileTask.Exception.InnerExceptions) { FdmLogger.LogError("Trouble loading the defined online tile package: ", innerException.Message, " ", onlineTilePackage, " Will attempt to load the default online map"); } return false; } else { MdsMapView.Map.Layers.Add(agsTiledLayer); MdsOverviewMapView.Map.Layers.Add(agsTiledLayer); return true; } } Here is a much more simplified version but the await never waits: private bool LoadDefaultOnlineTilePackage() { var tiledUri = new Uri(_onlineDefaultTilePackage); var agsTiledLayer = new ArcGISTiledMapServiceLayer(tiledUri) { ID = _onlineDefaultTilePackage }; await agsTiledLayer.InitializeAsync(); MdsMapView.Map.Layers.Add(agsTiledLayer); MdsOverviewMapView.Map.Layers.Add(agsTiledLayer); return true; }
... View more
02-18-2016
02:19 PM
|
0
|
2
|
2084
|
|
POST
|
Lol, nope this one is all one me for missing that. Thanks again!
... View more
01-25-2016
07:27 AM
|
0
|
0
|
1446
|
|
POST
|
Thanks again for the timely response. I will field test today and I missed the fact that when I panned the map myself that the navigation mode changed to off. Maybe we can update the documentation to reflect that if the map is panned the mode changes.... or I somehow missed reading that too.
... View more
01-25-2016
06:40 AM
|
0
|
2
|
1446
|
|
POST
|
Afternoon (Antti ) I have made my custom LocationProvider created and am streaming data onto the map through the LocationDisplay. I love how the default symbol looks and it appears a heading arrow resides inside the circle (very cool!!). I do have a question about the LocationDisplay.AutoPanMode = AutoPanMode.Navigation / Default / Off. After reading documentation I see that the Navigation will change the map's heading as a feed comes in and has the point located dead center and about 2/3 down the map. I haven't field tested yet but I'm hoping the point will remain static and the map will move towards the point (similar to what we see in car navigation systems)? The most immediate question I do have is when the AutoPanMode is set to either Nav or Default, I'm able to pan the map where the GPS is not visible; however the map never re-centers when the next gps event is fired. I would assume when the mode is set to anything but off, the point will remain within the map's extent? A final question in regards to the autopan, when I developed our existing mobile solution in ArcGIS Engine, I needed to manage an invisible interior border (IEnvelope)so it could detect if the GPS point has gone outside the box and would call a re-center command. This interior border was used to help from keeping the GPS point from getting to close to the map edge ensuring the navigator could always keep seeing what was ahead of them. Does the Navigation mode handle keeping the GPS from getting to close to the map borders edge?
... View more
01-21-2016
12:28 PM
|
0
|
4
|
3531
|
|
POST
|
Thanks, I believe I know what I need to do. Continue to use my 3rd party GPS dll and create a custom ILocationProvider. Thanks Jim
... View more
01-20-2016
07:16 AM
|
0
|
0
|
1807
|
|
POST
|
I've been searching the net and can't find any clear topics on how to make a laptop location aware from an external GPS puck (software). If I take a Garmin USB puck (as an example) and hook it to my laptop, is there any documentation on how to make the operating system aware that location data is available and to consume it?
... View more
01-20-2016
06:32 AM
|
0
|
2
|
1807
|
|
POST
|
Hi Everyone Two questions here. I'm just wiring up our runtime map to display a gps location and I'm wondering if there are benefits to using either of these items. Yes I know one immediate benefit to LocationDisplay is the direct link to the map and very little work required. When I look at the .Net Watcher, it has some properties of interest (DesiredAccuracy and MovementThreshold). I would assume ESRI would piggy back off this seeing it takes a .net LocationProvider; however there properties are not accessible. Second question is in regards to the device itself and being connected to a GPS hardware (external modem...). When using either of these objects above, can someone help educate me on how to make the device aware it is connected to a GPS source and is location aware? For internal testing I use a Garmin puck (with USB) and Franson GpsGate to get a virtual com port. Our older ArcEngine map used a 3rd party software to listen to a specified com port with a defined baud rate to understand the incoming signal and fire off a position changed event. If these questions seem to simple or obvious, my appologies, the Runtime world still feels new as I've lived in ArcGIS Engine for 10 years. Cheers, Jim
... View more
01-19-2016
12:23 PM
|
0
|
4
|
4605
|
|
POST
|
Hey Antti I resolved the issue! 10.2.5 seems to have an issue with displaying graphics (add, removing...). I tested my code from Friday on another development machine running just 10.2.5 .Net Runtime and the code didn't work as expected. My main development machine has 10.2.6 installed but my project was referencing a copy of the 10.2.5 and it didn't work. When I changed both machines to 10.2.6 and ran code as it was on Friday, it worked without issue. Thanks for the different ideas on how to handle things but the culprit appears to be 10.2.5. Cheers, Jim
... View more
01-18-2016
10:56 AM
|
0
|
1
|
2132
|
|
POST
|
Thanks Antti for all the quick replies! I'm still uncertain on why the map isn't getting word that the collection of graphics is changing; however, I'm going to make some code alteration so I can move forward. I will keep 3 private Graphic objects around and just manipulate them and not worrying about removing or adding them. I'll zero out their geometries when I don't need them or make the graphic invisible. It would be nice to just add or remove graphics as needed but in the short term I will try a more simplified approach.
... View more
01-18-2016
08:45 AM
|
0
|
3
|
2132
|
|
POST
|
Below is a picture showing the renderer is working; however it is with a combination of setviews and graphic adding will things magically appear. No removing of graphics is being called at this moment. RedPin - Current Incident BluePin - GPS location GreenPin - Active Incidents
... View more
01-18-2016
07:54 AM
|
0
|
6
|
2132
|
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|