POST
|
Could you provide some details on the specific devices you're seeing this behavior on and what your map contains?
... View more
02-11-2019
08:58 AM
|
0
|
1
|
754
|
POST
|
Looking at the sample, it appears the problem you're having is that you're not requesting the ACCESS_FINE_LOCATION permission. First, you need to have this permission included in your manifest. I'm guessing you've already done that in your production app and just overlooked it in your little reproducer app. The part that's easier to miss is that, on Android 6.0 (API 23) and up, you also need to explicitly include logic in your app to request this permission at run-time. Resources on that include: https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/permissions?tabs=windows#runtime-permission-checks-in-android-60 https://developer.android.com/guide/topics/permissions/overview java - Android "gps requires ACCESS_FINE_LOCATION" error, even though my manifest file contains this - Stack Overflow It's definitely NOT intuitive to add that logic, however (at least I don't find it so), so I've taken the liberty of updating your sample with the necessary code and have attached that. The relevant pieces of code are: Implement ActivityCompat.IOnRequestPermissionsCallback in your MainActivity, checking that the response is coming from a location permissions check, and raising a notification for your fragment to handle: /// <summary>
/// Handle the user-specified response from a request for permissions
/// </summary>
public void OnRequestPermissionsResult(int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults)
{
// Check that the response is coming from our request for location permissions
if (requestCode == LocationPermissionsRequestCode && grantResults.Length == 1)
{
// Raise the response received event so subscribers can respond accordingly
LocationPermissionResponseReceived?.Invoke(this, grantResults[0]);
}
}
// Arbitrary number (no greater than 65535) to use in distinguishing the location permissions request from other requests
internal static int LocationPermissionsRequestCode = 32987;
// Event that will be raised when a response to a location permissions request is received
internal event EventHandler<Android.Content.PM.Permission> LocationPermissionResponseReceived; In your fragment, verify that location permission has been granted before enabling location display. If it hasn't been, request it: // Check if location permission has been granted
if (ContextCompat.CheckSelfPermission(this.Context, Android.Manifest.Permission.AccessFineLocation) == Android.Content.PM.Permission.Granted)
{
// Location permission was granted, so go ahead and turn on location display
//// Bug: Enabling the LocationDisplay will cause the app to crash when switching between drawer items
this.mapView.LocationDisplay.IsEnabled = true;
}
else
{
// Location permission has not yet been granted, so request it
// Get the fragment's activity as the specific MainActivity type so we can hook to its LocationPermissionResponseReceived evetn
var mainActivity = (MainActivity)this.Activity;
// Wire up an event handler to listen for when a user response to the request for location permission is received
EventHandler<Android.Content.PM.Permission> locationPermissionResponseReceivedHandler = null;
locationPermissionResponseReceivedHandler = (o, e) =>
{
// Unhook from the event
mainActivity.LocationPermissionResponseReceived -= locationPermissionResponseReceivedHandler;
// If the user-response was to grant the permission, then turn location display on
if (e == Android.Content.PM.Permission.Granted)
{
this.mapView.LocationDisplay.IsEnabled = true;
}
};
// Subscribe to the event that will be raised when the user-response is received.
mainActivity.LocationPermissionResponseReceived += locationPermissionResponseReceivedHandler;
// Issue the permissions request
Android.Support.V4.App.ActivityCompat.RequestPermissions(
this.Activity, // The activity implementing ActivityCompat.IOnRequestPermissionsResultCallback and that will be notified of the user response
new string[] { Android.Manifest.Permission.AccessFineLocation }, // The permissions being requested
MainActivity.LocationPermissionsRequestCode // The arbitrary code that will distinguish this particular request when handling the response
);
} Hope this helps!
... View more
02-01-2019
09:23 AM
|
2
|
2
|
1619
|
POST
|
I've run some automated tests on a Samsung Galaxy Tab A and Samsung Galaxy Tab S4 with 8.1.0, and did not run into any problems. I was also able to run an app with a MapView displaying an ArcGISTiledLayer interactively on a Samsung Galaxy Tab S4 with 8.1.0 and a Samsung Galaxy Tab A with 7.1.1, and likewise did not encounter any issues. I assume you mean the Samsung Galaxy Tab S4 and not the Samsung Galaxy S4, as the latter is not upgradable beyond Lollipop (i.e. Android 5.x). Could you describe the contents of your map? It could be that there's an issue with a particular type of layer, symbol, etc. Or if you could narrow down the issue to something like an app that only displays a map containing a single layer, that would be very helpful in tracking this down.
... View more
01-08-2019
01:06 PM
|
0
|
1
|
3077
|
POST
|
Yes, this is possible using ShapeFileFeatureTable. You can use the AddFeatureAsync (or AddFeaturesAsync) method to add new features, UpdateFeatureAsync (or UpdateFeaturesAsync) to update existing features, or DeleteFeatureAsync (or DeleteFeaturesAsync) to delete existing features. Here's a quick example of adding new features: // Create the shapefile table, specifying the path to the shapefile
var shapefile = new ShapefileFeatureTable(filePath);
// The shapefile must be loaded to perform operations on it
await shapefile.LoadAsync();
// Create the feature, specyfing the new feature's attributes and geometry
var feature = shapefile.CreateFeature(attributes, geometry);
// Add the newly created feature to the shapefile
await shapefile.AddFeatureAsync(feature); And editing existing features: // Create the shapefile table, specifying the path to the shapefile
var shapefile = new ShapefileFeatureTable(filePath);
// The shapefile must be loaded to perform operations on it
await shapefile.LoadAsync();
// Create the feature, specyfing the new feature's attributes and geometry
var feature = shapefile.CreateFeature(attributes, geometry);
// Add the newly created feature to the shapefile
await shapefile.AddFeatureAsync(feature);
// Query the shapefile to retrieve the feature or features to edit. The query
// parameters can specify object IDs, attribute values, search geometries, and more
var queryResult = await shapefile.QueryFeaturesAsync(queryParameters);
// For this example, just get the first feature from the result
var feature = queryResult.First();
// Update the feature's geometry
feature.Geometry = newGeometry;
// Update attribute values. Note that the type of the new value must match the type
// of the attribute field being updated (e.g. string, integer, date/time, etc)
feature.Attributes["SomeStringFieldName"] = "New attribute value!";
feature.Attributes["SomeDateFieldName"] = DateTimeOffset.UtcNow;
// Apply the edits to the shapefile
await shapefile.UpdateFeatureAsync(feature);
Hope this helps.
... View more
08-01-2018
05:52 AM
|
0
|
0
|
662
|
POST
|
Just to be extra sure, can you try this? Uninstall the app from the target device Delete the output folder (bin folder in the project directory by default) Delete the intermediate folder (obj folder in the project directory by default) Rebuild and re-deploy This is just to ensure that the Mono Shared Runtime and Fast Deployment are no longer being used.
... View more
07-31-2018
11:00 AM
|
0
|
1
|
1532
|
POST
|
For the most part, no - most of these options are not exposed on the SceneView's InteractionOptions. You do have the ability to adjust the zoom factor and toggle flick on and off (see here), but toggling zoom, tilt, or other interactions are not available.
... View more
07-20-2018
05:49 AM
|
1
|
2
|
789
|
POST
|
Local Server is only meant to be accessed from the machine on which it is installed (hence the name "local"). For access to similar capabilities over network connections, ArcGIS Server can be used.
... View more
07-20-2018
05:11 AM
|
0
|
1
|
468
|
POST
|
I don't believe there's anything in the Runtime SDK that will do this for you, as the Runtime is part of and primarily integrates with the ArcGIS platform. If it's at all possible for you to leverage the platform to store your data, that's going to provide you with a clear and supported path for storing, viewing, and updating your polylines. Outside of that, it's technically possible to implement your own logic to store this data in a SQL server database using .NET components that exist outside the Runtime, but you'd presumably be on your own in getting that working and troubleshooting issues.
... View more
07-19-2018
06:23 AM
|
0
|
0
|
472
|
POST
|
It looks like the error info is obscuring some of the relevant code in your screenshot. Could you share that snippet? I'm wondering if it's anything to do with how you're going about loading the data from the service. Also, is this data-specific? That is, does the same code work for other services but not this particular one?
... View more
07-19-2018
06:09 AM
|
0
|
1
|
629
|
POST
|
I believe I've found a workaround for this issue. Essentially, it involves listening for the MapView's NavigationCompleted event, then, when fired, forcing completion of the current freehand polygon sketch, replacing the MapView's SketchEditor instance with a new one, and starting a new freehand polygon sketch with the completed sketch's Geometry. I've attached a sample that encapsulates this workaround in an extension method to the MapView called SketchFreehandPolygonAsync. That method can be called in place of MapView.SketchEditor.StartAsync. Although stopping and starting the sketch session and replacing the SketchEditor on navigation completion seems a bit heavy-handed, it seemed to work without any notable side effects in the bit of testing I did on an Android and iOS device. Hope this helps.
... View more
07-03-2018
09:04 AM
|
0
|
1
|
1085
|
POST
|
You can use the Renderer.GetSymbol method for this. That requires a GeoElement, which you can create from the feature template's PrototypeAttributes. So the code would be something like: // We need a layer to access the renderer
var featureLayer = new FeatureLayer(
new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/CommercialDamageAssessment/FeatureServer/0"));
// The layer needs to be loaded to make its metadata accessible
await featureLayer.LoadAsync();
// With this particular service, the feature templates are enclosed in feature types,
// so get the feature type first. Some services have the feature templates available
// directly off of the layer info.
var featureType =
((ServiceFeatureTable)featureLayer.FeatureTable).LayerInfo.FeatureTypes.First();
// Get the feature template
var featureTemplate = featureType.Templates.First();
// Create a graphic with the feature template's attributes
var prototypeGraphic = new Graphic(featureTemplate.PrototypeAttributes);
// Use the graphic to get the symbol from the renderer
var featureTemplateSymbol = featureLayer.Renderer.GetSymbol(prototypeGraphic); Hope this helps.
... View more
05-04-2018
05:34 AM
|
0
|
1
|
613
|
POST
|
We had run into this issue and addressed it way back during the Xamarin private beta. Unfortunately, it seems to have resurfaced - or perhaps it was never resolved for all cases. If you could share your reproducer, that would be useful - rzwaap@esri.com.
... View more
05-01-2018
03:41 PM
|
0
|
2
|
1221
|
POST
|
Thanks for letting us know that the LoadLibrary call fails for you on newer versions of Android. I suspect that will fail on Android 7 and up due to restrictions that were introduce in the loading of 3rd party libraries at run-time. Also, I would expect that disabling "Shared Runtime" and "Fast Deployment" on Android versions prior to 8.0 is not necessary. At least, I've not seen a problem with that at earlier versions.
... View more
04-25-2018
11:38 AM
|
0
|
0
|
1532
|
Title | Kudos | Posted |
---|---|---|
1 | 05-15-2017 06:50 PM | |
1 | 09-11-2017 06:05 AM | |
1 | 04-26-2017 08:23 AM | |
1 | 07-27-2017 06:44 AM | |
3 | 06-09-2017 12:11 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|