diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index c772b2c43e..cf10642816 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -16,21 +16,16 @@ Summary of the change and any relevant info.
- [ ] WPF .NET 6
- [ ] WPF Framework
- [ ] WinUI
-- [ ] Xamarin.Forms Android
-- [ ] Xamarin.Forms iOS
-- [ ] Xamarin.Forms UWP
-
-- [ ] UWP
-- [ ] Xamarin.Android
-- [ ] Xamarin.iOS
+- [ ] MAUI Windows
+- [ ] MAUI Android
+- [ ] MAUI iOS
## Checklist
+- [ ] Self-review of changes
- [ ] Runs and compiles on all active platforms
-- [ ] Legacy platforms still compile and run (if applicable)
- [ ] Branch is up to date with the latest main/v.next
- [ ] All merge conflicts have been resolved
-- [ ] Self-review of changes
- [ ] There are no warnings related to changes
- [ ] No unrelated changes have been made to any other code or project files
- [ ] `sample_sync.py` runs without making changes
@@ -38,4 +33,4 @@ Summary of the change and any relevant info.
- [ ] Code is commented with correct formatting
- [ ] All variable and method names are good and make sense
- [ ] There is no leftover commented code
-- [ ] Screenshots are correct size and display in description tab
+- [ ] Screenshots are correct size and display in description tab (800 x 600 on Windows, 600 height mobile screenshots for MAUI)
diff --git a/.gitignore b/.gitignore
index b64d8315fb..a25d53c659 100644
--- a/.gitignore
+++ b/.gitignore
@@ -116,7 +116,6 @@ TestResult.xml
project.lock.json
project.fragment.lock.json
artifacts/
-**/Properties/launchSettings.json
*_i.c
*_p.c
*_i.h
diff --git a/README.md b/README.md
index 43416b43e3..d09f09b008 100644
--- a/README.md
+++ b/README.md
@@ -8,12 +8,12 @@
[![Link: NuGet](https://img.shields.io/badge/NuGet-633b9b?style=flat-square&logo=nuget&labelColor=gray)](https://www.nuget.org/profiles/Esri_Inc)
[![Link: Esri Community](https://img.shields.io/badge/🙋-Get%20help%20in%20Esri%20Community-633b9b?style=flat-square)](https://community.esri.com/t5/arcgis-runtime-sdk-for-net/bd-p/arcgis-runtime-sdk-dotnet-questions)
-# ArcGIS Runtime SDK for .NET - Samples
+# ArcGIS Maps SDK for .NET - Samples
-**Interactive samples demonstrate the ArcGIS Runtime API**
+**Interactive samples demonstrate the ArcGIS Maps SDK for .NET API**
## Get started
@@ -23,41 +23,34 @@ If you're on Windows, the easiest way to get started is to download the viewer f
Or, you can browse a searchable list of samples on the ArcGIS for developers website:
-[![Link: Xamarin.Forms](https://img.shields.io/badge/Xamarin.Forms-3498db?style=flat-square&labelColor=gray&logo=Xamarin)](https://developers.arcgis.com/net/forms/sample-code/)
[![Link: WPF](https://img.shields.io/badge/WPF-0078d6?style=flat-square&labelColor=gray&logo=windowsxp)](https://developers.arcgis.com/net/wpf/sample-code/)
[![Link: WinUI](https://img.shields.io/badge/WinUI-0E53BD?style=flat-square&labelColor=gray&logo=windows)](https://developers.arcgis.com/net/winui/sample-code/)
[![Link: UWP](https://img.shields.io/badge/UWP-(Legacy)-202020?style=flat-square&labelColor=gray&logo=windows)](https://developers.arcgis.com/net/uwp/sample-code/)
-[![Link: Xamarin.Android](https://img.shields.io/badge/Xamarin.Android-(Legacy)-202020?style=flat-square&labelColor=gray&logo=android)](https://developers.arcgis.com/net/android/sample-code/)
-[![Link: Xamarin.iOS](https://img.shields.io/badge/Xamarin.iOS-(Legacy)-202020?style=flat-square&labelColor=gray&logo=ios)](https://developers.arcgis.com/net/ios/sample-code/)
-
-> **NOTE**: Samples exist but are no longer being updated for iOS, Android, and UWP. If a sample doesn't exist on your desired platform, you can refer to the implementation on Xamarin.Forms for mobile or WPF for Windows desktop.
+[![Link: .NET MAUI](https://img.shields.io/badge/MAUI-512BD4?style=square&labelColor=gray&logo=dotnet)](https://developers.arcgis.com/net/maui/sample-code/)
### Build the samples locally
If you want to modify or debug sample code, you can clone this repo and load one of the following solutions:
-- All: `src\ArcGISRuntime.Viewers.All.sln`
-- Windows ( WPF / UWP ): `src\ArcGISRuntime.Viewers.Windows.sln`
-- Xamarin (iOS, Android, Forms): `src\ArcGISRuntime.Viewers.Xamarin.sln`
+- All: `src\ArcGIS.Viewers.All.sln`
+- .NET MAUI (iOS, Android): `src\MAUI\ArcGIS.Samples.Maui.sln`
If you are only interested in one platform, you can open a platform-specific solutions:
-- [WPF (.NET Framework)](src/WPF/readme.md): `src\WPF\ArcGISRuntime.WPF.Viewer.NetFramework.sln`
-- [WPF (.NET 6)](src/WPF/readme.md): `src\WPF\ArcGISRuntime.WPF.Viewer.Net.sln`
-- [Xamarin.Forms](src/Forms/readme.md): `src\Windows\ArcGISRuntime.Xamarin.Samples.Forms.sln`
-- [WinUI](src/WinUI/readme.md): `\src\WinUI\ArcGISRuntime.WinUI.Viewer.sln (Preview)`
+- [WPF (.NET Framework)](src/WPF/readme.md): `src\WPF\WPF.Viewer.NetFramework.sln`
+- [WPF (.NET 6)](src/WPF/readme.md): `src\WPF\WPF.Viewer.Net.sln`
+- [.NET MAUI](src/MAUI/readme.md): 'src\MAUI\ArcGIS.Samples.Maui.sln'
+- [WinUI](src/WinUI/readme.md): `\src\WinUI\ArcGIS.WinUI.Viewer.sln (Preview)`
The following platforms are being kept for reference, but no new sample implementations are being added:
-- [UWP](src/UWP/readme.md): `src\Windows\ArcGISRuntime.UWP.Viewer.sln`
-- [Xamarin.Android](src/Android/readme.md): `src\Android\ArcGISRuntime.Xamarin.Samples.Android.sln`
-- [Xamarin.iOS](src/iOS/readme.md): `src\iOS\ArcGISRuntime.Xamari.Samples.iOS.sln`
+- [UWP](src/UWP/readme.md): `src\Windows\ArcGIS.UWP.Viewer.sln`
## Notes
> **IMPORTANT** When you run the samples, you will need to provide an API key. You can get a free developer account and key on the [ArcGIS Developers website](developers.arcgis.com). For more information see https://links.esri.com/arcgis-runtime-security-auth.
-- The .NET sample viewers have a prompt for setting an API key. You can also hardcode your API key in the [`GetLocalKey() method`](https://github.com/Esri/arcgis-runtime-samples-dotnet/tree/main/src/ArcGISRuntime.Samples.Shared/Managers/ApiKeyManager.cs#L89) of the [`ApiKeyManager class`](https://github.com/Esri/arcgis-runtime-samples-dotnet/tree/main/src/ArcGISRuntime.Samples.Shared/Managers/ApiKeyManager.cs).
+- The .NET sample viewers have a prompt for setting an API key. You can also hardcode your API key in the [`GetLocalKey() method`](https://github.com/Esri/arcgis-runtime-samples-dotnet/tree/main/src/ArcGIS.Samples.Shared/Managers/ApiKeyManager.cs#L89) of the [`ApiKeyManager class`](https://github.com/Esri/arcgis-runtime-samples-dotnet/tree/main/src/ArcGIS.Samples.Shared/Managers/ApiKeyManager.cs).
- Before using WinUI, install the [latest Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/) and the [vsix plugin](https://aka.ms/windowsappsdk/stable-vsix-2022-cs).
- When compiling Universal Windows Platform samples, make sure that you are compiling against x86/x64/ARM platform and not using AnyCPU.
@@ -75,7 +68,7 @@ See the [contribution guidelines](https://github.com/Esri/arcgis-runtime-samples
### Requirements
-[Supported system configurations for ArcGIS Runtime API for .NET](https://developers.arcgis.com/net/reference/system-requirements/)
+[Supported system configurations for ArcGIS Maps SDK for .NET](https://developers.arcgis.com/net/reference/system-requirements/)
### Tools
diff --git a/src/Android/ArcGISRuntime.Xamarin.Samples.Android.sln b/src/Android/ArcGISRuntime.Xamarin.Samples.Android.sln
deleted file mode 100644
index 1f199dba6d..0000000000
--- a/src/Android/ArcGISRuntime.Xamarin.Samples.Android.sln
+++ /dev/null
@@ -1,33 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27130.2027
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArcGISRuntime.Xamarin.Samples.Android", "Xamarin.Android\ArcGISRuntime.Xamarin.Samples.Android.csproj", "{BF0E3CEE-E88E-44E0-80CE-46EDA6CD4B54}"
-EndProject
-Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ArcGISRuntime.Samples.Shared", "..\ArcGISRuntime.Samples.Shared\ArcGISRuntime.Samples.Shared.shproj", "{0AD85845-0BA1-4DC9-8C32-E6FD7632E32D}"
-EndProject
-Global
- GlobalSection(SharedMSBuildProjectFiles) = preSolution
- ..\ArcGISRuntime.Samples.Shared\ArcGISRuntime.Samples.Shared.projitems*{0ad85845-0ba1-4dc9-8c32-e6fd7632e32d}*SharedItemsImports = 13
- ..\ArcGISRuntime.Samples.Shared\ArcGISRuntime.Samples.Shared.projitems*{bf0e3cee-e88e-44e0-80ce-46eda6cd4b54}*SharedItemsImports = 4
- EndGlobalSection
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {BF0E3CEE-E88E-44E0-80CE-46EDA6CD4B54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BF0E3CEE-E88E-44E0-80CE-46EDA6CD4B54}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BF0E3CEE-E88E-44E0-80CE-46EDA6CD4B54}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
- {BF0E3CEE-E88E-44E0-80CE-46EDA6CD4B54}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BF0E3CEE-E88E-44E0-80CE-46EDA6CD4B54}.Release|Any CPU.Build.0 = Release|Any CPU
- {BF0E3CEE-E88E-44E0-80CE-46EDA6CD4B54}.Release|Any CPU.Deploy.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {F57C10C5-CCBA-480C-BF8E-3FAF85C0380C}
- EndGlobalSection
-EndGlobal
diff --git a/src/Android/Xamarin.Android/ApiKeyPrompt.cs b/src/Android/Xamarin.Android/ApiKeyPrompt.cs
deleted file mode 100644
index 2393f91b88..0000000000
--- a/src/Android/Xamarin.Android/ApiKeyPrompt.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2021 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Text.Method;
-using Android.Widget;
-using ArcGISRuntime.Samples.Shared.Managers;
-using System;
-using System.Threading.Tasks;
-
-namespace ArcGISRuntime
-{
- [Activity(Label = "ApiKeyPrompt")]
- public class ApiKeyPrompt : Activity
- {
- private Button _setKeyButton;
- private Button _deleteKeyButton;
-
- private TextView _currentKeyText;
- private TextView _statusText;
-
- private EditText _keyEntry;
-
- protected override void OnCreate(Bundle savedInstanceState)
- {
- base.OnCreate(savedInstanceState);
-
- // Setup the UI.
- SetContentView(Resource.Layout.ApiKeyPrompt);
-
- var linkTextView = FindViewById(Resource.Id.ApiKeyInstructions);
- linkTextView.MovementMethod = LinkMovementMethod.Instance;
-
- _setKeyButton = FindViewById(Resource.Id.setKeyButton);
- _deleteKeyButton = FindViewById(Resource.Id.deleteKeyButton);
-
- _setKeyButton.Click += SetKey;
- _deleteKeyButton.Click += DeleteKey;
-
- _currentKeyText = FindViewById(Resource.Id.currentKeyText);
- _statusText = FindViewById(Resource.Id.statusText);
-
- _keyEntry = FindViewById(Resource.Id.keyEntry);
-
- _ = UpdateValidityText();
- }
-
- private async Task UpdateValidityText()
- {
- ApiKeyStatus status = await ApiKeyManager.CheckKeyValidity();
- if (status == ApiKeyStatus.Valid)
- {
- _statusText.Text = "API key is valid";
- }
- else
- {
- _statusText.Text = "API key is invalid";
- }
- _currentKeyText.Text = Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.ApiKey;
- }
-
- private void SetKey(object sender, EventArgs e)
- {
- // Set the developer Api key.
- ApiKeyManager.ArcGISDeveloperApiKey = _keyEntry.Text;
- ApiKeyManager.StoreCurrentKey();
- _ = UpdateValidityText();
- }
-
- private void DeleteKey(object sender, EventArgs e)
- {
- ApiKeyManager.ArcGISDeveloperApiKey = null;
- _currentKeyText.Text = string.Empty;
- ApiKeyManager.StoreCurrentKey();
- _statusText.Text = "API key removed";
- }
-
- protected override void OnDestroy()
- {
- base.OnDestroy();
-
- _setKeyButton.Click -= SetKey;
- _deleteKeyButton.Click -= DeleteKey;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/ArcGISRuntime.Xamarin.Samples.Android.csproj b/src/Android/Xamarin.Android/ArcGISRuntime.Xamarin.Samples.Android.csproj
deleted file mode 100644
index f33e5fd426..0000000000
--- a/src/Android/Xamarin.Android/ArcGISRuntime.Xamarin.Samples.Android.csproj
+++ /dev/null
@@ -1,830 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {BF0E3CEE-E88E-44E0-80CE-46EDA6CD4B54}
- {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Library
- Properties
- ArcGISRuntime
- ArcGISRuntime
- 512
- true
- Resources\Resource.Designer.cs
- Off
- v11.0
- Properties\AndroidManifest.xml
-
-
- None
-
-
-
-
- false
- armeabi-v7a;x86;arm64-v8a
-
-
- true
- full
- false
- ..\..\..\output\android\debug\
- TRACE;DEBUG;XAMARIN
- prompt
- 4
- true
-
- Xamarin
- True
- 7.2
- Xamarin.Android.Net.AndroidClientHandler
- d8
- false
- false
- false
- false
- armeabi-v7a;x86;x86_64;arm64-v8a
-
-
- pdbonly
- true
- ..\..\..\output\android\release\
- TRACE;XAMARIN
- prompt
- 4
- 7.2
- Xamarin.Android.Net.AndroidClientHandler
- true
- d8
- armeabi-v7a;x86;x86_64;arm64-v8a
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MSBuild:UpdateGeneratedFiles
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MSBuild:UpdateGeneratedFiles
- Designer
-
-
-
-
-
-
-
- 100.15.0
-
-
- 100.15.0
-
-
- 100.15.0
-
-
- 100.15.0
-
-
- 2.0.147
-
-
- 0.7.104
-
-
- 2.5.42
-
-
- 28.0.0.3
-
-
- 1.3.0.8
-
-
- 2.0.4.5
-
-
- 1.6.0.3
-
-
- 2.1.1.2
-
-
- 1.0.0.11
-
-
- 1.0.0.10
-
-
- 1.0.0.10
-
-
- 2.3.1.3
-
-
- 1.7.0
-
-
- 1.4.0.4
-
-
- 1.3.6.3
-
-
- 1.4.3
-
-
- 1.3.1.3
-
-
- 1.2.1.3
-
-
- 1.1.1.3
-
-
- 28.0.0.3
-
-
- 28.0.0.3
-
-
- 28.0.0.3
-
-
- 28.0.0.3
-
-
- 28.0.0.3
-
-
-
-
-
-
-
-
- Designer
-
-
-
-
- Designer
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
-
-
-
-
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
-
-
-
-
- Designer
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
- Designer
- MSBuild:UpdateGeneratedFiles
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Assets/AboutAssets.txt b/src/Android/Xamarin.Android/Assets/AboutAssets.txt
deleted file mode 100644
index ee39886295..0000000000
--- a/src/Android/Xamarin.Android/Assets/AboutAssets.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Any raw assets you want to be deployed with your application can be placed in
-this directory (and child directories) and given a Build Action of "AndroidAsset".
-
-These files will be deployed with you package and will be accessible using Android's
-AssetManager, like this:
-
-public class ReadAsset : Activity
-{
- protected override void OnCreate (Bundle bundle)
- {
- base.OnCreate (bundle);
-
- InputStream input = Assets.Open ("my_asset.txt");
- }
-}
-
-Additionally, some Android functions will automatically load asset files:
-
-Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/CategoriesAdapter.cs b/src/Android/Xamarin.Android/CategoriesAdapter.cs
deleted file mode 100644
index 8423e2585b..0000000000
--- a/src/Android/Xamarin.Android/CategoriesAdapter.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.Views;
-using Android.Widget;
-using ArcGISRuntime.Samples.Shared.Models;
-using System.Collections.Generic;
-using Java.Lang;
-
-namespace ArcGISRuntime
-{
- ///
- /// Custom ArrayAdapter to display the list of categories, with samples underneath.
- ///
- internal class CategoriesAdapter : BaseExpandableListAdapter
- {
- private readonly List _items;
- private readonly Activity _context;
-
- public CategoriesAdapter(Activity context, List items)
- {
- _items = items;
- _context = context;
- }
-
- public override Object GetChild(int groupPosition, int childPosition)
- {
- return (Object)_items[groupPosition].Items[childPosition];
- }
-
- public override long GetChildId(int groupPosition, int childPosition)
- {
- return _items[groupPosition].Items[childPosition].GetHashCode();
- }
-
- public override int GetChildrenCount(int groupPosition)
- {
- return _items[groupPosition].Items.Count;
- }
-
- public override Object GetGroup(int groupPosition)
- {
- return (Object)(object)_items[groupPosition];
- }
-
- public override long GetGroupId(int groupPosition)
- {
- return _items[groupPosition].GetHashCode();
- }
-
- public override View GetGroupView(int groupPosition, bool isExpanded, View convertView, ViewGroup parent)
- {
- var view = _context.LayoutInflater.Inflate(Resource.Layout.CategoriesLayout, parent, false);
-
- var name = view.FindViewById(Resource.Id.groupNameTextView);
-
- name.Text = _items[groupPosition].Name;
-
- return view;
- }
-
- public override View GetChildView(int groupPosition, int childPosition, bool isLastChild, View convertView, ViewGroup parent)
- {
- var view = _context.LayoutInflater.Inflate(Resource.Layout.CategoriesLayout, parent, false);
-
- var name = view.FindViewById(Resource.Id.sampleNameTextView);
- SampleInfo sample = (SampleInfo)_items[groupPosition].Items[childPosition];
- name.Text = sample.SampleName;
-
- return view;
- }
-
- public override bool IsChildSelectable(int groupPosition, int childPosition)
- {
- if (_items[groupPosition]?.Items[childPosition] != null)
- {
- return true;
- }
-
- return false;
- }
-
- public override int GroupCount => _items.Count;
- public override bool HasStableIds => true;
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Controls/JoystickSeekBar.cs b/src/Android/Xamarin.Android/Controls/JoystickSeekBar.cs
deleted file mode 100644
index cd04290e49..0000000000
--- a/src/Android/Xamarin.Android/Controls/JoystickSeekBar.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using Android.Content;
-using Android.Util;
-using AndroidX.AppCompat.Widget;
-using ArcGISRuntime;
-using System;
-using System.Timers;
-
-namespace ArcGISRuntimeXamarin.Samples.ARToolkit.Controls
-{
- public class JoystickSeekBar : AppCompatSeekBar
- {
- private const double DefaultMin = 0;
- private const double DefaultMax = 100;
- private const long DefaultDeltaIntervalMillis = 250;
-
- private readonly double _min = DefaultMin;
- private readonly double _max = DefaultMax;
- private double _deltaProgress;
-
- public event EventHandler DeltaProgressChanged;
-
- private readonly Timer _eventTimer = new Timer();
-
- public JoystickSeekBar(Context context) : base(context)
- {
- Progress = (int)(_max * 0.5);
- }
-
- public JoystickSeekBar(Context context, IAttributeSet attrs) : base(context, attrs)
- {
- var attributes = context.Theme.ObtainStyledAttributes(attrs, Resource.Styleable.JoystickSeekBar, 0, 0);
- _min = attributes.GetFloat(Resource.Styleable.JoystickSeekBar_jsb_min, (float)DefaultMin);
- _max = attributes.GetFloat(Resource.Styleable.JoystickSeekBar_jsb_max, (float)DefaultMax);
-
- if (_min > _max)
- {
- throw new AndroidRuntimeException("Attribute jsb_min must be less than attribute jsb_max");
- }
-
- Min = (int)_min;
- Max = (int)_max;
- Progress = (int)(((_max - _min) * 0.5) + _min);
-
- _eventTimer.Elapsed += (o, e) =>
- {
- DeltaProgressChanged?.Invoke(this, new DeltaChangedEventArgs() { DeltaProgress = _deltaProgress });
- };
-
- _eventTimer.Interval = DefaultDeltaIntervalMillis;
-
- ProgressChanged += JoystickSeekBar_ProgressChanged;
- StartTrackingTouch += JoystickSeekBar_StartTrackingTouch;
- StopTrackingTouch += JoystickSeekBar_StopTrackingTouch;
- }
-
- private void JoystickSeekBar_StopTrackingTouch(object sender, StopTrackingTouchEventArgs e)
- {
- _deltaProgress = 0;
- _eventTimer.Stop();
-
- Progress = (int)(((_max - _min) * 0.5) + _min);
- }
-
- private void JoystickSeekBar_StartTrackingTouch(object sender, StartTrackingTouchEventArgs e)
- {
- _eventTimer.Start();
- }
-
- private void JoystickSeekBar_ProgressChanged(object sender, ProgressChangedEventArgs e)
- {
- _deltaProgress = (float)(Math.Pow(this.Progress, 2) / 25 * (this.Progress < 0 ? -1.0 : 1.0));
- }
- }
-
- public class DeltaChangedEventArgs : EventArgs
- {
- public double DeltaProgress;
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Helpers/ArcGISLoginPrompt.cs b/src/Android/Xamarin.Android/Helpers/ArcGISLoginPrompt.cs
deleted file mode 100644
index 1d714f8f53..0000000000
--- a/src/Android/Xamarin.Android/Helpers/ArcGISLoginPrompt.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright 2021 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.Content;
-using Android.Content.PM;
-using Esri.ArcGISRuntime.Security;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using Xamarin.Essentials;
-using OperationCanceledException = System.OperationCanceledException;
-
-namespace ArcGISRuntime.Helpers
-{
- internal static class ArcGISLoginPrompt
- {
- private const string ArcGISOnlineUrl = "https://www.arcgis.com/sharing/rest";
-
- // - The Client ID for an app registered with the server (the ID below is for a public app created by the ArcGIS Runtime team).
- public const string AppClientId = "lgAdHkYZYlwwfAhC";
-
- // - An optional client secret for the app (only needed for the OAuthClientCredentials authorization type).
- private const string ClientSecret = "";
-
- // - A URL for redirecting after a successful authorization (this must be a URL configured with the app).
- private const string OAuthRedirectUrl = "my-ags-app://auth";
-
- public static async Task EnsureAGOLCredentialAsync(Activity activity)
- {
- bool loggedIn = false;
-
- try
- {
- // Create a challenge request for portal credentials (OAuth credential request for arcgis.com)
- CredentialRequestInfo challengeRequest = new CredentialRequestInfo
- {
- // Use the OAuth authorization code workflow.
- GenerateTokenOptions = new GenerateTokenOptions
- {
- TokenAuthenticationType = TokenAuthenticationType.OAuthAuthorizationCode
- },
-
- // Indicate the url (portal) to authenticate with (ArcGIS Online)
- ServiceUri = new Uri(ArcGISOnlineUrl)
- };
-
- // Call GetCredentialAsync on the AuthenticationManager to invoke the challenge handler
- Credential cred = await AuthenticationManager.Current.GetCredentialAsync(challengeRequest, false);
- loggedIn = cred != null;
- }
- catch (OperationCanceledException)
- {
- // OAuth login was canceled, no need to display error to user.
- }
- catch (Exception ex)
- {
- // Login failure
- new AlertDialog.Builder(activity).SetMessage(ex.Message).SetTitle("Error").Show();
- }
-
- return loggedIn;
- }
-
- // ChallengeHandler function that will be called whenever access to a secured resource is attempted
- public static async Task PromptCredentialAsync(CredentialRequestInfo info)
- {
- Credential credential = null;
-
- try
- {
- // IOAuthAuthorizeHandler will challenge the user for OAuth credentials
- credential = await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri);
- }
- catch (OperationCanceledException)
- {
- // OAuth login was canceled, no need to display error to user.
- }
-
- return credential;
- }
-
- public static void SetChallengeHandler()
- {
- // Define the server information for ArcGIS Online
- ServerInfo portalServerInfo = new ServerInfo(new Uri(ArcGISOnlineUrl))
- {
- TokenAuthenticationType = TokenAuthenticationType.OAuthAuthorizationCode,
- OAuthClientInfo = new OAuthClientInfo(AppClientId, new Uri(OAuthRedirectUrl))
- };
-
- // If a client secret has been configured, set the authentication type to OAuth client credentials.
- if (!string.IsNullOrEmpty(ClientSecret))
- {
- // If a client secret is specified then use the TokenAuthenticationType.OAuthClientCredentials type.
- portalServerInfo.TokenAuthenticationType = TokenAuthenticationType.OAuthClientCredentials;
- portalServerInfo.OAuthClientInfo.ClientSecret = ClientSecret;
- }
-
- // Register the ArcGIS Online server information with the AuthenticationManager
- AuthenticationManager.Current.RegisterServer(portalServerInfo);
-
- // Use the OAuthAuthorize class in this project to create a new web view to show the login UI
- AuthenticationManager.Current.OAuthAuthorizeHandler = new OAuthAuthorize();
-
- // Create a new ChallengeHandler that uses a method in this class to challenge for credentials
- AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(PromptCredentialAsync);
- }
- }
-
- public class OAuthAuthorize : IOAuthAuthorizeHandler
- {
- // Use a TaskCompletionSource to track the completion of the authorization.
- private TaskCompletionSource> _taskCompletionSource;
-
- // IOAuthAuthorizeHandler.AuthorizeAsync implementation.
- public async Task> AuthorizeAsync(Uri serviceUri, Uri authorizeUri, Uri callbackUri)
- {
- try
- {
- // Create a task completion source.
- _taskCompletionSource = new TaskCompletionSource>();
-
- try
- {
- var result = await WebAuthenticator.AuthenticateAsync(authorizeUri, callbackUri);
- _taskCompletionSource.SetResult(result.Properties);
- }
- catch (Exception ex)
- {
- _taskCompletionSource.TrySetException(ex);
- }
-
- return await _taskCompletionSource.Task;
- }
- catch (Exception) { }
-
- // Return null if anything goes wrong with authentication.
- return null;
- }
- }
-
- [Activity(NoHistory = true, LaunchMode = LaunchMode.SingleTop)]
- [IntentFilter(new[] { Intent.ActionView },
- Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable },
- DataScheme = "my-ags-app", DataHost = "auth")]
- public class WebAuthenticationCallbackActivity : WebAuthenticatorCallbackActivity
- {
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/MainActivity.cs b/src/Android/Xamarin.Android/MainActivity.cs
deleted file mode 100644
index a6a054e2dd..0000000000
--- a/src/Android/Xamarin.Android/MainActivity.cs
+++ /dev/null
@@ -1,238 +0,0 @@
-// Copyright 2020 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android;
-using Android.App;
-using Android.Content;
-using Android.Content.PM;
-using Android.OS;
-using Android.Widget;
-using AndroidX.Core.Content;
-using ArcGISRuntime.Samples.Managers;
-using ArcGISRuntime.Samples.Shared.Managers;
-using ArcGISRuntime.Samples.Shared.Models;
-using Esri.ArcGISRuntime.Security;
-using Google.AR.Core;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace ArcGISRuntime
-{
- [Activity(Label = "ArcGIS Runtime SDK for .NET", MainLauncher = true, Icon = "@drawable/icon")]
- public class MainActivity : Activity
- {
- private List _sampleCategories;
- private List _filteredSampleCategories;
- private ExpandableListView _categoriesListView;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- // Initialize Xamarin.Essentials for Auth usage.
- Xamarin.Essentials.Platform.Init(this, bundle);
-
- SetContentView(Resource.Layout.CategoriesList);
-
- try
- {
- // Initialize the SampleManager and create the Sample Categories.
- SampleManager.Current.Initialize();
- _sampleCategories = SampleManager.Current.FullTree.Items.OfType().ToList();
-
- _filteredSampleCategories = _sampleCategories;
-
- // Set up the custom ArrayAdapter for displaying the Categories.
- var categoriesAdapter = new CategoriesAdapter(this, _sampleCategories);
- _categoriesListView = FindViewById(Resource.Id.categoriesListView);
- _categoriesListView.SetAdapter(categoriesAdapter);
- _categoriesListView.ChildClick += CategoriesListViewOnChildClick;
- _categoriesListView.DividerHeight = 2;
- _categoriesListView.SetGroupIndicator(null);
-
- // Set up the search filtering.
- SearchView searchBox = FindViewById(Resource.Id.categorySearchView);
- searchBox.QueryTextChange += SearchBoxOnQueryTextChange;
-
- // Add a button that brings up settings.
- Button settingsButton = FindViewById(Resource.Id.settingsButton);
- settingsButton.Click += (s, e) => PromptForKey();
-
- // Check the existing API key for validity.
- _ = CheckApiKey();
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.Message);
- }
- }
-
- private async Task CheckApiKey()
- {
- // Attempt to load a locally stored API key.
- await ApiKeyManager.TrySetLocalKey();
-
- // Check that the current API key is valid.
- ApiKeyStatus status = await ApiKeyManager.CheckKeyValidity();
- if (status != ApiKeyStatus.Valid)
- {
- PromptForKey();
- }
- }
-
- private void PromptForKey()
- {
- // Bring up API Key prompt screen.
- var keyActivity = new Intent(this, typeof(ApiKeyPrompt));
- StartActivity(keyActivity);
- }
-
- protected override void OnResume()
- {
- // Garbage collect when sample is closed.
- GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true, true);
- Java.Lang.JavaSystem.Gc();
- GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true, true);
- Java.Lang.JavaSystem.Gc();
- base.OnResume();
- }
-
- private void SearchBoxOnQueryTextChange(object sender, SearchView.QueryTextChangeEventArgs queryTextChangeEventArgs)
- {
- SearchableTreeNode stnResult = SampleManager.Current.FullTree.Search(sample => SampleManager.Current.SampleSearchFunc(sample, queryTextChangeEventArgs.NewText));
- if (stnResult != null)
- {
- _filteredSampleCategories = stnResult.Items.OfType().ToList();
- }
- else
- {
- _filteredSampleCategories = new List();
- }
-
- _categoriesListView.SetAdapter(new CategoriesAdapter(this, _filteredSampleCategories));
-
- // Expand all entries; makes it easier to see search results.
- for (int index = 0; index < _filteredSampleCategories.Count; index++)
- {
- _categoriesListView.ExpandGroup(index);
- }
- }
-
- private async void CategoriesListViewOnChildClick(object sender, ExpandableListView.ChildClickEventArgs childClickEventArgs)
- {
- var sampleName = string.Empty;
-
- try
- {
- // Call a function to clear existing credentials.
- ClearCredentials();
-
- // Get the clicked item.
- SampleInfo item = (SampleInfo)_filteredSampleCategories[childClickEventArgs.GroupPosition].Items[childClickEventArgs.ChildPosition];
-
- // Check for AR compatiblity.
- if (item.Category == "Augmented reality")
- {
- try
- {
- // Get camera permission, then try to create an AR session.
- await AskForCameraPermission();
- var arSession = new Session(this);
- }
- catch (Exception ex)
- {
- Console.WriteLine($"{ex.GetType().Name} {ex.Message}");
- new AlertDialog.Builder(this).SetMessage(ex.Message).SetTitle("Augmented reality not supported").Show();
- return;
- }
- }
-
- // Download any offline data before showing the sample.
- if (item.OfflineDataItems != null)
- {
- // Show the waiting dialog.
- var builder = new AlertDialog.Builder(this);
- builder.SetView(new ProgressBar(this)
- {
- Indeterminate = true
- });
- builder.SetMessage("Downloading data");
- AlertDialog dialog = builder.Create();
- dialog.Show();
-
- try
- {
- // Begin downloading data.
- await DataManager.EnsureSampleDataPresent(item);
- }
- finally
- {
- // Hide the progress dialog.
- dialog.Dismiss();
- }
- }
-
- // Each sample is an Activity, so locate it and launch it via an Intent.
- var newActivity = new Intent(this, item.SampleType);
-
- // Start the activity.
- StartActivity(newActivity);
- }
- catch (Exception ex)
- {
- AlertDialog.Builder bldr = new AlertDialog.Builder(this);
- var dialog = bldr.Create();
- dialog.SetTitle("Unable to load " + sampleName);
- dialog.SetMessage(ex.Message);
- dialog.Show();
- }
- }
-
- #region Permissions
-
- // Permissions and permission request.
- private const int CameraPermissionRequestCode = 100;
- private TaskCompletionSource _cameraPermissionTCS;
-
- public async Task AskForCameraPermission()
- {
- if (ContextCompat.CheckSelfPermission(this, CameraService) != Permission.Granted)
- {
- _cameraPermissionTCS = new TaskCompletionSource();
- RequestPermissions(new[] { Manifest.Permission.Camera }, CameraPermissionRequestCode);
- return await _cameraPermissionTCS.Task;
- }
- return true;
- }
-
- public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults)
- {
- if (requestCode == CameraPermissionRequestCode)
- {
- _cameraPermissionTCS.TrySetResult(grantResults.Length == 1 && grantResults[0] == Permission.Granted);
- }
- }
-
- #endregion Permissions
-
- private static void ClearCredentials()
- {
- // Clear credentials (if any) from previous sample runs.
- foreach (Credential cred in AuthenticationManager.Current.Credentials)
- {
- AuthenticationManager.Current.RemoveCredential(cred);
- }
-
- // Clear the challenge handler.
- AuthenticationManager.Current.ChallengeHandler = null;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Properties/AndroidManifest.xml b/src/Android/Xamarin.Android/Properties/AndroidManifest.xml
deleted file mode 100644
index c85021d6aa..0000000000
--- a/src/Android/Xamarin.Android/Properties/AndroidManifest.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Properties/AssemblyInfo.cs b/src/Android/Xamarin.Android/Properties/AssemblyInfo.cs
deleted file mode 100644
index fc7813616c..0000000000
--- a/src/Android/Xamarin.Android/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-using Android.App;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("ArcGIS Runtime SDK for .NET Samples Viewer")]
-[assembly: AssemblyDescription("Viewer application to browse ArcGIS Runtime SDK for .NET samples.")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Esri Inc.")]
-[assembly: AssemblyProduct("ArcGIS Runtime SDK for .NET Samples Viewer")]
-[assembly: AssemblyCopyright("Copyright © Esri Inc. 2018")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: ComVisible(false)]
-[assembly: UsesPermission(Android.Manifest.Permission.AccessFineLocation)]
-[assembly: UsesPermission(Android.Manifest.Permission.AccessCoarseLocation)]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/src/Android/Xamarin.Android/Resources/AboutResources.txt b/src/Android/Xamarin.Android/Resources/AboutResources.txt
deleted file mode 100644
index 194ae28a59..0000000000
--- a/src/Android/Xamarin.Android/Resources/AboutResources.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-Images, layout descriptions, binary blobs and string dictionaries can be included
-in your application as resource files. Various Android APIs are designed to
-operate on the resource IDs instead of dealing with images, strings or binary blobs
-directly.
-
-For example, a sample Android app that contains a user interface layout (main.xml),
-an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
-would keep its resources in the "Resources" directory of the application:
-
-Resources/
- drawable-hdpi/
- icon.png
-
- drawable-ldpi/
- icon.png
-
- drawable-mdpi/
- icon.png
-
- layout/
- main.xml
-
- values/
- strings.xml
-
-In order to get the build system to recognize Android resources, set the build action to
-"AndroidResource". The native Android APIs do not operate directly with filenames, but
-instead operate on resource IDs. When you compile an Android application that uses resources,
-the build system will package the resources for distribution and generate a class called
-"Resource" that contains the tokens for each one of the resources included. For example,
-for the above Resources layout, this is what the Resource class would expose:
-
-public class Resource {
- public class drawable {
- public const int icon = 0x123;
- }
-
- public class layout {
- public const int main = 0x456;
- }
-
- public class strings {
- public const int first_string = 0xabc;
- public const int second_string = 0xbcd;
- }
-}
-
-You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
-to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
-string in the dictionary file values/strings.xml.
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/drawable-hdpi/Icon.png b/src/Android/Xamarin.Android/Resources/drawable-hdpi/Icon.png
deleted file mode 100644
index 857bbac7b2..0000000000
Binary files a/src/Android/Xamarin.Android/Resources/drawable-hdpi/Icon.png and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Resources/drawable-mdpi/Icon.png b/src/Android/Xamarin.Android/Resources/drawable-mdpi/Icon.png
deleted file mode 100644
index 34825183bd..0000000000
Binary files a/src/Android/Xamarin.Android/Resources/drawable-mdpi/Icon.png and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Resources/drawable-xhdpi/Icon.png b/src/Android/Xamarin.Android/Resources/drawable-xhdpi/Icon.png
deleted file mode 100644
index 82477f08f2..0000000000
Binary files a/src/Android/Xamarin.Android/Resources/drawable-xhdpi/Icon.png and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Resources/drawable-xxhdpi/Icon.png b/src/Android/Xamarin.Android/Resources/drawable-xxhdpi/Icon.png
deleted file mode 100644
index 292436d165..0000000000
Binary files a/src/Android/Xamarin.Android/Resources/drawable-xxhdpi/Icon.png and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Resources/drawable-xxxhdpi/Icon.png b/src/Android/Xamarin.Android/Resources/drawable-xxxhdpi/Icon.png
deleted file mode 100644
index e981c4d5e1..0000000000
Binary files a/src/Android/Xamarin.Android/Resources/drawable-xxxhdpi/Icon.png and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Resources/drawable/Android_512.png b/src/Android/Xamarin.Android/Resources/drawable/Android_512.png
deleted file mode 100644
index d067de5586..0000000000
Binary files a/src/Android/Xamarin.Android/Resources/drawable/Android_512.png and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Resources/drawable/Icon.png b/src/Android/Xamarin.Android/Resources/drawable/Icon.png
deleted file mode 100644
index 34825183bd..0000000000
Binary files a/src/Android/Xamarin.Android/Resources/drawable/Icon.png and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Resources/layout/Animate3DGraphic.axml b/src/Android/Xamarin.Android/Resources/layout/Animate3DGraphic.axml
deleted file mode 100644
index f861c95328..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/Animate3DGraphic.axml
+++ /dev/null
@@ -1,140 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/AnimateImageOverlay.xml b/src/Android/Xamarin.Android/Resources/layout/AnimateImageOverlay.xml
deleted file mode 100644
index 09e5f678a3..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/AnimateImageOverlay.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/ApiKeyPrompt.xml b/src/Android/Xamarin.Android/Resources/layout/ApiKeyPrompt.xml
deleted file mode 100644
index ec2e956b59..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/ApiKeyPrompt.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/ApplyScheduledUpdates.axml b/src/Android/Xamarin.Android/Resources/layout/ApplyScheduledUpdates.axml
deleted file mode 100644
index e13cf832d2..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/ApplyScheduledUpdates.axml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/Buffer.axml b/src/Android/Xamarin.Android/Resources/layout/Buffer.axml
deleted file mode 100644
index 4912737057..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/Buffer.axml
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/CategoriesLayout.axml b/src/Android/Xamarin.Android/Resources/layout/CategoriesLayout.axml
deleted file mode 100644
index 71635078c1..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/CategoriesLayout.axml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/CategoriesList.axml b/src/Android/Xamarin.Android/Resources/layout/CategoriesList.axml
deleted file mode 100644
index 8ebec7e6ac..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/CategoriesList.axml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/ChooseCameraController.axml b/src/Android/Xamarin.Android/Resources/layout/ChooseCameraController.axml
deleted file mode 100644
index f265890bd1..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/ChooseCameraController.axml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/CollectDataAR.axml b/src/Android/Xamarin.Android/Resources/layout/CollectDataAR.axml
deleted file mode 100644
index b7723d335a..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/CollectDataAR.axml
+++ /dev/null
@@ -1,139 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/ConfigureSubnetworkTrace.axml b/src/Android/Xamarin.Android/Resources/layout/ConfigureSubnetworkTrace.axml
deleted file mode 100644
index d392b358cf..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/ConfigureSubnetworkTrace.axml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/ControlAnnotationSublayerVisibility.axml b/src/Android/Xamarin.Android/Resources/layout/ControlAnnotationSublayerVisibility.axml
deleted file mode 100644
index 3185b028e5..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/ControlAnnotationSublayerVisibility.axml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/CreateAndSaveKmlFile.axml b/src/Android/Xamarin.Android/Resources/layout/CreateAndSaveKmlFile.axml
deleted file mode 100644
index d76f9c7096..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/CreateAndSaveKmlFile.axml
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/DensifyAndGeneralize.axml b/src/Android/Xamarin.Android/Resources/layout/DensifyAndGeneralize.axml
deleted file mode 100644
index 6ff5eb3278..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/DensifyAndGeneralize.axml
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/DisplayGrid.axml b/src/Android/Xamarin.Android/Resources/layout/DisplayGrid.axml
deleted file mode 100644
index 96f65ec8bd..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/DisplayGrid.axml
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/DisplayScenesInTabletopAR.axml b/src/Android/Xamarin.Android/Resources/layout/DisplayScenesInTabletopAR.axml
deleted file mode 100644
index 1695ccb851..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/DisplayScenesInTabletopAR.axml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/DisplaySubtypeFeatureLayer.axml b/src/Android/Xamarin.Android/Resources/layout/DisplaySubtypeFeatureLayer.axml
deleted file mode 100644
index 3c1aefc902..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/DisplaySubtypeFeatureLayer.axml
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/DisplayUtilityAssociations.axml b/src/Android/Xamarin.Android/Resources/layout/DisplayUtilityAssociations.axml
deleted file mode 100644
index 704dbab73e..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/DisplayUtilityAssociations.axml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/DistanceMeasurement.axml b/src/Android/Xamarin.Android/Resources/layout/DistanceMeasurement.axml
deleted file mode 100644
index 5de104f3c2..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/DistanceMeasurement.axml
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/EditAttributeLayout.xml b/src/Android/Xamarin.Android/Resources/layout/EditAttributeLayout.xml
deleted file mode 100644
index 4f574ee8b1..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/EditAttributeLayout.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/EditBranchVersioning.xml b/src/Android/Xamarin.Android/Resources/layout/EditBranchVersioning.xml
deleted file mode 100644
index b51ffdfcbf..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/EditBranchVersioning.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/EditKmlGroundOverlay.axml b/src/Android/Xamarin.Android/Resources/layout/EditKmlGroundOverlay.axml
deleted file mode 100644
index e2ea6d1fdf..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/EditKmlGroundOverlay.axml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/FeatureLayerRenderingModeMapLayout.axml b/src/Android/Xamarin.Android/Resources/layout/FeatureLayerRenderingModeMapLayout.axml
deleted file mode 100644
index 349cd50302..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/FeatureLayerRenderingModeMapLayout.axml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/FeatureLayerRenderingModeScene.axml b/src/Android/Xamarin.Android/Resources/layout/FeatureLayerRenderingModeScene.axml
deleted file mode 100644
index 52789e13b6..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/FeatureLayerRenderingModeScene.axml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/FindFeaturesUtilityNetwork.axml b/src/Android/Xamarin.Android/Resources/layout/FindFeaturesUtilityNetwork.axml
deleted file mode 100644
index a722daed44..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/FindFeaturesUtilityNetwork.axml
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/GeoViewSync.axml b/src/Android/Xamarin.Android/Resources/layout/GeoViewSync.axml
deleted file mode 100644
index 48f880958b..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/GeoViewSync.axml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/GroupedResultsList_DataItem.axml b/src/Android/Xamarin.Android/Resources/layout/GroupedResultsList_DataItem.axml
deleted file mode 100644
index 8db690c2c5..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/GroupedResultsList_DataItem.axml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/GroupedResultsList_GroupItem.axml b/src/Android/Xamarin.Android/Resources/layout/GroupedResultsList_GroupItem.axml
deleted file mode 100644
index 06871e37de..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/GroupedResultsList_GroupItem.axml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/IdentifyKMLFeatures.axml b/src/Android/Xamarin.Android/Resources/layout/IdentifyKMLFeatures.axml
deleted file mode 100644
index 69f6640e97..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/IdentifyKMLFeatures.axml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/ListGeodatabaseVersions.axml b/src/Android/Xamarin.Android/Resources/layout/ListGeodatabaseVersions.axml
deleted file mode 100644
index 7ff7ea9e06..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/ListGeodatabaseVersions.axml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/ListKmlContents.axml b/src/Android/Xamarin.Android/Resources/layout/ListKmlContents.axml
deleted file mode 100644
index 5912bbbad1..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/ListKmlContents.axml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/LocationDrivenGeotriggers.xml b/src/Android/Xamarin.Android/Resources/layout/LocationDrivenGeotriggers.xml
deleted file mode 100644
index b49735c92b..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/LocationDrivenGeotriggers.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/MapImageLayerTables.axml b/src/Android/Xamarin.Android/Resources/layout/MapImageLayerTables.axml
deleted file mode 100644
index 7eaf9e10c6..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/MapImageLayerTables.axml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/NavigateARNavigator.axml b/src/Android/Xamarin.Android/Resources/layout/NavigateARNavigator.axml
deleted file mode 100644
index 1317bc50dd..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/NavigateARNavigator.axml
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/NavigateARRoutePlanner.axml b/src/Android/Xamarin.Android/Resources/layout/NavigateARRoutePlanner.axml
deleted file mode 100644
index 3c4562fc29..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/NavigateARRoutePlanner.axml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/NavigateRoute.axml b/src/Android/Xamarin.Android/Resources/layout/NavigateRoute.axml
deleted file mode 100644
index 49c16aac31..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/NavigateRoute.axml
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/OfflineRouting.axml b/src/Android/Xamarin.Android/Resources/layout/OfflineRouting.axml
deleted file mode 100644
index 385bcd022e..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/OfflineRouting.axml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/OverrideParametersDialog.axml b/src/Android/Xamarin.Android/Resources/layout/OverrideParametersDialog.axml
deleted file mode 100644
index f38a4c4144..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/OverrideParametersDialog.axml
+++ /dev/null
@@ -1,229 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/PerformValveIsolationTrace.xml b/src/Android/Xamarin.Android/Resources/layout/PerformValveIsolationTrace.xml
deleted file mode 100644
index 0a849d2c82..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/PerformValveIsolationTrace.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/QueryCQLFilters.xml b/src/Android/Xamarin.Android/Resources/layout/QueryCQLFilters.xml
deleted file mode 100644
index 4960c80e6a..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/QueryCQLFilters.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/RouteAroundBarriers.axml b/src/Android/Xamarin.Android/Resources/layout/RouteAroundBarriers.axml
deleted file mode 100644
index 009bd63fe2..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/RouteAroundBarriers.axml
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/SamplesLayout.axml b/src/Android/Xamarin.Android/Resources/layout/SamplesLayout.axml
deleted file mode 100644
index a285ee8a11..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/SamplesLayout.axml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/SamplesList.axml b/src/Android/Xamarin.Android/Resources/layout/SamplesList.axml
deleted file mode 100644
index b0175a7364..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/SamplesList.axml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/ShowPopup.xml b/src/Android/Xamarin.Android/Resources/layout/ShowPopup.xml
deleted file mode 100644
index c094e229af..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/ShowPopup.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/SurfacePlacements.xml b/src/Android/Xamarin.Android/Resources/layout/SurfacePlacements.xml
deleted file mode 100644
index 9362c59e61..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/SurfacePlacements.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/TraceUtilityNetwork.axml b/src/Android/Xamarin.Android/Resources/layout/TraceUtilityNetwork.axml
deleted file mode 100644
index 610646a9de..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/TraceUtilityNetwork.axml
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/ViewHiddenARPipePlacer.axml b/src/Android/Xamarin.Android/Resources/layout/ViewHiddenARPipePlacer.axml
deleted file mode 100644
index 5f54839dca..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/ViewHiddenARPipePlacer.axml
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/layout/ViewHiddenARPipeViewer.axml b/src/Android/Xamarin.Android/Resources/layout/ViewHiddenARPipeViewer.axml
deleted file mode 100644
index 6b5a1566b1..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/ViewHiddenARPipeViewer.axml
+++ /dev/null
@@ -1,134 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/layout/WmsIdentify.axml b/src/Android/Xamarin.Android/Resources/layout/WmsIdentify.axml
deleted file mode 100644
index 69f6640e97..0000000000
--- a/src/Android/Xamarin.Android/Resources/layout/WmsIdentify.axml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/Android/Xamarin.Android/Resources/values/Attrs.xml b/src/Android/Xamarin.Android/Resources/values/Attrs.xml
deleted file mode 100644
index 72ff01788f..0000000000
--- a/src/Android/Xamarin.Android/Resources/values/Attrs.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Resources/values/Strings.xml b/src/Android/Xamarin.Android/Resources/values/Strings.xml
deleted file mode 100644
index 23e810bd58..0000000000
--- a/src/Android/Xamarin.Android/Resources/values/Strings.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- Hello World, Click Me!
- AndroidTest1
- Some content used in the samples requires a developer API key for access. Go to the developer documentation to learn how to obtain a developer API key for ArcGIS Online.
-
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/DistanceMeasurement/DistanceMeasurement.cs b/src/Android/Xamarin.Android/Samples/Analysis/DistanceMeasurement/DistanceMeasurement.cs
deleted file mode 100644
index 6174637f5f..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/DistanceMeasurement/DistanceMeasurement.cs
+++ /dev/null
@@ -1,162 +0,0 @@
-// Copyright 2021 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using Esri.ArcGISRuntime.UI.GeoAnalysis;
-using System;
-using Debug = System.Diagnostics.Debug;
-using Surface = Esri.ArcGISRuntime.Mapping.Surface;
-
-namespace ArcGISRuntime.Samples.DistanceMeasurement
-{
- [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Distance measurement analysis",
- category: "Analysis",
- description: "Measure distances between two points in 3D.",
- instructions: "Choose a unit system for the measurement. Tap any location in the scene to start measuring. Move the mouse to an end location, and tap to complete the measurement. Tap a new location to clear and start a new measurement.",
- tags: new[] { "3D", "analysis", "distance", "measure" })]
- [ArcGISRuntime.Samples.Shared.Attributes.AndroidLayout("DistanceMeasurement.axml")]
- public class DistanceMeasurement : Activity
- {
- // Reference to UI controls.
- private TextView _directLabel;
- private TextView _verticalLabel;
- private TextView _horizontalLabel;
- private SceneView _mySceneView;
- private Spinner _unitSpinner;
-
- // URLs to various services used to provide an interesting scene for the sample.
- private readonly Uri _buildingService =
- new Uri(
- "https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Buildings_Brest/SceneServer/layers/0");
-
- private readonly Uri _worldElevationService =
- new Uri("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer");
-
- // Reference to the measurement used.
- private LocationDistanceMeasurement _distanceMeasurement;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Distance measurement analysis";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a scene with elevation.
- Surface sceneSurface = new Surface();
- sceneSurface.ElevationSources.Add(new ArcGISTiledElevationSource(_worldElevationService));
- Scene myScene = new Scene(BasemapStyle.ArcGISTopographic)
- {
- BaseSurface = sceneSurface
- };
-
- // Create and add a building layer.
- ArcGISSceneLayer buildingsLayer = new ArcGISSceneLayer(_buildingService);
- myScene.OperationalLayers.Add(buildingsLayer);
-
- // Create and add an analysis overlay.
- AnalysisOverlay measureAnalysisOverlay = new AnalysisOverlay();
- _mySceneView.AnalysisOverlays.Add(measureAnalysisOverlay);
-
- // Create an initial distance measurement and show it.
- MapPoint start = new MapPoint(-4.494677, 48.384472, 24.772694, SpatialReferences.Wgs84);
- MapPoint end = new MapPoint(-4.495646, 48.384377, 58.501115, SpatialReferences.Wgs84);
- _distanceMeasurement = new LocationDistanceMeasurement(start, end);
- measureAnalysisOverlay.Analyses.Add(_distanceMeasurement);
-
- // Keep the UI updated.
- _distanceMeasurement.MeasurementChanged += (o, e) =>
- {
- // This is needed because measurement change events occur on a non-UI thread and this code accesses UI object.
- RunOnUiThread(() =>
- {
- // Update the label with new values in the format {value} {unit system}.
- _directLabel.Text =
- $"{_distanceMeasurement.DirectDistance.Value:F} {_distanceMeasurement.DirectDistance.Unit.Abbreviation}";
- _verticalLabel.Text =
- $"{_distanceMeasurement.VerticalDistance.Value:F} {_distanceMeasurement.VerticalDistance.Unit.Abbreviation}";
- _horizontalLabel.Text =
- $"{_distanceMeasurement.HorizontalDistance.Value:F} {_distanceMeasurement.HorizontalDistance.Unit.Abbreviation}";
- });
- };
-
- // Update the unit spinner with the options.
- _unitSpinner.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem,
- Enum.GetNames(typeof(UnitSystem)));
- _unitSpinner.ItemSelected += (sender, args) =>
- {
- UnitSystem[] values = (UnitSystem[])Enum.GetValues(typeof(UnitSystem));
- _distanceMeasurement.UnitSystem = values[args.Position];
- };
-
- // Show the scene in the view.
- _mySceneView.Scene = myScene;
- _mySceneView.SetViewpointCamera(new Camera(start, 200, 45, 45, 0));
-
- // Subscribe to tap events to enable updating the measurement.
- _mySceneView.GeoViewTapped += MySceneView_GeoViewTapped;
- }
-
- private async void MySceneView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
- {
- try
- {
- // Get the geographic location for the current mouse position.
- MapPoint geoPoint = await _mySceneView.ScreenToLocationAsync(e.Position);
-
- if (geoPoint == null) return;
-
- // Update the location distance measurement.
- _distanceMeasurement.EndLocation = geoPoint;
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.ToString());
- }
- }
-
- private void CreateLayout()
- {
- // Load the layout for the sample from the .axml file.
- SetContentView(Resource.Layout.DistanceMeasurement);
-
- // Update control references to point to the controls defined in the layout
- _mySceneView = FindViewById(Resource.Id.distanceMeasurement_sceneView);
- _directLabel = FindViewById(Resource.Id.distanceMeasurement_directLabel);
- _verticalLabel = FindViewById(Resource.Id.distanceMeasurement_verticalLabel);
- _horizontalLabel = FindViewById(Resource.Id.distanceMeasurement_horizontalLabel);
- _unitSpinner = FindViewById(Resource.Id.distanceMeasurement_unitSpinner);
- }
-
- protected override void OnDestroy()
- {
- base.OnDestroy();
-
- // Remove the sceneview
- (_mySceneView.Parent as ViewGroup).RemoveView(_mySceneView);
- _mySceneView.Dispose();
- _mySceneView = null;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/DistanceMeasurement/DistanceMeasurement.jpg b/src/Android/Xamarin.Android/Samples/Analysis/DistanceMeasurement/DistanceMeasurement.jpg
deleted file mode 100644
index 6511bfa26a..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Analysis/DistanceMeasurement/DistanceMeasurement.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/DistanceMeasurement/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Analysis/DistanceMeasurement/readme.metadata.json
deleted file mode 100644
index 8c925dc609..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/DistanceMeasurement/readme.metadata.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "category": "Analysis",
- "description": "Measure distances between two points in 3D.",
- "formal_name": "DistanceMeasurement",
- "ignore": false,
- "images": [
- "DistanceMeasurement.jpg"
- ],
- "keywords": [
- "3D",
- "analysis",
- "distance",
- "measure"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/distancemeasurement.htm"
- ],
- "relevant_apis": [
- "AnalysisOverlay",
- "LocationDistanceMeasurement",
- "LocationDistanceMeasurement.MeasurementChanged"
- ],
- "snippets": [
- "../../../Resources/layout/DistanceMeasurement.axml",
- "DistanceMeasurement.cs"
- ],
- "title": "Distance measurement analysis"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightGeoElement/LineOfSightGeoElement.cs b/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightGeoElement/LineOfSightGeoElement.cs
deleted file mode 100644
index 7ea9e6f1bc..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightGeoElement/LineOfSightGeoElement.cs
+++ /dev/null
@@ -1,300 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using Esri.ArcGISRuntime.UI.GeoAnalysis;
-using System;
-using System.Timers;
-using ArcGISRuntime.Samples.Managers;
-using Android.Views;
-
-namespace ArcGISRuntime.Samples.LineOfSightGeoElement
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("3af5cfec0fd24dac8d88aea679027cb9")]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Line of sight (geoelement)",
- category: "Analysis",
- description: "Show a line of sight between two moving objects.",
- instructions: "A line of sight will display between a point on the Empire State Building (observer) and a taxi (target).",
- tags: new[] { "3D", "line of sight", "visibility", "visibility analysis" })]
- public class LineOfSightGeoElement : Activity
- {
- // Hold a reference to the SceneView
- private SceneView _mySceneView;
-
- // Hold the label that will show the analysis status
- private TextView _myStatusLabel;
-
- // Hold the slider that will control observer height
- private SeekBar _myHeightSlider;
-
- // URL of the elevation service - provides elevation component of the scene
- private readonly Uri _elevationUri = new Uri("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer");
-
- // URL of the building service - provides builidng models
- private readonly Uri _buildingsUri = new Uri("https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/New_York_LoD2_3D_Buildings/SceneServer/layers/0");
-
- // Starting point of the observation point
- private readonly MapPoint _observerPoint = new MapPoint(-73.984988, 40.748131, 20, SpatialReferences.Wgs84);
-
- // Graphic to represent the observation point
- private Graphic _observerGraphic;
-
- // Graphic to represent the observed target
- private Graphic _taxiGraphic;
-
- // Line of Sight Analysis
- private GeoElementLineOfSight _geoLine;
-
- // For taxi animation - four points in a loop
- private readonly MapPoint[] _points = {
- new MapPoint(-73.984513, 40.748469, SpatialReferences.Wgs84),
- new MapPoint(-73.985068, 40.747786, SpatialReferences.Wgs84),
- new MapPoint(-73.983452, 40.747091, SpatialReferences.Wgs84),
- new MapPoint(-73.982961, 40.747762, SpatialReferences.Wgs84)
- };
-
- // For taxi animation - tracks animation state
- private int _pointIndex = 0;
- private int _frameIndex = 0;
- private readonly int _frameMax = 150;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Line of sight (GeoElement)";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private async void Initialize()
- {
- // Create scene
- Scene myScene = new Scene(BasemapStyle.ArcGISImagery)
- {
- InitialViewpoint = new Viewpoint(_observerPoint, 1600)
- };
- // Set initial viewpoint
- // Create the elevation source
- ElevationSource myElevationSource = new ArcGISTiledElevationSource(_elevationUri);
- // Add the elevation source to the scene
- myScene.BaseSurface.ElevationSources.Add(myElevationSource);
- // Create the building scene layer
- ArcGISSceneLayer mySceneLayer = new ArcGISSceneLayer(_buildingsUri);
- // Add the building layer to the scene
- myScene.OperationalLayers.Add(mySceneLayer);
-
- // Add the observer to the scene
- // Create a graphics overlay with relative surface placement; relative surface placement allows the Z position of the observation point to be adjusted
- GraphicsOverlay overlay = new GraphicsOverlay() { SceneProperties = new LayerSceneProperties(SurfacePlacement.Relative) };
- // Create the symbol that will symbolize the observation point
- SimpleMarkerSceneSymbol symbol = new SimpleMarkerSceneSymbol(SimpleMarkerSceneSymbolStyle.Sphere, System.Drawing.Color.Red, 10, 10, 10, SceneSymbolAnchorPosition.Bottom);
- // Create the observation point graphic from the point and symbol
- _observerGraphic = new Graphic(_observerPoint, symbol);
- // Add the observer to the overlay
- overlay.Graphics.Add(_observerGraphic);
- // Add the overlay to the scene
- _mySceneView.GraphicsOverlays.Add(overlay);
-
- try
- {
- // Add the taxi to the scene
- // Create the model symbol for the taxi
- ModelSceneSymbol taxiSymbol = await ModelSceneSymbol.CreateAsync(new Uri(GetModelUri()));
- // Set the anchor position for the mode; ensures that the model appears above the ground
- taxiSymbol.AnchorPosition = SceneSymbolAnchorPosition.Bottom;
- // Create the graphic from the taxi starting point and the symbol
- _taxiGraphic = new Graphic(_points[0], taxiSymbol);
- // Add the taxi graphic to the overlay
- overlay.Graphics.Add(_taxiGraphic);
-
- // Create GeoElement Line of sight analysis (taxi to building)
- // Create the analysis
- _geoLine = new GeoElementLineOfSight(_observerGraphic, _taxiGraphic)
- {
- TargetOffsetZ = 2
- };
- // Apply an offset to the target. This helps avoid some false negatives
- // Create the analysis overlay
- AnalysisOverlay myAnalysisOverlay = new AnalysisOverlay();
- // Add the analysis to the overlay
- myAnalysisOverlay.Analyses.Add(_geoLine);
- // Add the analysis overlay to the scene
- _mySceneView.AnalysisOverlays.Add(myAnalysisOverlay);
-
- // Create a timer; this will enable animating the taxi
- Timer timer = new Timer(60);
- // Move the taxi every time the timer expires
- timer.Elapsed += AnimationTimer_Elapsed;
- // Keep the timer running continuously
- timer.AutoReset = true;
- // Start the timer
- timer.Start();
-
- // Subscribe to TargetVisible events; allows for updating the UI and selecting the taxi when it is visible
- _geoLine.TargetVisibilityChanged += Geoline_TargetVisibilityChanged;
-
- // Add the scene to the view
- _mySceneView.Scene = myScene;
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private void AnimationTimer_Elapsed(object sender, EventArgs e)
- {
- // Note: the contents of this function are solely related to animating the taxi
-
- // Increment the frame counter
- _frameIndex++;
-
- // Reset the frame counter once one segment of the path has been travelled
- if (_frameIndex == _frameMax)
- {
- _frameIndex = 0;
-
- // Start navigating toward the next point
- _pointIndex++;
-
- // Restart if finished circuit
- if (_pointIndex == _points.Length)
- {
- _pointIndex = 0;
- }
- }
-
- // Get the point the taxi is travelling from
- MapPoint starting = _points[_pointIndex];
- // Get the point the taxi is travelling to
- MapPoint ending = _points[(_pointIndex + 1) % _points.Length];
- // Calculate the progress based on the current frame
- double progress = _frameIndex / (double)_frameMax;
- // Calculate the position of the taxi when it is {progress}% of the way through
- MapPoint intermediatePoint = InterpolatedPoint(starting, ending, progress);
- // Update the taxi geometry
- _taxiGraphic.Geometry = intermediatePoint;
-
- // Update the taxi rotation.
- GeodeticDistanceResult distance = GeometryEngine.DistanceGeodetic(starting, ending, LinearUnits.Meters, AngularUnits.Degrees, GeodeticCurveType.Geodesic);
- ((ModelSceneSymbol)_taxiGraphic.Symbol).Heading = distance.Azimuth1;
- }
-
- private MapPoint InterpolatedPoint(MapPoint firstPoint, MapPoint secondPoint, double progress)
- {
- // This function returns a MapPoint that is the result of travelling {progress}% of the way from {firstPoint} to {secondPoint}
-
- // Get the difference between the two points
- MapPoint difference = new MapPoint(secondPoint.X - firstPoint.X, secondPoint.Y - firstPoint.Y, secondPoint.Z - firstPoint.Z, SpatialReferences.Wgs84);
- // Scale the difference by the progress towards the destination
- MapPoint scaled = new MapPoint(difference.X * progress, difference.Y * progress, difference.Z * progress);
- // Add the scaled progress to the starting point
- return new MapPoint(firstPoint.X + scaled.X, firstPoint.Y + scaled.Y, firstPoint.Z + scaled.Z);
- }
-
- private void Geoline_TargetVisibilityChanged(object sender, EventArgs e)
- {
- // This is needed because Runtime delivers notifications from a different thread that doesn't have access to UI controls
- RunOnUiThread(UpdateUiAndSelection);
- }
-
- private void UpdateUiAndSelection()
- {
- switch (_geoLine.TargetVisibility)
- {
- case LineOfSightTargetVisibility.Obstructed:
- _myStatusLabel.Text = "Status: Obstructed";
- _taxiGraphic.IsSelected = false;
- break;
-
- case LineOfSightTargetVisibility.Visible:
- _myStatusLabel.Text = "Status: Visible";
- _taxiGraphic.IsSelected = true;
- break;
-
- default:
- case LineOfSightTargetVisibility.Unknown:
- _myStatusLabel.Text = "Status: Unknown";
- _taxiGraphic.IsSelected = false;
- break;
- }
- }
-
- private static string GetModelUri()
- {
- // Returns the taxi model
- return DataManager.GetDataFolder("3af5cfec0fd24dac8d88aea679027cb9", "dolmus.3ds");
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create the controls
- _myHeightSlider = new SeekBar(this) { Max = 100 };
- _myStatusLabel = new TextView(this) { Text = "Status: " };
-
- // Subscribe to height slider changes
- _myHeightSlider.ProgressChanged += MyHeightSlider_ProgressChanged;
-
- // Add the views to the layout
- layout.AddView(_myStatusLabel);
- layout.AddView(_myHeightSlider);
- _mySceneView = new SceneView(this);
- layout.AddView(_mySceneView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
-
- private void MyHeightSlider_ProgressChanged(object sender, SeekBar.ProgressChangedEventArgs e)
- {
- // Update the height of the observer based on the slider value
-
- // Constrain the min and max to 20 and 150 units
- double minHeight = 20;
- double maxHeight = 150;
-
- // Scale the slider value; its default range is 0-10
- double value = e.Progress / 100.0;
-
- // Get the current point
- MapPoint oldPoint = (MapPoint)_observerGraphic.Geometry;
-
- // Create a new point with the same (x,y) but updated z
- MapPoint newPoint = new MapPoint(oldPoint.X, oldPoint.Y, (maxHeight - minHeight) * value + minHeight);
-
- // Apply the updated geometry to the observer point
- _observerGraphic.Geometry = newPoint;
- }
-
- protected override void OnDestroy()
- {
- base.OnDestroy();
-
- // Remove the sceneview
- (_mySceneView.Parent as ViewGroup).RemoveView(_mySceneView);
- _mySceneView.Dispose();
- _mySceneView = null;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightGeoElement/LineOfSightGeoElement.jpg b/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightGeoElement/LineOfSightGeoElement.jpg
deleted file mode 100644
index cb8a22d569..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightGeoElement/LineOfSightGeoElement.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightGeoElement/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightGeoElement/readme.metadata.json
deleted file mode 100644
index fb7cdd3e40..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightGeoElement/readme.metadata.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "category": "Analysis",
- "description": "Show a line of sight between two moving objects.",
- "formal_name": "LineOfSightGeoElement",
- "ignore": false,
- "images": [
- "LineOfSightGeoElement.jpg"
- ],
- "keywords": [
- "3D",
- "line of sight",
- "visibility",
- "visibility analysis"
- ],
- "offline_data": [
- "3af5cfec0fd24dac8d88aea679027cb9"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/lineofsightgeoelement.htm"
- ],
- "relevant_apis": [
- "AnalysisOverlay",
- "GeoElementLineOfSight",
- "LineOfSight.TargetVisibility"
- ],
- "snippets": [
- "LineOfSightGeoElement.cs"
- ],
- "title": "Line of sight (geoelement)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightLocation/LineOfSightLocation.cs b/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightLocation/LineOfSightLocation.cs
deleted file mode 100644
index 8b0a98062a..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightLocation/LineOfSightLocation.cs
+++ /dev/null
@@ -1,148 +0,0 @@
-// Copyright 2017 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using Esri.ArcGISRuntime.UI.GeoAnalysis;
-using System;
-
-namespace ArcGISRuntime.Samples.LineOfSightLocation
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Line of sight (location)",
- category: "Analysis",
- description: "Perform a line of sight analysis between two points in real time.",
- instructions: "Tap to place the starting point for the line. Tap again to place the end point.",
- tags: new[] { "3D", "line of sight", "visibility", "visibility analysis" })]
- public class LineOfSightLocation : Activity
- {
- // Hold a reference to the scene view
- private SceneView _mySceneView;
-
- // URL for an image service to use as an elevation source
- private string _elevationSourceUrl = @"https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer";
-
- // Location line of sight analysis
- private LocationLineOfSight _lineOfSightAnalysis;
-
- // Observer location for line of sight
- private MapPoint _observerLocation;
-
- // Target location for line of sight
- private MapPoint _targetLocation;
-
- // Offset (meters) to use for the observer/target height (z-value for the points)
- private double _zOffset = 2.0;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Line of sight from location";
-
- // Create the UI
- CreateLayout();
-
- // Create the Scene, basemap, graphic, and composite symbol
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a new Scene with an imagery basemap
- Scene myScene = new Scene(BasemapStyle.ArcGISImageryStandard);
-
- // Create an elevation source for the Scene
- ArcGISTiledElevationSource elevationSrc = new ArcGISTiledElevationSource(new Uri(_elevationSourceUrl));
- myScene.BaseSurface.ElevationSources.Add(elevationSrc);
-
- // Add the Scene to the SceneView
- _mySceneView.Scene = myScene;
-
- // Set the viewpoint with a new camera
- Camera newCamera = new Camera(new MapPoint(-121.7, 45.4, SpatialReferences.Wgs84), 10000, 0, 45, 0);
- _mySceneView.SetViewpointCameraAsync(newCamera);
-
- // Create a new line of sight analysis with arbitrary points (observer and target will be defined by the user)
- _lineOfSightAnalysis = new LocationLineOfSight(new MapPoint(0.0, 0.0, SpatialReferences.Wgs84), new MapPoint(0.0, 0.0, SpatialReferences.Wgs84));
-
- // Set the visible and obstructed colors (default would be green/red)
- // These are static properties that apply to all line of sight analyses in the scene view
- LineOfSight.VisibleColor = System.Drawing.Color.Cyan;
- LineOfSight.ObstructedColor = System.Drawing.Color.Magenta;
-
- // Create an analysis overlay to contain the analysis and add it to the scene view
- AnalysisOverlay lineOfSightOverlay = new AnalysisOverlay();
- lineOfSightOverlay.Analyses.Add(_lineOfSightAnalysis);
- _mySceneView.AnalysisOverlays.Add(lineOfSightOverlay);
- }
-
- private void SceneViewTapped(object sender, GeoViewInputEventArgs e)
- {
- // Ignore if tapped out of bounds (e.g. the sky).
- if (e.Location == null)
- {
- return;
- }
-
- // When the view is tapped, define the observer or target location with the tap point as appropriate
- if (_observerLocation == null)
- {
- // Define the observer location (plus an offset for observer height) and set the target to the same point
- _observerLocation = new MapPoint(e.Location.X, e.Location.Y, e.Location.Z + _zOffset);
- _lineOfSightAnalysis.ObserverLocation = _observerLocation;
- _lineOfSightAnalysis.TargetLocation = _observerLocation;
-
- // Clear the target location (if any) so the next click will define the target
- _targetLocation = null;
- }
- else if (_targetLocation == null)
- {
- // Define the target
- _targetLocation = new MapPoint(e.Location.X, e.Location.Y, e.Location.Z + _zOffset);
- _lineOfSightAnalysis.TargetLocation = _targetLocation;
-
- // Clear the observer location so it can be defined again
- _observerLocation = null;
- }
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add the scene view to the layout
- _mySceneView = new SceneView(this);
- layout.AddView(_mySceneView);
-
- // Wire up tapped event for the scene view
- _mySceneView.GeoViewTapped += SceneViewTapped;
-
- // Show the layout in the app
- SetContentView(layout);
- }
-
- protected override void OnDestroy()
- {
- base.OnDestroy();
-
- // Remove the sceneview
- (_mySceneView.Parent as ViewGroup).RemoveView(_mySceneView);
- _mySceneView.Dispose();
- _mySceneView = null;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightLocation/LineOfSightLocation.jpg b/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightLocation/LineOfSightLocation.jpg
deleted file mode 100644
index 0cdcb08d7e..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightLocation/LineOfSightLocation.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightLocation/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightLocation/readme.metadata.json
deleted file mode 100644
index 5a276921b7..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/LineOfSightLocation/readme.metadata.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "category": "Analysis",
- "description": "Perform a line of sight analysis between two points in real time.",
- "formal_name": "LineOfSightLocation",
- "ignore": false,
- "images": [
- "LineOfSightLocation.jpg"
- ],
- "keywords": [
- "3D",
- "line of sight",
- "visibility",
- "visibility analysis"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/lineofsightlocation.htm"
- ],
- "relevant_apis": [
- "AnalysisOverlay",
- "LocationLineOfSight",
- "SceneView"
- ],
- "snippets": [
- "LineOfSightLocation.cs"
- ],
- "title": "Line of sight (location)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/QueryFeatureCountAndExtent/QueryFeatureCountAndExtent.cs b/src/Android/Xamarin.Android/Samples/Analysis/QueryFeatureCountAndExtent/QueryFeatureCountAndExtent.cs
deleted file mode 100644
index 3d6c306a33..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/QueryFeatureCountAndExtent/QueryFeatureCountAndExtent.cs
+++ /dev/null
@@ -1,197 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using Android.Views;
-using Android.Views.InputMethods;
-
-namespace ArcGISRuntime.Samples.QueryFeatureCountAndExtent
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Query feature count and extent",
- category: "Analysis",
- description: "Zoom to features matching a query and count the features in the current visible extent.",
- instructions: "Use the button to zoom to the extent of the state specified (by abbreviation) in the textbox or use the button to count the features in the current extent.",
- tags: new[] { "count", "feature layer", "feature table", "features", "filter", "number", "query" })]
- public class QueryFeatureCountAndExtent : Activity
- {
- // UI controls.
- private EditText _myStateEntry;
- private TextView _myResultsLabel;
- private Button _myQueryStateButton;
- private Button _myQueryExtentButton;
- private MapView _myMapView;
-
- // URL to the feature service.
- private readonly Uri _medicareHospitalSpendLayer =
- new Uri("https://services1.arcgis.com/4yjifSiIG17X0gW4/arcgis/rest/services/Medicare_Hospital_Spending_per_Patient/FeatureServer/0");
-
- // Feature table to query.
- private ServiceFeatureTable _featureTable;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Query feature count and extent";
-
- CreateLayout();
- Initialize();
- }
-
- private async void Initialize()
- {
- // Create the map with a basemap.
- Map myMap = new Map(BasemapStyle.ArcGISDarkGray);
-
- // Create the feature table from the service URL.
- _featureTable = new ServiceFeatureTable(_medicareHospitalSpendLayer);
-
- // Create the feature layer from the table.
- FeatureLayer myFeatureLayer = new FeatureLayer(_featureTable);
-
- // Add the feature layer to the map.
- myMap.OperationalLayers.Add(myFeatureLayer);
-
- try
- {
- // Wait for the feature layer to load.
- await myFeatureLayer.LoadAsync();
-
- // Set the map initial extent to the extent of the feature layer.
- myMap.InitialViewpoint = new Viewpoint(myFeatureLayer.FullExtent);
-
- // Add the map to the MapView.
- _myMapView.Map = myMap;
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private async void BtnZoomToFeatures_Click(object sender, EventArgs e)
- {
- // Create the query parameters.
- QueryParameters queryStates = new QueryParameters { WhereClause = $"upper(State) LIKE '%{_myStateEntry.Text.ToUpper()}%'" };
-
- try
- {
- // Get the extent from the query.
- Envelope resultExtent = await _featureTable.QueryExtentAsync(queryStates);
-
- // Return if there is no result (might happen if query is invalid).
- if (resultExtent?.SpatialReference == null)
- {
- _myResultsLabel.Text = $"Couldn't zoom to features in {_myStateEntry.Text}.";
- return;
- }
-
- // Create a viewpoint from the extent.
- Viewpoint resultViewpoint = new Viewpoint(resultExtent);
-
- // Zoom to the viewpoint.
- await _myMapView.SetViewpointAsync(resultViewpoint);
-
- // Update label.
- _myResultsLabel.Text = $"Zoomed to features in {_myStateEntry.Text}.";
- }
- catch (Exception ex)
- {
- new AlertDialog.Builder(this).SetMessage(ex.ToString()).SetTitle("Error").Show();
- }
- }
-
- private async void BtnCountFeatures_Click(object sender, EventArgs e)
- {
- try
- {
- // Get the current visible extent.
- Geometry currentExtent = _myMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry;
-
- // Create the query parameters.
- QueryParameters queryCityCount = new QueryParameters
- {
- Geometry = currentExtent,
- // Specify the interpretation of the Geometry query parameters.
- SpatialRelationship = SpatialRelationship.Intersects
- };
-
- // Get the count of matching features.
- long count = await _featureTable.QueryFeatureCountAsync(queryCityCount);
-
- // Update the UI.
- _myResultsLabel.Text = $"{count} features in extent";
- }
- catch (NullReferenceException exception)
- {
- // Sample wasn't ready.
- System.Diagnostics.Debug.WriteLine(exception);
- }
- catch (Exception)
- {
- // Uncaught exception in async void will crash application.
- }
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create the entry.
- _myStateEntry = new EditText(this) { Hint = "State abbreviation (e.g. NY)" };
-
- // Hide the keyboard on enter.
- _myStateEntry.KeyPress += (sender, args) =>
- {
- if (args.Event.Action == KeyEventActions.Down && args.KeyCode == Keycode.Enter)
- {
- InputMethodManager imm = (InputMethodManager)GetSystemService(InputMethodService);
- imm.HideSoftInputFromWindow(_myStateEntry.WindowToken, 0);
- BtnZoomToFeatures_Click(_myStateEntry, null);
- }
- else
- {
- args.Handled = false;
- }
- };
-
- // Create the results label.
- _myResultsLabel = new TextView(this);
-
- // Create the two buttons.
- _myQueryStateButton = new Button(this) { Text = "Zoom to matching features" };
- _myQueryExtentButton = new Button(this) { Text = "Count features in extent" };
-
- // Subscribe to button events.
- _myQueryExtentButton.Click += BtnCountFeatures_Click;
- _myQueryStateButton.Click += BtnZoomToFeatures_Click;
-
- // Add the views to the layout.
- layout.AddView(_myStateEntry);
- layout.AddView(_myQueryStateButton);
- layout.AddView(_myQueryExtentButton);
- layout.AddView(_myResultsLabel);
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/QueryFeatureCountAndExtent/QueryFeatureCountAndExtent.jpg b/src/Android/Xamarin.Android/Samples/Analysis/QueryFeatureCountAndExtent/QueryFeatureCountAndExtent.jpg
deleted file mode 100644
index 665b2d0158..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Analysis/QueryFeatureCountAndExtent/QueryFeatureCountAndExtent.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/QueryFeatureCountAndExtent/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Analysis/QueryFeatureCountAndExtent/readme.metadata.json
deleted file mode 100644
index 5b067e0a38..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/QueryFeatureCountAndExtent/readme.metadata.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "category": "Analysis",
- "description": "Zoom to features matching a query and count the features in the current visible extent.",
- "formal_name": "QueryFeatureCountAndExtent",
- "ignore": false,
- "images": [
- "QueryFeatureCountAndExtent.jpg"
- ],
- "keywords": [
- "count",
- "feature layer",
- "feature table",
- "features",
- "filter",
- "number",
- "query"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/queryfeaturecountandextent.htm"
- ],
- "relevant_apis": [
- "FeatureTable.QueryExtentAsync",
- "FeatureTable.QueryFeatureCountAsync",
- "MapView.GetCurrentViewpoint(ViewpointType)",
- "QueryParameters",
- "QueryParameters.Geometry",
- "QueryParameters.SpatialRelationship",
- "QueryParameters.WhereClause"
- ],
- "snippets": [
- "QueryFeatureCountAndExtent.cs"
- ],
- "title": "Query feature count and extent"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedCamera/ViewshedCamera.cs b/src/Android/Xamarin.Android/Samples/Analysis/ViewshedCamera/ViewshedCamera.cs
deleted file mode 100644
index 5b970986d2..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedCamera/ViewshedCamera.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright 2021 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using Esri.ArcGISRuntime.UI.GeoAnalysis;
-using System;
-
-namespace ArcGISRuntime.Samples.ViewshedCamera
-{
- [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Viewshed for camera",
- category: "Analysis",
- description: "Analyze the viewshed for a camera. A viewshed shows the visible and obstructed areas from an observer's vantage point. ",
- instructions: "The sample will start with a viewshed created from the initial camera location, so only the visible (green) portion of the viewshed will be visible. Move around the scene to see the obstructed (red) portions. Tap the button to update the viewshed to the current camera position.",
- tags: new[] { "3D", "Scene", "integrated mesh", "viewshed", "visibility analysis" })]
- public class ViewshedCamera : Activity
- {
- // Hold a reference to the scene view
- private SceneView _mySceneView;
-
- // URL for a scene service of buildings in Girona.
- private string _gironaMeshUrl = "https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Girona_Spain/SceneServer";
-
- // URL for an image service to use as an elevation source.
- private string _elevationSourceUrl = "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer";
-
- // Location viewshed analysis to show visible and obstructed areas from the camera
- private LocationViewshed _viewshedForCamera;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Viewshed camera";
-
- // Create the UI
- CreateLayout();
-
- // Create the Scene, basemap, camera, and location viewshed analysis
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a new Scene with an imagery basemap
- Scene myScene = new Scene(BasemapStyle.ArcGISImageryStandard);
-
- // Create a scene layer to show buildings in the Scene
- IntegratedMeshLayer meshLayer = new IntegratedMeshLayer(new Uri(_gironaMeshUrl));
- myScene.OperationalLayers.Add(meshLayer);
-
- // Create an elevation source for the Scene
- ArcGISTiledElevationSource elevationSrc = new ArcGISTiledElevationSource(new Uri(_elevationSourceUrl));
- myScene.BaseSurface.ElevationSources.Add(elevationSrc);
-
- // Add the Scene to the SceneView
- _mySceneView.Scene = myScene;
-
- // Set the viewpoint with a new camera focused on the cathedral in Girona.
- Camera observerCamera = new Camera(new MapPoint(2.82691, 41.985, 124.987, SpatialReferences.Wgs84), 332.131, 82.4732, 0.0);
- _mySceneView.SetViewpointCameraAsync(observerCamera);
-
- // Create a LocationViewshed analysis using the camera as the observer
- _viewshedForCamera = new LocationViewshed(observerCamera, 1, 1000);
-
- // Create an analysis overlay to contain the viewshed analysis results
- AnalysisOverlay viewshedOverlay = new AnalysisOverlay();
-
- // Add the location viewshed analysis to the analysis overlay, then add the overlay to the scene view
- viewshedOverlay.Analyses.Add(_viewshedForCamera);
- _mySceneView.AnalysisOverlays.Add(viewshedOverlay);
- }
-
- private void UpdateObserverWithCamera(object sender, EventArgs e)
- {
- // Use the current camera to update the observer for the location viewshed analysis
- _viewshedForCamera.UpdateFromCamera(_mySceneView.Camera);
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create a button to update the viewshed using the current camera
- Button updateViewshedButton = new Button(this)
- {
- Text = "Viewshed from here"
- };
- updateViewshedButton.Click += UpdateObserverWithCamera;
-
- // Add the button and scene view to the layout
- layout.AddView(updateViewshedButton);
- _mySceneView = new SceneView(this);
- layout.AddView(_mySceneView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
-
- protected override void OnDestroy()
- {
- base.OnDestroy();
-
- // Remove the sceneview
- (_mySceneView.Parent as ViewGroup).RemoveView(_mySceneView);
- _mySceneView.Dispose();
- _mySceneView = null;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedCamera/ViewshedCamera.jpg b/src/Android/Xamarin.Android/Samples/Analysis/ViewshedCamera/ViewshedCamera.jpg
deleted file mode 100644
index ffc7228b81..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedCamera/ViewshedCamera.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedCamera/readme.md b/src/Android/Xamarin.Android/Samples/Analysis/ViewshedCamera/readme.md
deleted file mode 100644
index e694c8bfab..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedCamera/readme.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# Viewshed for camera
-
-Analyze the viewshed for a camera. A viewshed shows the visible and obstructed areas from an observer's vantage point.
-
-![Image of viewshed for camera](ViewshedCamera.jpg)
-
-## Use case
-
-A viewshed analysis is a type of visual analysis you can perform on a scene. The viewshed aims to answer the question 'What can I see from a given location?'. The output is an overlay with two different colors - one representing the visible areas (green) and the other representing the obstructed areas (red).
-
-## How to use the sample
-
-The sample will start with a viewshed created from the initial camera location, so only the visible (green) portion of the viewshed will be visible. Move around the scene to see the obstructed (red) portions. Tap the button to update the viewshed to the current camera position.
-
-## How it works
-
-1. Create a `LocationViewshed`, passing in a `Camera` and a min/max distance.
-2. Update the viewshed using `viewshed.UpdateFromCamera()`.
-
-## Relevant API
-
-* AnalysisOverlay
-* Scene
-* IntegratedMeshLayer
-* ArcGISTiledElevationSource
-* Camera
-* LocationViewshed
-* SceneView
-
-## About the data
-
-The scene shows an integrated mesh layer of [Girona, Spain](https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Girona_Spain/SceneServer) with the [World Elevation source image service](https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer) both hosted on ArcGIS Online.
-
-## Tags
-
-3D, integrated mesh, Scene, viewshed, visibility analysis
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedCamera/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Analysis/ViewshedCamera/readme.metadata.json
deleted file mode 100644
index 2b0112b03a..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedCamera/readme.metadata.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "category": "Analysis",
- "description": "Analyze the viewshed for a camera. A viewshed shows the visible and obstructed areas from an observer's vantage point. ",
- "formal_name": "ViewshedCamera",
- "ignore": false,
- "images": [
- "ViewshedCamera.jpg"
- ],
- "keywords": [
- "3D",
- "Scene",
- "integrated mesh",
- "viewshed",
- "visibility analysis"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/viewshedcamera.htm"
- ],
- "relevant_apis": [
- "AnalysisOverlay",
- "ArcGISTiledElevationSource",
- "Camera",
- "IntegratedMeshLayer",
- "LocationViewshed",
- "Scene",
- "SceneView"
- ],
- "snippets": [
- "ViewshedCamera.cs"
- ],
- "title": "Viewshed for camera"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedGeoElement/ViewshedGeoElement.cs b/src/Android/Xamarin.Android/Samples/Analysis/ViewshedGeoElement/ViewshedGeoElement.cs
deleted file mode 100644
index f999b5f5d4..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedGeoElement/ViewshedGeoElement.cs
+++ /dev/null
@@ -1,236 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using ArcGISRuntime.Samples.Managers;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using Esri.ArcGISRuntime.UI.GeoAnalysis;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Timers;
-using Surface = Esri.ArcGISRuntime.Mapping.Surface;
-
-namespace ArcGISRuntime.Samples.ViewshedGeoElement
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("07d62a792ab6496d9b772a24efea45d0")]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Viewshed for GeoElement",
- category: "Analysis",
- description: "Analyze the viewshed for an object (GeoElement) in a scene.",
- instructions: "Tap to set a destination for the vehicle (a GeoElement). The vehicle will 'drive' towards the tapped location. The viewshed analysis will update as the vehicle moves.",
- tags: new[] { "3D", "analysis", "buildings", "model", "scene", "viewshed", "visibility analysis" })]
- public class ViewshedGeoElement : Activity
- {
- // Hold a reference to the scene view.
- private SceneView _mySceneView;
-
- // URLs to the scene layer with buildings and the elevation source
- private readonly Uri _elevationUri = new Uri("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer");
- private readonly Uri _buildingsUri = new Uri("https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Building_Johannesburg/SceneServer");
-
- // Graphic and overlay for showing the tank
- private readonly GraphicsOverlay _tankOverlay = new GraphicsOverlay();
- private Graphic _tank;
-
- // Animation properties
- private MapPoint _tankEndPoint;
-
- // Units for geodetic calculation (used in animating tank)
- private readonly LinearUnit _metersUnit = (LinearUnit)Unit.FromWkid(9001);
- private readonly AngularUnit _degreesUnit = (AngularUnit)Unit.FromWkid(9102);
-
- protected override async void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Viewshed (GeoElement)";
-
- // Create the UI, setup the control references and execute initialization.
- CreateLayout();
- await Initialize();
- }
-
- private async Task Initialize()
- {
- // Create the scene with an imagery basemap.
- _mySceneView.Scene = new Scene(BasemapStyle.ArcGISImageryStandard);
-
- // Add the elevation surface.
- ArcGISTiledElevationSource tiledElevationSource = new ArcGISTiledElevationSource(_elevationUri);
- Surface baseSurface = new Surface
- {
- ElevationSources = { tiledElevationSource }
- };
- _mySceneView.Scene.BaseSurface = baseSurface;
-
- // Add buildings.
- ArcGISSceneLayer sceneLayer = new ArcGISSceneLayer(_buildingsUri);
- _mySceneView.Scene.OperationalLayers.Add(sceneLayer);
-
- // Configure the graphics overlay for the tank and add the overlay to the SceneView.
- _tankOverlay.SceneProperties.SurfacePlacement = SurfacePlacement.Relative;
- _mySceneView.GraphicsOverlays.Add(_tankOverlay);
-
- // Configure the heading expression for the tank; this will allow the
- // viewshed to update automatically based on the tank's position.
- SimpleRenderer renderer3D = new SimpleRenderer();
- renderer3D.SceneProperties.HeadingExpression = "[HEADING]";
- _tankOverlay.Renderer = renderer3D;
-
- try
- {
- // Create the tank graphic - get the model path.
- string modelPath = GetModelPath();
- // - Create the symbol and make it 10x larger (to be the right size relative to the scene).
- ModelSceneSymbol tankSymbol = await ModelSceneSymbol.CreateAsync(new Uri(modelPath), 10);
- // - Adjust the position.
- tankSymbol.Heading = 90;
- // - The tank will be positioned relative to the scene surface by its bottom
- // This ensures that the tank is on the ground rather than partially under it.
- tankSymbol.AnchorPosition = SceneSymbolAnchorPosition.Bottom;
- // - Create the graphic.
- _tank = new Graphic(new MapPoint(28.047199, -26.189105, SpatialReferences.Wgs84), tankSymbol);
- // - Update the heading.
- _tank.Attributes["HEADING"] = 0.0;
- // - Add the graphic to the overlay.
- _tankOverlay.Graphics.Add(_tank);
-
- // Create a viewshed for the tank.
- GeoElementViewshed geoViewshed = new GeoElementViewshed(
- geoElement: _tank,
- horizontalAngle: 90.0,
- verticalAngle: 40.0,
- minDistance: 0.1,
- maxDistance: 250.0,
- headingOffset: 0.0,
- pitchOffset: 0.0)
- {
- // Offset viewshed observer location to top of tank.
- OffsetZ = 3.0
- };
-
- // Create the analysis overlay and add to the scene.
- AnalysisOverlay overlay = new AnalysisOverlay();
- overlay.Analyses.Add(geoViewshed);
- _mySceneView.AnalysisOverlays.Add(overlay);
-
- // Create a camera controller to orbit the tank.
- OrbitGeoElementCameraController cameraController = new OrbitGeoElementCameraController(_tank, 200.0)
- {
- CameraPitchOffset = 45.0
- };
- // - Apply the camera controller to the SceneView.
- _mySceneView.CameraController = cameraController;
-
- // Create a timer; this will enable animating the tank.
- Timer animationTimer = new Timer(60)
- {
- Enabled = true,
- AutoReset = true
- };
- // - Move the tank every time the timer expires.
- animationTimer.Elapsed += (o, e) =>
- {
- AnimateTank();
- };
- // - Start the timer.
- animationTimer.Start();
-
- // Allow the user to click to define a new destination.
- _mySceneView.GeoViewTapped += (sender, args) => { _tankEndPoint = args.Location; };
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private void AnimateTank()
- {
- // Return if tank already arrived.
- if (_tankEndPoint == null)
- {
- return;
- }
-
- // Get current location and distance from the destination.
- MapPoint location = (MapPoint)_tank.Geometry;
- GeodeticDistanceResult distance = GeometryEngine.DistanceGeodetic(
- location, _tankEndPoint, _metersUnit, _degreesUnit, GeodeticCurveType.Geodesic);
-
- // Move the tank a short distance.
- location = GeometryEngine.MoveGeodetic(new List() { location }, 1.0, _metersUnit, distance.Azimuth1, _degreesUnit,
- GeodeticCurveType.Geodesic).First();
- _tank.Geometry = location;
-
- // Rotate to face the destination.
- double heading = (double)_tank.Attributes["HEADING"];
- heading = heading + (distance.Azimuth1 - heading) / 10;
- _tank.Attributes["HEADING"] = heading;
-
- // Clear the destination if the tank already arrived.
- if (distance.Distance < 5)
- {
- _tankEndPoint = null;
- }
- }
-
- private static string GetModelPath()
- {
- // Returns the tank model.
-
- return DataManager.GetDataFolder("07d62a792ab6496d9b772a24efea45d0", "bradle.3ds");
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- LinearLayout layout = new LinearLayout(this)
- {
- Orientation = Orientation.Vertical
- };
-
- // Create and add a help label.
- TextView helpLabel = new TextView(this)
- {
- Text = "Tap to set a destination for the vehicle.",
- Gravity = Android.Views.GravityFlags.Center
- };
- layout.AddView(helpLabel);
- layout.SetPadding(0,10,0,0);
-
- // Add the map view to the layout.
- _mySceneView = new SceneView(this);
- layout.AddView(_mySceneView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
-
- protected override void OnDestroy()
- {
- base.OnDestroy();
-
- // Remove the sceneview
- (_mySceneView.Parent as ViewGroup).RemoveView(_mySceneView);
- _mySceneView.Dispose();
- _mySceneView = null;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedGeoElement/ViewshedGeoElement.jpg b/src/Android/Xamarin.Android/Samples/Analysis/ViewshedGeoElement/ViewshedGeoElement.jpg
deleted file mode 100644
index 2d8851d9a0..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedGeoElement/ViewshedGeoElement.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedGeoElement/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Analysis/ViewshedGeoElement/readme.metadata.json
deleted file mode 100644
index 3733b925ac..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedGeoElement/readme.metadata.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "category": "Analysis",
- "description": "Analyze the viewshed for an object (GeoElement) in a scene.",
- "formal_name": "ViewshedGeoElement",
- "ignore": false,
- "images": [
- "ViewshedGeoElement.jpg"
- ],
- "keywords": [
- "3D",
- "analysis",
- "buildings",
- "model",
- "scene",
- "viewshed",
- "visibility analysis"
- ],
- "offline_data": [
- "07d62a792ab6496d9b772a24efea45d0"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/viewshedgeoelement.htm"
- ],
- "relevant_apis": [
- "AnalysisOverlay",
- "GeoElementViewshed",
- "GeodeticDistanceResult",
- "GeometryEngine.DistanceGeodetic",
- "ModelSceneSymbol",
- "OrbitGeoElementCameraController"
- ],
- "snippets": [
- "ViewshedGeoElement.cs"
- ],
- "title": "Viewshed for GeoElement"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedLocation/ViewshedLocation.cs b/src/Android/Xamarin.Android/Samples/Analysis/ViewshedLocation/ViewshedLocation.cs
deleted file mode 100644
index cb50f73a38..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedLocation/ViewshedLocation.cs
+++ /dev/null
@@ -1,265 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using Esri.ArcGISRuntime.UI.GeoAnalysis;
-using System;
-using Surface = Esri.ArcGISRuntime.Mapping.Surface;
-
-namespace ArcGISRuntime.Samples.ViewshedLocation
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Viewshed (location)",
- category: "Analysis",
- description: "Perform a viewshed analysis from a defined vantage point.",
- instructions: "Use the sliders to change the properties (heading, pitch, etc.), of the viewshed and see them updated in real time.",
- tags: new[] { "3D", "frustum", "scene", "viewshed", "visibility analysis" })]
- public class ViewshedLocation : Activity
- {
- // Hold a reference to the scene view.
- private SceneView _mySceneView;
-
- // Hold the URL to the elevation source.
- private readonly Uri _localElevationImageService = new Uri("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer");
-
- // Hold the URL to the buildings scene layer.
- private readonly Uri _buildingsUrl = new Uri("https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Buildings_Brest/SceneServer/layers/0");
-
- // Hold a reference to the viewshed analysis.
- private LocationViewshed _viewshed;
-
- // Hold a reference to the analysis overlay that will hold the viewshed analysis.
- private AnalysisOverlay _analysisOverlay;
-
- // Graphics overlay for viewpoint symbol.
- private GraphicsOverlay _viewpointOverlay;
-
- // Symbol for viewpoint.
- private SimpleMarkerSceneSymbol _viewpointSymbol;
-
- // References to UI elements.
- private SeekBar _headingSlider;
-
- private SeekBar _pitchSlider;
- private SeekBar _horizontalAngleSlider;
- private SeekBar _verticalAngleSlider;
- private SeekBar _minimumDistanceSlider;
- private SeekBar _maximumDistanceSlider;
- private Switch _analysisVisibilitySwitch;
- private Switch _frustumVisibilitySwitch;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Viewshed (Location)";
-
- // Create the layout
- CreateLayout();
-
- // Initialize the sample
- Initialize();
- }
-
- private void Initialize()
- {
- // Create the scene with the imagery basemap.
- Scene myScene = new Scene(BasemapStyle.ArcGISImageryStandard);
- _mySceneView.Scene = myScene;
-
- // Add the surface elevation.
- Surface mySurface = new Surface();
- mySurface.ElevationSources.Add(new ArcGISTiledElevationSource(_localElevationImageService));
- myScene.BaseSurface = mySurface;
-
- // Add the scene layer.
- ArcGISSceneLayer sceneLayer = new ArcGISSceneLayer(_buildingsUrl);
- myScene.OperationalLayers.Add(sceneLayer);
-
- // Create the MapPoint representing the initial location.
- MapPoint initialLocation = new MapPoint(-4.5, 48.4, 56.0);
-
- // Create the location viewshed analysis.
- _viewshed = new LocationViewshed(
- initialLocation,
- _headingSlider.Progress,
- _pitchSlider.Progress,
- _horizontalAngleSlider.Progress,
- _verticalAngleSlider.Progress,
- _minimumDistanceSlider.Progress,
- _maximumDistanceSlider.Progress);
-
- // Create a camera based on the initial location.
- Camera camera = new Camera(initialLocation, 200.0, 20.0, 70.0, 0.0);
-
- // Apply the camera to the scene view.
- _mySceneView.SetViewpointCamera(camera);
-
- // Create an analysis overlay for showing the viewshed analysis.
- _analysisOverlay = new AnalysisOverlay();
-
- // Add the viewshed analysis to the overlay.
- _analysisOverlay.Analyses.Add(_viewshed);
-
- // Create a symbol for the viewpoint.
- _viewpointSymbol = SimpleMarkerSceneSymbol.CreateSphere(System.Drawing.Color.Blue, 10, SceneSymbolAnchorPosition.Center);
-
- // Add the symbol to the viewpoint overlay.
- _viewpointOverlay = new GraphicsOverlay
- {
- SceneProperties = new LayerSceneProperties(SurfacePlacement.Absolute)
- };
- _viewpointOverlay.Graphics.Add(new Graphic(initialLocation, _viewpointSymbol));
-
- // Add the analysis overlay to the SceneView.
- _mySceneView.AnalysisOverlays.Add(_analysisOverlay);
-
- // Add the graphics overlay
- _mySceneView.GraphicsOverlays.Add(_viewpointOverlay);
-
- // Update the frustum outline color.
- // The frustum outline shows the volume in which the viewshed analysis is performed.
- Viewshed.FrustumOutlineColor = System.Drawing.Color.Blue;
-
- // Subscribe to tap events to enable moving the observer.
- _mySceneView.GeoViewTapped += MySceneViewOnGeoViewTapped;
- }
-
- private void MySceneViewOnGeoViewTapped(object sender, GeoViewInputEventArgs viewInputEventArgs)
- {
- if (viewInputEventArgs.Location == null)
- {
- // User clicked on the sky - don't update the location with invalid value.
- return;
- }
- // Update the viewshed location.
- _viewshed.Location = viewInputEventArgs.Location;
-
- // Move the location off of the ground.
- _viewshed.Location = new MapPoint(_viewshed.Location.X, _viewshed.Location.Y, _viewshed.Location.Z + 10.0);
-
- // Update the viewpoint symbol.
- _viewpointOverlay.Graphics.Clear();
- _viewpointOverlay.Graphics.Add(new Graphic(_viewshed.Location, _viewpointSymbol));
- }
-
- private void HandleSettingsChange(object sender, EventArgs e)
- {
- // Reset the horizontal and vertical angle if they go out of bounds
- if (_horizontalAngleSlider.Progress < 1) { _horizontalAngleSlider.Progress = 1; }
- if (_verticalAngleSlider.Progress < 1) { _verticalAngleSlider.Progress = 1; }
-
- // Update the viewshed settings.
- _viewshed.Heading = _headingSlider.Progress;
- _viewshed.Pitch = _pitchSlider.Progress;
- _viewshed.HorizontalAngle = _horizontalAngleSlider.Progress;
- _viewshed.VerticalAngle = _verticalAngleSlider.Progress;
- _viewshed.MinDistance = _minimumDistanceSlider.Progress + 5;
- _viewshed.MaxDistance = _maximumDistanceSlider.Progress;
-
- // Update visibility of the viewshed analysis.
- _viewshed.IsVisible = _analysisVisibilitySwitch.Checked;
-
- // Update visibility of the frustum. Note that the frustum will be invisible
- // regardless of this setting if the viewshed analysis is not visible.
- _viewshed.IsFrustumOutlineVisible = _frustumVisibilitySwitch.Checked;
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Heading
- TextView headingLabel = new TextView(this) { Text = "Heading:" };
- _headingSlider = new SeekBar(this) { Max = 360 };
- layout.AddView(headingLabel);
- layout.AddView(_headingSlider);
-
- // Pitch
- TextView pitchLabel = new TextView(this) { Text = "Pitch:" };
- _pitchSlider = new SeekBar(this) { Max = 180, Progress = 60 };
- layout.AddView(pitchLabel);
- layout.AddView(_pitchSlider);
-
- // Horizontal Angle
- TextView horizontalAngleLabel = new TextView(this) { Text = "Horizontal Angle:" };
- _horizontalAngleSlider = new SeekBar(this) { Max = 120, Progress = 75 };
- layout.AddView(horizontalAngleLabel);
- layout.AddView(_horizontalAngleSlider);
-
- // Vertical Angle
- TextView verticalAngleLabel = new TextView(this) { Text = "Vertical Angle:" };
- _verticalAngleSlider = new SeekBar(this) { Max = 120, Progress = 90 };
- layout.AddView(verticalAngleLabel);
- layout.AddView(_verticalAngleSlider);
-
- // Minimum Distance
- TextView minimumDistanceLabel = new TextView(this) { Text = "Minimum Distance:" };
- _minimumDistanceSlider = new SeekBar(this) { Max = 8994 };
- layout.AddView(minimumDistanceLabel);
- layout.AddView(_minimumDistanceSlider);
- layout.SetHorizontalGravity(GravityFlags.FillHorizontal);
-
- // Maximum Distance
- TextView maximumDistanceLabel = new TextView(this) { Text = "Maximum Distance:" };
- _maximumDistanceSlider = new SeekBar(this) { Max = 9999, Progress = 1500 };
- layout.AddView(maximumDistanceLabel);
- layout.AddView(_maximumDistanceSlider);
-
- // Analysis Visibility
- TextView analysisVisibilityLabel = new TextView(this) { Text = "Analysis Visibility:" };
- _analysisVisibilitySwitch = new Switch(this) { Checked = true };
- layout.AddView(analysisVisibilityLabel);
- layout.AddView(_analysisVisibilitySwitch);
-
- // Frustum Visibility
- TextView frustumVisibilityLabel = new TextView(this) { Text = "Frustum Visibility:" };
- _frustumVisibilitySwitch = new Switch(this) { Checked = false };
- layout.AddView(frustumVisibilityLabel);
- layout.AddView(_frustumVisibilitySwitch);
-
- // Add the scene view to the layout
- _mySceneView = new SceneView(this);
- layout.AddView(_mySceneView);
-
- // Show the layout in the app
- SetContentView(layout);
-
- // Subscribe to events
- _headingSlider.ProgressChanged += HandleSettingsChange;
- _pitchSlider.ProgressChanged += HandleSettingsChange;
- _horizontalAngleSlider.ProgressChanged += HandleSettingsChange;
- _verticalAngleSlider.ProgressChanged += HandleSettingsChange;
- _minimumDistanceSlider.ProgressChanged += HandleSettingsChange;
- _maximumDistanceSlider.ProgressChanged += HandleSettingsChange;
- _analysisVisibilitySwitch.Click += HandleSettingsChange;
- _frustumVisibilitySwitch.Click += HandleSettingsChange;
- }
-
- protected override void OnDestroy()
- {
- base.OnDestroy();
-
- // Remove the sceneview
- (_mySceneView.Parent as ViewGroup).RemoveView(_mySceneView);
- _mySceneView.Dispose();
- _mySceneView = null;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedLocation/ViewshedLocation.jpg b/src/Android/Xamarin.Android/Samples/Analysis/ViewshedLocation/ViewshedLocation.jpg
deleted file mode 100644
index 2d36b53a0f..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedLocation/ViewshedLocation.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedLocation/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Analysis/ViewshedLocation/readme.metadata.json
deleted file mode 100644
index 20d7974941..0000000000
--- a/src/Android/Xamarin.Android/Samples/Analysis/ViewshedLocation/readme.metadata.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "category": "Analysis",
- "description": "Perform a viewshed analysis from a defined vantage point.",
- "formal_name": "ViewshedLocation",
- "ignore": false,
- "images": [
- "ViewshedLocation.jpg"
- ],
- "keywords": [
- "3D",
- "frustum",
- "scene",
- "viewshed",
- "visibility analysis"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/viewshedlocation.htm"
- ],
- "relevant_apis": [
- "AnalysisOverlay",
- "ArcGISSceneLayer",
- "ArcGISTiledElevationSource",
- "LocationViewshed",
- "Viewshed"
- ],
- "snippets": [
- "ViewshedLocation.cs"
- ],
- "title": "Viewshed (location)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/CollectDataAR.cs b/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/CollectDataAR.cs
deleted file mode 100644
index c329afab9d..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/CollectDataAR.cs
+++ /dev/null
@@ -1,544 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android;
-using Android.App;
-using Android.Content;
-using Android.Content.PM;
-using Android.Media;
-using Android.OS;
-using Android.Runtime;
-using Android.Support.V4.App;
-using Android.Support.V4.Content;
-using Android.Views;
-using Android.Widget;
-using ArcGISRuntimeXamarin.Samples.ARToolkit.Controls;
-using Esri.ArcGISRuntime.ARToolkit;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using Java.Nio;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Surface = Esri.ArcGISRuntime.Mapping.Surface;
-
-namespace ArcGISRuntimeXamarin.Samples.CollectDataAR
-{
- [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Collect data in AR",
- category: "Augmented reality",
- description: "Tap on real-world objects to collect data.",
- instructions: "Before you start, go through the on-screen calibration process to ensure accurate positioning of recorded features.",
- tags: new[] { "attachment", "augmented reality", "capture", "collection", "collector", "data", "field", "field worker", "full-scale", "mixed reality", "survey", "world-scale" })]
- public class CollectDataAR : Activity, IDialogInterfaceOnCancelListener
- {
- // Hold references to UI controls.
- private ARSceneView _arView;
- private TextView _helpLabel;
- private Button _calibrateButton;
- private Button _addButton;
- private Button _roamingButton;
- private Button _localButton;
- private View _calibrationView;
- private JoystickSeekBar _headingSlider;
- private JoystickSeekBar _altitudeSlider;
-
- // Scene content.
- private ArcGISTiledElevationSource _elevationSource;
- private Surface _elevationSurface;
- private Scene _scene;
-
- // Track when user is changing between AR and GPS localization.
- private bool _changingScale;
-
- // Create a new copmletion source for the prompt.
- private TaskCompletionSource _healthCompletionSource;
-
- // Feature table for collected data about trees.
- private ServiceFeatureTable _featureTable = new ServiceFeatureTable(new Uri("https://services2.arcgis.com/ZQgQTuoyBrtmoGdP/arcgis/rest/services/AR_Tree_Survey/FeatureServer/0"));
-
- // Graphics for tapped points in the scene.
- private GraphicsOverlay _graphicsOverlay;
- private SimpleMarkerSceneSymbol _tappedPointSymbol = new SimpleMarkerSceneSymbol(SimpleMarkerSceneSymbolStyle.Diamond, System.Drawing.Color.Orange, 0.5, 0.5, 0.5, SceneSymbolAnchorPosition.Center);
-
- // Custom location data source that enables calibration and returns values relative to mean sea level rather than the WGS84 ellipsoid.
- private MSLAdjustedARLocationDataSource _locationDataSource;
-
- // Calibration state fields.
- private bool _isCalibrating;
- private double _altitudeOffset;
-
- // Permissions and permission request.
- private readonly string[] _requestedPermissions = { Manifest.Permission.AccessFineLocation };
- private const int requestCode = 35;
-
- private void RequestPermissions()
- {
- if (ContextCompat.CheckSelfPermission(this, _requestedPermissions[0]) == Permission.Granted)
- {
- Initialize();
- }
- else
- {
- ActivityCompat.RequestPermissions(this, _requestedPermissions, CollectDataAR.requestCode);
- }
- }
-
- public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Permission[] grantResults)
- {
- if (requestCode == CollectDataAR.requestCode && grantResults[0] == Permission.Granted)
- {
- Initialize();
- }
- else
- {
- Toast.MakeText(this, "Location permissions needed for this sample", ToastLength.Short).Show();
- }
- base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
- }
-
- private bool IsCalibrating
- {
- get
- {
- return _isCalibrating;
- }
- set
- {
- _isCalibrating = value;
- if (_isCalibrating)
- {
- // Show the surface semitransparent for calibration.
- _scene.BaseSurface.Opacity = 0.5;
-
- // Enable scene interaction.
- _arView.InteractionOptions.IsEnabled = true;
- _calibrationView.Visibility = ViewStates.Visible;
- }
- else
- {
- // Hide the scene when not calibrating.
- _scene.BaseSurface.Opacity = 0;
-
- // Disable scene interaction.
- _arView.InteractionOptions.IsEnabled = false;
- _calibrationView.Visibility = ViewStates.Gone;
- }
- }
- }
-
- protected override void OnCreate(Bundle savedInstanceState)
- {
- base.OnCreate(savedInstanceState);
-
- Title = "Collect data in AR";
-
- // Create the layout.
- CreateLayout();
-
- // Request permissions for location.
- RequestPermissions();
- }
-
- private void CreateLayout()
- {
- // Load the view.
- SetContentView(ArcGISRuntime.Resource.Layout.CollectDataAR);
-
- // Set up control references.
- _arView = FindViewById(ArcGISRuntime.Resource.Id.arView);
- _helpLabel = FindViewById(ArcGISRuntime.Resource.Id.helpLabel);
- _calibrateButton = FindViewById(ArcGISRuntime.Resource.Id.calibrateButton);
- _addButton = FindViewById(ArcGISRuntime.Resource.Id.addTreeButton);
- _roamingButton = FindViewById(ArcGISRuntime.Resource.Id.roamingButton);
- _localButton = FindViewById(ArcGISRuntime.Resource.Id.localButton);
- _calibrationView = FindViewById(ArcGISRuntime.Resource.Id.calibrationView);
- _headingSlider = FindViewById(ArcGISRuntime.Resource.Id.headingJoystick);
- _altitudeSlider = FindViewById(ArcGISRuntime.Resource.Id.altitudeJoystick);
-
- // Disable plane rendering and visualization.
- _arView.ArSceneView.PlaneRenderer.Enabled = false;
- _arView.ArSceneView.PlaneRenderer.Visible = false;
-
- // Configure button click events.
- _addButton.Click += AddButtonPressed;
- _calibrateButton.Click += (o, e) => IsCalibrating = !IsCalibrating;
- _roamingButton.Click += (o, e) => RealScaleValueChanged(true);
- _localButton.Click += (o, e) => RealScaleValueChanged(false);
-
- // Configure calibration sliders.
- _headingSlider.DeltaProgressChanged += HeadingSlider_DeltaProgressChanged;
- _altitudeSlider.DeltaProgressChanged += AltitudeSlider_DeltaProgressChanged;
- }
-
- private void AltitudeSlider_DeltaProgressChanged(object sender, DeltaChangedEventArgs e)
- {
- // Add the new value to the existing altitude offset.
- _altitudeOffset += e.DeltaProgress;
-
- // Update the altitude offset on the custom location data source.
- _locationDataSource.AltitudeOffset = _altitudeOffset;
- }
-
- private void HeadingSlider_DeltaProgressChanged(object sender, DeltaChangedEventArgs e)
- {
- // Get the old camera.
- Camera camera = _arView.OriginCamera;
-
- // Calculate the new heading by applying the offset to the old camera's heading.
- double heading = camera.Heading + e.DeltaProgress;
-
- // Create a new camera by rotating the old camera to the new heading.
- Camera newCamera = camera.RotateTo(heading, camera.Pitch, camera.Roll);
-
- // Use the new camera as the origin camera.
- _arView.OriginCamera = newCamera;
- }
-
- private async void RealScaleValueChanged(bool roaming)
- {
- // Prevent this from being called concurrently
- if (_changingScale)
- {
- return;
- }
- _changingScale = true;
-
- // Disable the associated UI controls while switching.
- _roamingButton.Enabled = false;
- _localButton.Enabled = false;
-
- // Check if using roaming for AR location mode.
- if (roaming)
- {
- await _arView.StopTrackingAsync();
-
- // Start AR tracking using a continuous GPS signal.
- await _arView.StartTrackingAsync(ARLocationTrackingMode.Continuous);
- _altitudeSlider.Enabled = true;
- _localButton.Enabled = true;
- }
- else
- {
- await _arView.StopTrackingAsync();
-
- // Start AR tracking without using a GPS signal.
- await _arView.StartTrackingAsync(ARLocationTrackingMode.Ignore);
- _altitudeSlider.Enabled = false;
- _roamingButton.Enabled = true;
- }
- _changingScale = false;
- }
-
- private void Initialize()
- {
- Toast.MakeText(this,
- "Calibrate your location before collecting data!",
- ToastLength.Long).Show();
-
- // Create the custom location data source and configure the AR scene view to use it.
- _locationDataSource = new MSLAdjustedARLocationDataSource(this);
- _locationDataSource.AltitudeMode = MSLAdjustedARLocationDataSource.AltitudeAdjustmentMode.NmeaParsedMsl;
- _arView.LocationDataSource = _locationDataSource;
-
- // Create the scene and show it.
- _scene = new Scene(BasemapStyle.ArcGISImageryStandard);
- _arView.Scene = _scene;
-
- // Create and add the elevation surface.
- _elevationSource = new ArcGISTiledElevationSource(new Uri("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"));
- _elevationSurface = new Surface();
- _elevationSurface.ElevationSources.Add(_elevationSource);
- _arView.Scene.BaseSurface = _elevationSurface;
-
- // Hide the surface in AR.
- _elevationSurface.NavigationConstraint = NavigationConstraint.None;
- _elevationSurface.Opacity = 0;
-
- // Configure the space and atmosphere effects for AR.
- _arView.SpaceEffect = SpaceEffect.None;
- _arView.AtmosphereEffect = AtmosphereEffect.None;
-
- // Add a graphics overlay for displaying points in AR.
- _graphicsOverlay = new GraphicsOverlay();
- _graphicsOverlay.SceneProperties.SurfacePlacement = SurfacePlacement.Absolute;
- _graphicsOverlay.Renderer = new SimpleRenderer(_tappedPointSymbol);
- _arView.GraphicsOverlays.Add(_graphicsOverlay);
-
- // Add the exisiting features to the scene.
- FeatureLayer treeLayer = new FeatureLayer(_featureTable);
- treeLayer.SceneProperties.SurfacePlacement = SurfacePlacement.Absolute;
- _arView.Scene.OperationalLayers.Add(treeLayer);
-
- // Add the event for the user tapping the screen.
- _arView.GeoViewTapped += arViewTapped;
-
- // Disable scene interaction.
- _arView.InteractionOptions = new SceneViewInteractionOptions() { IsEnabled = false };
-
- // Enable the calibrate button.
- _calibrateButton.Enabled = true;
- }
-
- private void arViewTapped(object sender, GeoViewInputEventArgs e)
- {
- // Don't add features when calibrating the AR view.
- if (_isCalibrating)
- {
- return;
- }
-
- // Try to get the real-world position of that tapped AR plane.
- MapPoint planeLocation = _arView.ARScreenToLocation(e.Position);
-
- // Remove any existing graphics.
- _graphicsOverlay.Graphics.Clear();
-
- // Check if a Map Point was identified.
- if (planeLocation != null)
- {
- // Add a graphic at the tapped location.
- _graphicsOverlay.Graphics.Add(new Graphic(planeLocation));
- _addButton.Enabled = true;
- _helpLabel.Text = "Placed relative to ARCore plane";
- }
- else
- {
- ShowMessage("Didn't find anything, try again.", "Error");
- _addButton.Enabled = false;
- }
- }
-
- private async void AddButtonPressed(object sender, EventArgs e)
- {
- // Check if the user has already tapped a point.
- if (!_graphicsOverlay.Graphics.Any())
- {
- ShowMessage("Didn't find anything, try again.", "Error");
- return;
- }
- try
- {
- // Prevent the user from changing the tapped feature.
- _arView.GeoViewTapped -= arViewTapped;
-
- // Prompt the user for the health value of the tree.
- int healthValue = await GetTreeHealthValue();
-
- // Get the camera image for the frame.
- Image capturedImage = _arView.ArSceneView.ArFrame.AcquireCameraImage();
-
- if (capturedImage != null)
- {
- // Create a new ArcGIS feature and add it to the feature service.
- await CreateFeature(capturedImage, healthValue);
- }
- else
- {
- ShowMessage("Didn't get image for tap.", "Error");
- }
- }
- // This exception is thrown when the user cancels out of the prompt.
- catch (TaskCanceledException)
- {
- return;
- }
- finally
- {
- // Restore the event listener for adding new features.
- _arView.GeoViewTapped += arViewTapped;
- }
- }
-
- private async Task GetTreeHealthValue()
- {
- // Create UI for tree health selection.
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.SetTitle("How healthy is this tree?");
- builder.SetItems(new string[] { "Dead", "Distressed", "Healthy" }, Choose_Click);
- builder.SetOnCancelListener(this);
- builder.Show();
-
- // Get the selected terminal.
- _healthCompletionSource = new TaskCompletionSource();
- int selectedIndex = await _healthCompletionSource.Task;
-
- // Return a tree health value based on the users selection.
- switch (selectedIndex)
- {
- case 0: // Dead tree.
- return 0;
-
- case 1: // Distressed tree.
- return 5;
-
- case 2: // Healthy tree.
- return 10;
-
- default:
- return 0;
- }
- }
-
- private void Choose_Click(object sender, DialogClickEventArgs e)
- {
- _healthCompletionSource.TrySetResult(e.Which);
- }
-
- public void OnCancel(IDialogInterface dialog)
- {
- _healthCompletionSource.TrySetCanceled();
- }
-
- private async Task CreateFeature(Image capturedImage, int healthValue)
- {
- _helpLabel.Text = "Adding feature...";
-
- try
- {
- // Get the geometry of the feature.
- MapPoint featurePoint = _graphicsOverlay.Graphics.First().Geometry as MapPoint;
-
- // Create attributes for the feature using the user selected health value.
- IEnumerable> featureAttributes = new Dictionary() { { "Health", (short)healthValue }, { "Height", 3.2 }, { "Diameter", 1.2 } };
-
- // Ensure that the feature table is loaded.
- if (_featureTable.LoadStatus != Esri.ArcGISRuntime.LoadStatus.Loaded)
- {
- await _featureTable.LoadAsync();
- }
-
- // Create the new feature
- ArcGISFeature newFeature = _featureTable.CreateFeature(featureAttributes, featurePoint) as ArcGISFeature;
-
- // Convert the Image from ARCore into a JPEG byte array.
- byte[] attachmentData = await ConvertImageToJPEG(capturedImage);
-
- // Add the attachment.
- // The contentType string is the MIME type for JPEG files, image/jpeg.
- await newFeature.AddAttachmentAsync("tree.jpg", "image/jpeg", attachmentData);
-
- // Add the newly created feature to the feature table.
- await _featureTable.AddFeatureAsync(newFeature);
-
- // Apply the edits to the service feature table.
- await _featureTable.ApplyEditsAsync();
-
- // Reset the user interface.
- _helpLabel.Text = "Tap to create a feature";
- _graphicsOverlay.Graphics.Clear();
- _addButton.Enabled = false;
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.Message);
- ShowMessage("Could not create feature", "Error");
- }
- }
-
- // This method uses code from this StackOverflow thread. https://stackoverflow.com/a/51521388
- private async Task ConvertImageToJPEG(Image capturedImage)
- {
- // Convert the image into a byte array.
- ByteBuffer yBuffer = capturedImage.GetPlanes()[0].Buffer;
- ByteBuffer uBuffer = capturedImage.GetPlanes()[1].Buffer;
- ByteBuffer vBuffer = capturedImage.GetPlanes()[2].Buffer;
-
- int ySize = yBuffer.Remaining();
- int uSize = uBuffer.Remaining();
- int vSize = vBuffer.Remaining();
-
- // Make a byte array large enough to store the buffers from all three planes.
- byte[] nv21ByteArray = new byte[ySize + uSize + vSize];
-
- // Load the byte array using the byte buffers.
- yBuffer.Get(nv21ByteArray, 0, ySize);
- vBuffer.Get(nv21ByteArray, ySize, vSize);
- uBuffer.Get(nv21ByteArray, ySize + vSize, uSize);
-
- // Rotate the NV21 byte array 90 degrees to the right.
- byte[] rotatedNV21 = RotateNV21ImageRight(nv21ByteArray, capturedImage.Width, capturedImage.Height);
-
- // Create a YuvImage using the NV21 image
- Android.Graphics.YuvImage yuv = new Android.Graphics.YuvImage(rotatedNV21, Android.Graphics.ImageFormatType.Nv21, capturedImage.Height, capturedImage.Width, null);
-
- // Convert the YuvImage into a jpeg.
- System.IO.Stream jpegStream = new System.IO.MemoryStream();
- await yuv.CompressToJpegAsync(new Android.Graphics.Rect(0, 0, yuv.Width, yuv.Height), 100, jpegStream);
-
- // Store the jpeg data in a byte array.
- jpegStream.Position = 0;
- byte[] jpegArray = new byte[jpegStream.Length];
- jpegStream.Read(jpegArray, 0, jpegArray.Length);
- return jpegArray;
- }
-
- // This method uses code modified from this Stack Overflow thread. https://stackoverflow.com/a/31425229
- private byte[] RotateNV21ImageRight(byte[] input, int width, int height)
- {
- byte[] output = new byte[input.Length];
- int frameSize = width * height;
-
- for (int j = 0; j < height; j++)
- {
- for (int i = 0; i < width; i++)
- {
- int yIn = j * width + i;
- int uIn = frameSize + (j >> 1) * width + (i & ~1);
- int vIn = uIn + 1;
-
- int iOut = height - j - 1;
-
- int yOut = i * height + iOut;
- int uOut = frameSize + (i >> 1) * height + (iOut & ~1);
- int vOut = uOut + 1;
-
- output[yOut] = (byte)(0xff & input[yIn]);
- output[uOut] = (byte)(0xff & input[uIn]);
- output[vOut] = (byte)(0xff & input[vIn]);
- }
- }
- return output;
- }
-
- protected override async void OnPause()
- {
- base.OnPause();
- await _arView.StopTrackingAsync();
- }
-
- protected override async void OnResume()
- {
- base.OnResume();
-
- // Resume AR tracking.
- await _arView.StartTrackingAsync(ARLocationTrackingMode.Continuous);
- }
-
- private void ShowMessage(string message, string title, bool closeApp = false)
- {
- // Show a message and then exit after if needed.
- AlertDialog dialog = new AlertDialog.Builder(this).SetMessage(message).SetTitle(title).Create();
- if (closeApp)
- {
- dialog.SetButton("OK", (o, e) =>
- {
- Finish();
- });
- }
- dialog.Show();
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/CollectDataAR.jpg b/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/CollectDataAR.jpg
deleted file mode 100644
index ea898b8ce1..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/CollectDataAR.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/MSLAdjustedARLocationDataSource.cs b/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/MSLAdjustedARLocationDataSource.cs
deleted file mode 100644
index de317f2657..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/MSLAdjustedARLocationDataSource.cs
+++ /dev/null
@@ -1,186 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using System;
-using System.Globalization;
-using System.Threading.Tasks;
-using Android.Content;
-using Android.Locations;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Location;
-using Location = Esri.ArcGISRuntime.Location.Location;
-
-namespace ArcGISRuntimeXamarin.Samples.CollectDataAR
-{
- ///
- /// Custom location data source that allows you to apply an altitude offset in addition to
- /// returning altitude values relative to mean sea level, rather than the WGS84 ellipsoid.
- ///
- public class MSLAdjustedARLocationDataSource : LocationDataSource
- {
- public enum AltitudeAdjustmentMode
- {
- GpsRawEllipsoid,
- NmeaParsedMsl
- }
- private AltitudeAdjustmentMode _currentMode = AltitudeAdjustmentMode.GpsRawEllipsoid;
-
- // Enable configuration of the altitude mode, adding or removing NMEA listener as needed.
- public AltitudeAdjustmentMode AltitudeMode {
- get => _currentMode;
- set
- {
- _currentMode = value;
-
- if (_currentMode == AltitudeAdjustmentMode.NmeaParsedMsl)
- {
- GetLocationManager().AddNmeaListener(_listener, null);
- }
- else
- {
- GetLocationManager().RemoveNmeaListener(_listener);
- }
- }
- }
-
- // Object to handle NMEA messages from the onboard GNSS device.
- private readonly NmeaListener _listener = new NmeaListener();
-
- // Allow setting an altitude offset.
- private double _altitudeOffset;
- public double AltitudeOffset
- {
- get => _altitudeOffset;
- set
- {
- _altitudeOffset = value;
-
- // Raise a location changed event if possible.
- if (_lastLocation != null)
- {
- BaseSource_LocationChanged(_baseSource, _lastLocation);
- }
- }
- }
-
- // Track the last location so that a location changed
- // event can be raised when the altitude offset is changed.
- private Location _lastLocation;
-
- public IntPtr Handle => throw new NotImplementedException();
-
- // Track the last elevation received from the GNSS.
- private double _lastNmeaElevation;
-
- // Use the underlying system location data source.
- private readonly SystemLocationDataSource _baseSource;
-
- private readonly Context _context;
-
- public MSLAdjustedARLocationDataSource(Context context)
- {
- _context = context;
-
- // Create and listen for updates from a new system location data source.
- _baseSource = new SystemLocationDataSource();
- _baseSource.HeadingChanged += BaseSource_HeadingChanged;
- _baseSource.LocationChanged += BaseSource_LocationChanged;
-
- // Listen for altitude change events from the onboard GNSS.
- _listener.NmeaAltitudeChanged += (o, e) =>
- {
- _lastNmeaElevation = e.Altitude;
- };
- }
-
- private void BaseSource_LocationChanged(object sender, Location e)
- {
- // Store the last location to enable raising change events.
- _lastLocation = e;
-
- // Intercept location change events from the base source and either
- // apply an altitude offset, or return the offset altitude from the latest NMEA message.
- MapPoint newPosition = null;
- switch (AltitudeMode)
- {
- case AltitudeAdjustmentMode.GpsRawEllipsoid:
- newPosition = new MapPoint(e.Position.X, e.Position.Y, e.Position.Z + AltitudeOffset, e.Position.SpatialReference);
- break;
- case AltitudeAdjustmentMode.NmeaParsedMsl:
- newPosition = new MapPoint(e.Position.X, e.Position.Y, _lastNmeaElevation + AltitudeOffset, e.Position.SpatialReference);
- break;
- }
-
- Location newLocation = new Location(newPosition, e.HorizontalAccuracy, e.Velocity, e.Course, e.IsLastKnown);
-
- UpdateLocation(newLocation);
- }
-
- private void BaseSource_HeadingChanged(object sender, double e)
- {
- UpdateHeading(e);
- }
-
- protected override Task OnStartAsync() => _baseSource.StartAsync();
-
- protected override Task OnStopAsync() => _baseSource.StopAsync();
-
- private LocationManager _locationManager;
-
- private LocationManager GetLocationManager()
- {
- if (_locationManager == null)
- {
- _locationManager = (LocationManager)_context.GetSystemService("location");
- }
- return _locationManager;
- }
-
- private class NmeaListener : Java.Lang.Object, IOnNmeaMessageListener
- {
- private long _lastTimestamp;
- private double _lastElevation;
-
- public event EventHandler NmeaAltitudeChanged;
-
- public void OnNmeaMessage(string message, long timestamp)
- {
- if (message.StartsWith("$GPGGA") || message.StartsWith("$GNGNS") || message.StartsWith("$GNGGA"))
- {
- var parts = message.Split(',');
-
- if (parts.Length < 10)
- {
- return; // not enough
- }
-
- string mslAltitude = parts[9];
-
- if (string.IsNullOrEmpty(mslAltitude)) { return; }
-
-
- if (double.TryParse(mslAltitude, NumberStyles.Float, CultureInfo.InvariantCulture, out double altitudeParsed))
- {
- if (timestamp > _lastTimestamp)
- {
- _lastElevation = altitudeParsed;
- _lastTimestamp = timestamp;
- NmeaAltitudeChanged?.Invoke(this, new AltitudeEventArgs { Altitude = _lastElevation });
- }
- }
- }
- }
-
- public class AltitudeEventArgs
- {
- public double Altitude { get; set; }
- }
- }
- }
-}
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/readme.md b/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/readme.md
deleted file mode 100644
index b485088aa5..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/readme.md
+++ /dev/null
@@ -1,62 +0,0 @@
-# Collect data in AR
-
-Tap on real-world objects to collect data.
-
-![screenshot showing a feature being recorded, with a prompt to specify feature attributes](CollectDataAR.jpg)
-
-## Use case
-
-You can use AR to quickly photograph an object and automatically determine the object's real-world location, facilitating a more efficient data collection workflow. For example, you could quickly catalog trees in a park, while maintaining visual context of which trees have been recorded - no need for spray paint or tape.
-
-## How to use the sample
-
-Before you start, go through the on-screen calibration process to ensure accurate positioning of recorded features.
-
-When you tap, an orange diamond will appear at the tapped location. You can move around to visually verify that the tapped point is in the correct physical location. When you're satisfied, tap the '+' button to record the feature. An image from the camera feed will automatically be attached to the recorded feature.
-
-> ⚠ **WARNING**: collection of photos is completely automatic; consider your surroundings when adding features.
-
-## How it works
-
-1. Create an `ARSceneView`. Set the atmosphere effect to `None` and the space effect to `None`. Create and show a scene in the scene view.
-2. Load the feature service and display it with a feature layer.
-3. Create and add the elevation surface to the scene.
-4. Create a graphics overlay for planning the location of features to add. Configure the graphics overlay with a renderer and add the graphics overlay to the scene view.
-5. When the user taps the screen, use `ARSceneView.ARScreenToLocation` to find the real-world location of the tapped object using ARKit/ARCore plane detection.
-6. Add a graphic to the graphics overlay preview where the feature will be placed and allow the user to visually verify the placement.
-7. When the user presses the button, take the current AR frame from `ARSceneView.ArSceneView.ArFrame.AcquireCameraImage()`. Rotate the image appropriately and convert it to a JPEG for efficient storage.
-8. Prompt the user for a tree health value, then create the feature. Upon successful creation of the feature, use `feature.AddAttachment` to add the image.
-
-## Relevant API
-
-* ARSceneView
-* GraphicsOverlay
-* SceneView
-* Surface
-
-## About the data
-
-The sample uses a publicly-editable sample [tree survey feature service](https://arcgisruntime.maps.arcgis.com/home/item.html?id=8feb9ea6a27f48b58b3faf04e0e303ed). You can use AR to quickly record the location and health of a tree while seamlessly capturing a photo.
-
-## Additional information
-
-This sample requires a device that is compatible with ARKit 1 on iOS or ARCore 1.8 on Android.
-
-There are two main approaches for identifying the physical location of tapped point:
-
-* **ARSceneView.ARScreenToLocation** - uses plane detection provided by ARKit/ARCore to determine where _in the real world_ the tapped point is.
-* **SceneView.ScreenToLocation** - determines where the tapped point is _in the virtual scene_. This is problematic when the opacity is set to 0 and you can't see where on the scene that is. Real-world objects aren't accounted for by the scene view's calculation to find the tapped location; for example tapping on a tree might result in a point on the basemap many meters away behind the tree.
-
-This sample only uses the `ARScreenToLocation` approach, as it is the only way to get accurate positions for features not directly on the ground in real-scale AR.
-
-Note that unlike other scene samples, a basemap isn't shown most of the time, because the real world provides the context. Only while calibrating is the basemap displayed at 50% opacity, to give the user a visual reference to compare to.
-
-**Real-scale AR** is one of three main patterns for working with geographic information in augmented reality. See [Augmented reality](https://developers.arcgis.com/net/scenes-3d/display-scenes-in-augmented-reality/) in the guide for more information.
-
-See the 'Edit feature attachments' sample for more specific information about the attachment editing workflow.
-
-This sample uses a combination of two location data source modes: continuous update and one-time update, presented as 'roaming' and 'local' calibration modes in the app. The error in the position provided by ARKit/ARCore increases as you move further from the origin, resulting in a poor experience when you move more than a few meters away. The location provided by GPS is more useful over large areas, but not good enough for a convincing AR experience on a small scale. With this sample, you can use 'roaming' mode to maintain good enough accuracy for basic context while navigating a large area. When you want to see a more precise visualization, you can switch to 'local' (ARKit/ARCore-only) mode and manually calibrate for best results.
-
-## Tags
-
-attachment, augmented reality, capture, collection, collector, data, field, field worker, full-scale, mixed reality, survey, world-scale
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/readme.metadata.json b/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/readme.metadata.json
deleted file mode 100644
index 91065be4de..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/CollectDataAR/readme.metadata.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "category": "Augmented reality",
- "description": "Tap on real-world objects to collect data.",
- "formal_name": "CollectDataAR",
- "ignore": false,
- "images": [
- "CollectDataAR.jpg"
- ],
- "keywords": [
- "attachment",
- "augmented reality",
- "capture",
- "collection",
- "collector",
- "data",
- "field",
- "field worker",
- "full-scale",
- "mixed reality",
- "survey",
- "world-scale"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/collectdataar.htm"
- ],
- "relevant_apis": [
- "ARSceneView",
- "GraphicsOverlay",
- "SceneView",
- "Surface"
- ],
- "snippets": [
- "../../../Controls/JoystickSeekBar.cs",
- "../../../Resources/layout/CollectDataAR.axml",
- "../../../Resources/values/Attrs.xml",
- "CollectDataAR.cs",
- "MSLAdjustedARLocationDataSource.cs"
- ],
- "title": "Collect data in AR"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/DisplayScenesInTabletopAR/DisplayScenesInTabletopAR.cs b/src/Android/Xamarin.Android/Samples/AugmentedReality/DisplayScenesInTabletopAR/DisplayScenesInTabletopAR.cs
deleted file mode 100644
index 8b93526c61..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/DisplayScenesInTabletopAR/DisplayScenesInTabletopAR.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-// Copyright 2020 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.Graphics;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using AndroidX.AppCompat.App;
-using Esri.ArcGISRuntime.ARToolkit;
-using Esri.ArcGISRuntime.Mapping;
-using System;
-
-namespace ArcGISRuntimeXamarin.Samples.DisplayScenesInTabletopAR
-{
- [Activity(ConfigurationChanges =
- Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Display scenes in tabletop AR",
- category: "Augmented reality",
- description: "Use augmented reality (AR) to pin a scene to a table or desk for easy exploration.",
- instructions: "You'll see a feed from the camera when you open the sample. Tap on any flat, horizontal surface (like a desk or table) to place the scene. With the scene placed, you can move the camera around the scene to explore. You can also pan and zoom with touch to adjust the position of the scene.",
- tags: new[] { "augmented reality", "drop", "mixed reality", "model", "pin", "place", "table-top", "tabletop" })]
- public class DisplayScenesInTabletopAR : AppCompatActivity
- {
- // Hold references to the UI controls.
- private ARSceneView _arSceneView;
- private TextView _helpLabel;
- private Scene _tabletopScene;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Display scenes in tabletop AR";
-
- CreateLayout();
- }
-
- private void CreateLayout()
- {
- // Load the layout.
- SetContentView(ArcGISRuntime.Resource.Layout.DisplayScenesInTabletopAR);
-
- // Get references to the UI controls.
- _arSceneView = FindViewById(ArcGISRuntime.Resource.Id.arSceneView);
- _helpLabel = FindViewById(ArcGISRuntime.Resource.Id.helpLabel);
-
- // Request camera permission. Initialize will be called when permissions are granted.
- Initialize();
- }
-
- private void Initialize()
- {
- // Display an empty scene to enable tap-to-place.
- _arSceneView.Scene = new Scene(SceneViewTilingScheme.WebMercator);
-
- // Render the scene invisible to start.
- _arSceneView.Scene.BaseSurface.Opacity = 0;
-
- // Wait for the user to tap.
- _arSceneView.GeoViewTapped += ArSceneView_GeoViewTapped;
-
- // Enable plane rendering.
- _arSceneView.ArSceneView.PlaneRenderer.Enabled = true;
- _arSceneView.ArSceneView.PlaneRenderer.Visible = true;
-
- // Wait for planes to be detected.
- _arSceneView.PlanesDetectedChanged += ARSceneView_PlaneDetectedChanged;
-
- _helpLabel.Text = "Keep moving your phone to find a surface.";
- }
-
- private void ARSceneView_PlaneDetectedChanged(object sender, bool planeDetected)
- {
- if (planeDetected)
- {
- _arSceneView.PlanesDetectedChanged -= ARSceneView_PlaneDetectedChanged;
-
- _helpLabel.Text = "Tap the dots to place scene.";
- }
- }
-
- private void ArSceneView_GeoViewTapped(object sender, Esri.ArcGISRuntime.UI.Controls.GeoViewInputEventArgs e)
- {
- // Get the tapped screen point.
- PointF screenPoint = e.Position;
-
- if (_arSceneView.SetInitialTransformation(screenPoint))
- {
- DisplayScene();
- _helpLabel.Visibility = ViewStates.Gone;
- }
- else
- {
- Toast.MakeText(this, "ARCore doesn't recognize that point as a plane.", ToastLength.Short);
- }
- }
-
- private async void DisplayScene()
- {
- try
- {
- if (_tabletopScene == null)
- {
- // Load a scene from ArcGIS Online.
- _tabletopScene = new Scene(new Uri("https://www.arcgis.com/home/item.html?id=31874da8a16d45bfbc1273422f772270"));
- await _tabletopScene.LoadAsync();
-
- // Set the clipping distance for the scene.
- _arSceneView.ClippingDistance = 400;
-
- // Enable subsurface navigation. This allows you to look at the scene from below.
- _tabletopScene.BaseSurface.NavigationConstraint = NavigationConstraint.None;
- }
-
- // Display the scene.
- _arSceneView.Scene = _tabletopScene;
-
- // Create a camera at the bottom and center of the scene.
- // This camera is the point at which the scene is pinned to the real-world surface.
- var originCamera = new Esri.ArcGISRuntime.Mapping.Camera(52.52083, 13.40944, 8.813445091247559, 0, 90, 0);
-
- // Set the origin camera.
- _arSceneView.OriginCamera = originCamera;
-
- // The width of the scene content is about 800 meters.
- double geographicContentWidth = 800;
-
- // The desired physical width of the scene is 1 meter.
- double tableContainerWidth = 1;
-
- // Set the translation factor based on the scene content width and desired physical size.
- _arSceneView.TranslationFactor = geographicContentWidth / tableContainerWidth;
- }
- catch (System.Exception ex)
- {
- new Android.App.AlertDialog.Builder(this).SetMessage("Failed to load scene").SetTitle("Error").Show();
- System.Diagnostics.Debug.WriteLine(ex);
- }
- }
-
- protected override async void OnPause()
- {
- base.OnPause();
- await _arSceneView.StopTrackingAsync();
- }
-
- protected override async void OnResume()
- {
- base.OnResume();
-
- // Start AR tracking without location updates.
- await _arSceneView.StartTrackingAsync();
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/DisplayScenesInTabletopAR/DisplayScenesInTabletopAR.jpg b/src/Android/Xamarin.Android/Samples/AugmentedReality/DisplayScenesInTabletopAR/DisplayScenesInTabletopAR.jpg
deleted file mode 100644
index 23388659b1..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/AugmentedReality/DisplayScenesInTabletopAR/DisplayScenesInTabletopAR.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/DisplayScenesInTabletopAR/readme.md b/src/Android/Xamarin.Android/Samples/AugmentedReality/DisplayScenesInTabletopAR/readme.md
deleted file mode 100644
index 35a1d3fbab..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/DisplayScenesInTabletopAR/readme.md
+++ /dev/null
@@ -1,48 +0,0 @@
-# Display scenes in tabletop AR
-
-Use augmented reality (AR) to pin a scene to a table or desk for easy exploration.
-
-![Scene content shown sitting on a surface, as if it were a 3D printed model](DisplayScenesInTabletopAR.jpg)
-
-## Use case
-
-Tabletop scenes allow you to use your device to interact with scenes as if they are 3D-printed model models sitting on your desk. You could use this to virtually explore a proposed development without needing to create a physical model.
-
-## How to use the sample
-
-You'll see a feed from the camera when you open the sample. Tap on any flat, horizontal surface (like a desk or table) to place the scene. With the scene placed, you can move the camera around the scene to explore. You can also pan and zoom with touch to adjust the position of the scene.
-
-## How it works
-
-1. Create an `ARSceneView` and add it to the view.
- * Note: this sample uses content in the WGS 84 geographic tiling scheme, rather than the web mercator tiling scheme. Once a scene has been displayed, the scene view cannot display another scene with a non-matching tiling scheme. To avoid that, the sample starts by showing a blank scene with an invisible base surface. Touch events will not be raised for the scene view unless a scene is displayed.
-2. Wait for plane detection using `arView.PlanesDetectedChanged` before allowing the user to tap to place the scene.
-3. Wait for the user to tap the view, then use `arView.SetInitialTransforamtion(tappedPoint)` to set the initial transformation, which allows you to place the scene. This method uses ARKit's built-in plane detection.
-4. If the call to `SetInitialTransformation` returns `true`, proceed to load the scene and display it.
-5. To enable looking at the scene from below, set `scene.BaseSurface.NavigationConstraint` to `0`.
-6. Set the origin camera to the point in the scene where it should be anchored to the real-world surface you tapped. Typically that is the point at the center of the scene, with the altitude of the lowest point in the scene.
-7. Set `arView.TranslationFactor` such that the user can view the entire scene by moving the device around it. The translation factor defines how far the virtual camera moves when the physical camera moves.
- * A good formula for determining translation factor to use in a tabletop map experience is **translationFactor = sceneWidth / tableTopWidth**. The scene width is the width/length of the scene content you wish to display in meters. The tabletop width is the length of the area on the physical surface that you want the scene content to fill. For simplicity, the sample assumes a scene width of 800 meters and physical size of 1 meter.
-
-## Relevant API
-
-* ARSceneView
-* Surface
-
-## Offline data
-
-This sample uses offline data, available as an [item on ArcGIS Online](https://www.arcgis.com/home/item.html?id=7dd2f97bb007466ea939160d0de96a9d).
-
-## About the data
-
-This sample uses the [Philadelphia Mobile Scene Package](https://www.arcgis.com/home/item.html?id=7dd2f97bb007466ea939160d0de96a9d). It was chosen because it is a compact scene ideal for tabletop use. Note that tabletop mapping experiences work best with small, focused scenes. The small, focused area with basemap tiles defines a clear boundary for the scene.
-
-## Additional information
-
-**Tabletop AR** is one of three main patterns for working with geographic information in augmented reality. See [Display scenes in augmented reality](https://developers.arcgis.com/net/scenes-3d/display-scenes-in-augmented-reality/) in the guide for more information.
-
-This sample uses the ArcGIS Runtime Toolkit. See [Display scenes in augmented reality](https://developers.arcgis.com/net/scenes-3d/display-scenes-in-augmented-reality/) in the guide to learn about the toolkit and how to add it to your app.
-
-## Tags
-
-augmented reality, drop, mixed reality, model, pin, place, table-top, tabletop
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/DisplayScenesInTabletopAR/readme.metadata.json b/src/Android/Xamarin.Android/Samples/AugmentedReality/DisplayScenesInTabletopAR/readme.metadata.json
deleted file mode 100644
index e90a9014b0..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/DisplayScenesInTabletopAR/readme.metadata.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "category": "Augmented reality",
- "description": "Use augmented reality (AR) to pin a scene to a table or desk for easy exploration.",
- "formal_name": "DisplayScenesInTabletopAR",
- "ignore": false,
- "images": [
- "DisplayScenesInTabletopAR.jpg"
- ],
- "keywords": [
- "augmented reality",
- "drop",
- "mixed reality",
- "model",
- "pin",
- "place",
- "table-top",
- "tabletop"
- ],
- "offline_data": [
- "7dd2f97bb007466ea939160d0de96a9d"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/displayscenesintabletopar.htm"
- ],
- "relevant_apis": [
- "ARSceneView",
- "Surface"
- ],
- "snippets": [
- "../../../Resources/layout/DisplayScenesInTabletopAR.axml",
- "DisplayScenesInTabletopAR.cs"
- ],
- "title": "Display scenes in tabletop AR"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/ExploreScenesInFlyoverAR/ExploreScenesInFlyoverAR.cs b/src/Android/Xamarin.Android/Samples/AugmentedReality/ExploreScenesInFlyoverAR/ExploreScenesInFlyoverAR.cs
deleted file mode 100644
index 328df91310..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/ExploreScenesInFlyoverAR/ExploreScenesInFlyoverAR.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using AndroidX.AppCompat.App;
-using Esri.ArcGISRuntime.ARToolkit;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI;
-using System;
-
-namespace ArcGISRuntimeXamarin.Samples.ExploreScenesInFlyoverAR
-{
- [Activity(ConfigurationChanges =
- Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Explore scenes in flyover AR",
- category: "Augmented reality",
- description: "Use augmented reality (AR) to quickly explore a scene more naturally than you could with a touch or mouse interface.",
- instructions: "When you open the sample, you'll be viewing the scene from above. You can walk around, using your device as a window into the scene. Try moving vertically to get closer to the ground. Touch gestures which ",
- tags: new[] { "augmented reality", "bird's eye", "birds-eye-view", "fly over", "flyover", "mixed reality", "translation factor" })]
- public class ExploreScenesInFlyoverAR : AppCompatActivity
- {
- // Hold references to the UI controls.
- private ARSceneView _arSceneView;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Explore scenes in flyover AR";
-
- CreateLayout();
- }
-
- private void CreateLayout()
- {
- // Create the layout.
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add the AR scene view.
- _arSceneView = new ARSceneView(this);
- layout.AddView(_arSceneView);
-
- SetContentView(layout);
-
- // Request camera permission. Initialize will be called when permissions are granted.
- Initialize();
- }
-
- private async void Initialize()
- {
- // Create the scene.
- Scene flyoverScene = new Scene(new Uri("https://www.arcgis.com/home/item.html?id=76ffb1a9e26b4602a04c209146bf2cd3"));
-
- try
- {
- // Display the scene.
- await flyoverScene.LoadAsync();
- _arSceneView.Scene = flyoverScene;
-
- // Start with the camera at the scenes initial viewpoint.
- Camera originCamera = new Camera(flyoverScene.InitialViewpoint.Camera.Location.Y, flyoverScene.InitialViewpoint.Camera.Location.X, 200, 0, 90, 0);
- _arSceneView.OriginCamera = originCamera;
-
- // set the translation factor to enable rapid movement through the scene.
- _arSceneView.TranslationFactor = 1000;
-
- // Enable atmosphere and space effects for a more immersive experience.
- _arSceneView.SpaceEffect = SpaceEffect.Stars;
- _arSceneView.AtmosphereEffect = AtmosphereEffect.Realistic;
- }
- catch (Exception ex)
- {
- new Android.App.AlertDialog.Builder(this).SetMessage(ex.Message).SetTitle("Error").Show();
- System.Diagnostics.Debug.WriteLine(ex);
- }
- }
-
- protected override async void OnPause()
- {
- base.OnPause();
- await _arSceneView.StopTrackingAsync();
- }
-
- protected override async void OnResume()
- {
- base.OnResume();
-
- // Start AR tracking without location updates.
- await _arSceneView.StartTrackingAsync();
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/ExploreScenesInFlyoverAR/ExploreScenesInFlyoverAR.jpg b/src/Android/Xamarin.Android/Samples/AugmentedReality/ExploreScenesInFlyoverAR/ExploreScenesInFlyoverAR.jpg
deleted file mode 100644
index 2635117540..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/AugmentedReality/ExploreScenesInFlyoverAR/ExploreScenesInFlyoverAR.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/ExploreScenesInFlyoverAR/readme.md b/src/Android/Xamarin.Android/Samples/AugmentedReality/ExploreScenesInFlyoverAR/readme.md
deleted file mode 100644
index 2d9bc2b114..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/ExploreScenesInFlyoverAR/readme.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# Explore scenes in flyover AR
-
-Use augmented reality (AR) to quickly explore a scene more naturally than you could with a touch or mouse interface.
-
-![Scene shown in an app](ExploreScenesInFlyoverAR.jpg)
-
-## Use case
-
-You can use AR to drop into an area and visualize information, like a proposed development or a historical model of a city. You could use flyover AR to explore a city by walking through it virtually.
-
-## How to use the sample
-
-When you open the sample, you'll be viewing the scene from above. You can walk around, using your device as a window into the scene. Try moving vertically to get closer to the ground. Touch gestures which
-
-## How it works
-
-1. Create the `ARSceneView` and add it to the view.
-2. Create the scene, add content, then display it.
-3. When the content you want to view loads, get its center point and use that to create the origin camera for the AR view. Note that the altitude should be set so that all scene content is visible. For a city, a good value might be a bit higher than the tallest building. The sample uses 600 meters in the absence of tall buildings in the sample data.
-4. Set the translation factor so that you can move through the scene easily. With a translation factor of 800, you will move 800 feet in the scene for every foot you move the physical device.
-5. Set the space effect to `Stars` and atmosphere effect to `Realistic` to create an immersive experience.
-
-## Relevant API
-
-* ARSceneView
-
-## About the data
-
-This sample uses a sample [integrated mesh layer](https://www.arcgis.com/home/item.html?id=dbc72b3ebb024c848d89a42fe6387a1b) provided by [Vricon](https://www.vricon.com/). The integrated mesh layer shows an area around the US-Mexico border.
-
-The [world elevation service](https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer) is used to show terrain while the integrated mesh layer loads.
-
-## Additional information
-
-This sample requires a device that is compatible with ARKit.
-
-**Flyover AR** is one of three main patterns for working with geographic information in augmented reality. See the [Display scenes in augmented reality](https://developers.arcgis.com/net/scenes-3d/display-scenes-in-augmented-reality/) for more information.
-
-This sample uses the ArcGIS Runtime Toolkit. See [Display scenes in augmented reality](https://developers.arcgis.com/net/scenes-3d/display-scenes-in-augmented-reality/) in the guide to learn about the toolkit and how to add it to your app.
-
-## Tags
-
-augmented reality, bird's eye, birds-eye-view, fly over, flyover, mixed reality, translation factor
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/ExploreScenesInFlyoverAR/readme.metadata.json b/src/Android/Xamarin.Android/Samples/AugmentedReality/ExploreScenesInFlyoverAR/readme.metadata.json
deleted file mode 100644
index 60f957a9e5..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/ExploreScenesInFlyoverAR/readme.metadata.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "category": "Augmented reality",
- "description": "Use augmented reality (AR) to quickly explore a scene more naturally than you could with a touch or mouse interface.",
- "formal_name": "ExploreScenesInFlyoverAR",
- "ignore": false,
- "images": [
- "ExploreScenesInFlyoverAR.jpg"
- ],
- "keywords": [
- "augmented reality",
- "bird's eye",
- "birds-eye-view",
- "fly over",
- "flyover",
- "mixed reality",
- "translation factor"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/explorescenesinflyoverar.htm"
- ],
- "relevant_apis": [
- "ARSceneView"
- ],
- "snippets": [
- "ExploreScenesInFlyoverAR.cs"
- ],
- "title": "Explore scenes in flyover AR"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/MSLAdjustedARLocationDataSource.cs b/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/MSLAdjustedARLocationDataSource.cs
deleted file mode 100644
index d2304d817e..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/MSLAdjustedARLocationDataSource.cs
+++ /dev/null
@@ -1,188 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.Content;
-using Android.Locations;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Location;
-using System;
-using System.Globalization;
-using System.Threading.Tasks;
-using Location = Esri.ArcGISRuntime.Location.Location;
-
-namespace ArcGISRuntimeXamarin.Samples.NavigateAR
-{
- ///
- /// Custom location data source that allows you to apply an altitude offset in addition to
- /// returning altitude values relative to mean sea level, rather than the WGS84 ellipsoid.
- ///
- public class MslAdjustedARLocationDataSource : LocationDataSource
- {
- public enum AltitudeAdjustmentMode
- {
- GpsRawEllipsoid,
- NmeaParsedMsl
- }
-
- private AltitudeAdjustmentMode _currentMode = AltitudeAdjustmentMode.GpsRawEllipsoid;
-
- // Enable configuration of the altitude mode, adding or removing NMEA listener as needed.
- public AltitudeAdjustmentMode AltitudeMode
- {
- get => _currentMode;
- set
- {
- _currentMode = value;
-
- if (_currentMode == AltitudeAdjustmentMode.NmeaParsedMsl)
- {
- GetLocationManager().AddNmeaListener(_listener, null);
- }
- else
- {
- GetLocationManager().RemoveNmeaListener(_listener);
- }
- }
- }
-
- // Object to handle NMEA messages from the onboard GNSS device.
- private readonly NmeaListener _listener = new NmeaListener();
-
- // Allow setting an altitude offset.
- private double _altitudeOffset;
-
- public double AltitudeOffset
- {
- get => _altitudeOffset;
- set
- {
- _altitudeOffset = value;
-
- // Raise a location changed event if possible.
- if (_lastLocation != null)
- {
- BaseSource_LocationChanged(_baseSource, _lastLocation);
- }
- }
- }
-
- // Track the last location so that a location changed
- // event can be raised when the altitude offset is changed.
- private Location _lastLocation;
-
- public IntPtr Handle => throw new NotImplementedException();
-
- // Track the last elevation received from the GNSS.
- private double _lastNmeaElevation;
-
- // Use the underlying system location data source.
- private readonly SystemLocationDataSource _baseSource;
-
- private readonly Context _context;
-
- public MslAdjustedARLocationDataSource(Context context)
- {
- _context = context;
-
- // Create and listen for updates from a new system location data source.
- _baseSource = new SystemLocationDataSource();
- _baseSource.HeadingChanged += BaseSource_HeadingChanged;
- _baseSource.LocationChanged += BaseSource_LocationChanged;
-
- // Listen for altitude change events from the onboard GNSS.
- _listener.NmeaAltitudeChanged += (o, e) => { _lastNmeaElevation = e.Altitude; };
- }
-
- private void BaseSource_LocationChanged(object sender, Location e)
- {
- // Store the last location to enable raising change events.
- _lastLocation = e;
-
- // Intercept location change events from the base source and either
- // apply an altitude offset, or return the offset altitude from the latest NMEA message.
- MapPoint newPosition = null;
- switch (AltitudeMode)
- {
- case AltitudeAdjustmentMode.GpsRawEllipsoid:
- newPosition = new MapPoint(e.Position.X, e.Position.Y, e.Position.Z + AltitudeOffset,
- e.Position.SpatialReference);
- break;
- case AltitudeAdjustmentMode.NmeaParsedMsl:
- newPosition = new MapPoint(e.Position.X, e.Position.Y, _lastNmeaElevation + AltitudeOffset,
- e.Position.SpatialReference);
- break;
- }
-
- Location newLocation = new Location(newPosition, e.HorizontalAccuracy, e.Velocity, e.Course, e.IsLastKnown);
-
- UpdateLocation(newLocation);
- }
-
- private void BaseSource_HeadingChanged(object sender, double e)
- {
- UpdateHeading(e);
- }
-
- protected override Task OnStartAsync() => _baseSource.StartAsync();
-
- protected override Task OnStopAsync() => _baseSource.StopAsync();
-
- private LocationManager _locationManager;
-
- private LocationManager GetLocationManager()
- {
- return _locationManager ?? (_locationManager = (LocationManager) _context.GetSystemService("location"));
- }
-
- private class NmeaListener : Java.Lang.Object, IOnNmeaMessageListener
- {
- private long _lastTimestamp;
- private double _lastElevation;
-
- public event EventHandler NmeaAltitudeChanged;
-
- public void OnNmeaMessage(string message, long timestamp)
- {
- if (message.StartsWith("$GPGGA") || message.StartsWith("$GNGNS") || message.StartsWith("$GNGGA"))
- {
- var parts = message.Split(',');
-
- if (parts.Length < 10)
- {
- return; // not enough
- }
-
- string mslAltitude = parts[9];
-
- if (string.IsNullOrEmpty(mslAltitude))
- {
- return;
- }
-
-
- if (double.TryParse(mslAltitude, NumberStyles.Float, CultureInfo.InvariantCulture,
- out double altitudeParsed))
- {
- if (timestamp > _lastTimestamp)
- {
- _lastElevation = altitudeParsed;
- _lastTimestamp = timestamp;
- NmeaAltitudeChanged?.Invoke(this, new AltitudeEventArgs {Altitude = _lastElevation});
- }
- }
- }
- }
-
- public class AltitudeEventArgs
- {
- public double Altitude { get; set; }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/NavigateAR.jpg b/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/NavigateAR.jpg
deleted file mode 100644
index f859d354b7..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/NavigateAR.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/RoutePlanner.cs b/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/RoutePlanner.cs
deleted file mode 100644
index e461cc3f75..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/RoutePlanner.cs
+++ /dev/null
@@ -1,251 +0,0 @@
-// Copyright 2021 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android;
-using Android.App;
-using Android.Content;
-using Android.Content.PM;
-using Android.OS;
-using Android.Runtime;
-using Android.Support.V4.App;
-using Android.Support.V4.Content;
-using Android.Widget;
-using AndroidX.AppCompat.App;
-using ArcGISRuntime.Helpers;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.Tasks.NetworkAnalysis;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Linq;
-
-namespace ArcGISRuntimeXamarin.Samples.NavigateAR
-{
- [Activity(ConfigurationChanges =
- ConfigChanges.Orientation | ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Navigate in AR",
- category: "Augmented reality",
- description: "Use a route displayed in the real world to navigate.",
- instructions: "The sample opens with a map centered on the current location. Tap the map to add an origin and a destination; the route will be shown as a line. When ready, click 'Confirm' to start the AR navigation. Calibrate the heading before starting to navigate. When you start, route instructions will be displayed and spoken. As you proceed through the route, new directions will be provided until you arrive.",
- tags: new[] { "augmented reality", "directions", "full-scale", "guidance", "mixed reality", "navigate", "navigation", "real-scale", "route", "routing", "world-scale" })]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("628e8e3521cf45e9a28a12fe10c02c4d")]
- public class NavigateARRoutePlanner : AppCompatActivity
- {
- // Hold references to the UI controls.
- private MapView _mapView;
- private TextView _helpLabel;
- private Button _navigateButton;
-
- // Overlays for showing the stops and calculated route.
- private GraphicsOverlay _routeOverlay;
- private GraphicsOverlay _stopsOverlay;
-
- // Start and end point for the route.
- private MapPoint _startPoint;
- private MapPoint _endPoint;
-
- // Objects for route calculation.
- private RouteTask _routeTask;
- private Route _route;
- private RouteResult _routeResult;
- private RouteParameters _routeParameters;
-
- // URL to the routing service; requires login.
- private readonly Uri _routingUri =
- new Uri("https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World");
-
- // Permissions and permission request.
- private readonly string[] _requestedPermissions = { Manifest.Permission.AccessFineLocation };
- private const int RequestCode = 35;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Navigate in AR";
-
- CreateLayout();
-
- RequestPermissions();
- }
-
- private void CreateLayout()
- {
- // Create and show the layout.
- SetContentView(ArcGISRuntime.Resource.Layout.NavigateARRoutePlanner);
-
- // Set up control references.
- _helpLabel = FindViewById(ArcGISRuntime.Resource.Id.helpLabel);
- _mapView = FindViewById(ArcGISRuntime.Resource.Id.mapView);
- _navigateButton = FindViewById(ArcGISRuntime.Resource.Id.navigateButton);
- }
-
- private async void Initialize()
- {
- // Create and show a map.
- _mapView.Map = new Map(BasemapStyle.ArcGISImageryStandard);
-
- try
- {
- // Enable location display.
- _mapView.LocationDisplay.AutoPanMode = LocationDisplayAutoPanMode.Recenter;
- await _mapView.LocationDisplay.DataSource.StartAsync();
- _mapView.LocationDisplay.IsEnabled = true;
-
- // Configure authentication.
- ArcGISLoginPrompt.SetChallengeHandler();
-
- // Create the route task.
- _routeTask = await RouteTask.CreateAsync(_routingUri);
-
- // Create route display overlay and symbology.
- _routeOverlay = new GraphicsOverlay();
- SimpleLineSymbol routeSymbol =
- new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.Yellow, 1);
- _routeOverlay.Renderer = new SimpleRenderer(routeSymbol);
-
- // Create stop display overlay.
- _stopsOverlay = new GraphicsOverlay();
-
- // Add the overlays to the map.
- _mapView.GraphicsOverlays.Add(_routeOverlay);
- _mapView.GraphicsOverlays.Add(_stopsOverlay);
-
- // Enable tap-to-place stops.
- _mapView.GeoViewTapped += MapView_GeoViewTapped;
-
- // Update the UI.
- _helpLabel.Text = "Tap to set a start point";
- }
- catch (Exception ex)
- {
- new AndroidX.AppCompat.App.AlertDialog.Builder(this).SetMessage(ex.Message).SetTitle(ex.GetType().Name).Show();
- System.Diagnostics.Debug.WriteLine(ex);
- }
- }
-
- private void MapView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
- {
- if (_startPoint == null)
- {
- // Place the start point.
- _startPoint = e.Location;
- Graphic startGraphic = new Graphic(_startPoint,
- new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Cross, System.Drawing.Color.Green, 25));
- _stopsOverlay.Graphics.Add(startGraphic);
-
- // Update help text.
- _helpLabel.Text = "Tap to set an end point";
- }
- else if (_endPoint == null)
- {
- // Place the end point.
- _endPoint = e.Location;
- Graphic endGraphic = new Graphic(_endPoint,
- new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.X, System.Drawing.Color.Red, 25));
- _stopsOverlay.Graphics.Add(endGraphic);
-
- // Update help text.
- _helpLabel.Text = "Solving route";
-
- // Solve the route.
- SolveRoute();
- }
- }
-
- private void EnableNavigation()
- {
- // Pass the route result to the route viewer.
- RouteViewerAR.PassedRouteResult = _routeResult;
-
- // Configure the UI.
- _navigateButton.Click += NavigateButton_Click;
- _navigateButton.Visibility = Android.Views.ViewStates.Visible;
- _helpLabel.Text = "You're ready to start navigating!";
- }
-
- private void NavigateButton_Click(object sender, EventArgs e)
- {
- // Start the AR navigation activity.
- Intent myIntent = new Intent(this, typeof(RouteViewerAR));
- StartActivity(myIntent);
- }
-
- private async void SolveRoute()
- {
- try
- {
- // Create route parameters and configure them to enable navigation.
- _routeParameters = await _routeTask.CreateDefaultParametersAsync();
- _routeParameters.ReturnStops = true;
- _routeParameters.ReturnDirections = true;
- _routeParameters.ReturnRoutes = true;
-
- // Prefer walking directions if available.
- TravelMode walkingMode =
- _routeTask.RouteTaskInfo.TravelModes.FirstOrDefault(mode => mode.Name.Contains("Walk")) ??
- _routeTask.RouteTaskInfo.TravelModes.First();
- _routeParameters.TravelMode = walkingMode;
-
- // Set the stops for the route.
- Stop stop1 = new Stop(_startPoint);
- Stop stop2 = new Stop(_endPoint);
- _routeParameters.SetStops(new[] { stop1, stop2 });
-
- // Calculate the route.
- _routeResult = await _routeTask.SolveRouteAsync(_routeParameters);
-
- // Get the first result.
- _route = _routeResult.Routes.First();
-
- // Create and show a graphic for the route.
- Graphic routeGraphic = new Graphic(_route.RouteGeometry);
- _routeOverlay.Graphics.Add(routeGraphic);
-
- // Allow the user to start navigating.
- EnableNavigation();
- }
- catch (Exception ex)
- {
- new AndroidX.AppCompat.App.AlertDialog.Builder(this).SetMessage(ex.Message).SetTitle(ex.GetType().Name).Show();
- System.Diagnostics.Debug.WriteLine(ex);
- }
- }
-
- private void RequestPermissions()
- {
- if (ContextCompat.CheckSelfPermission(this, _requestedPermissions[0]) == Permission.Granted)
- {
- Initialize();
- }
- else
- {
- ActivityCompat.RequestPermissions(this, _requestedPermissions, NavigateARRoutePlanner.RequestCode);
- }
- }
-
- public override void OnRequestPermissionsResult(int requestCode, string[] permissions,
- [GeneratedEnum] Permission[] grantResults)
- {
- if (requestCode == NavigateARRoutePlanner.RequestCode && grantResults[0] == Permission.Granted)
- {
- Initialize();
- }
- else
- {
- Toast.MakeText(this, "Location permissions needed for this sample", ToastLength.Short).Show();
- }
-
- base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/RouteViewerAR.cs b/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/RouteViewerAR.cs
deleted file mode 100644
index 3d7a28cfb5..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/RouteViewerAR.cs
+++ /dev/null
@@ -1,304 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Speech.Tts;
-using Android.Views;
-using Android.Widget;
-using ArcGISRuntimeXamarin.Samples.ARToolkit.Controls;
-using Esri.ArcGISRuntime.ARToolkit;
-using Esri.ArcGISRuntime.Location;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Navigation;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.Tasks.NetworkAnalysis;
-using Esri.ArcGISRuntime.UI;
-using System;
-using Surface = Esri.ArcGISRuntime.Mapping.Surface;
-
-namespace ArcGISRuntimeXamarin.Samples.NavigateAR
-{
- [Activity(Label = "RouteViewerAR")]
- public class RouteViewerAR : Activity
- {
- // Hold references to UI controls.
- private ARSceneView _arSceneView;
- private TextView _helpLabel;
- private Button _calibrateButton;
- private Button _navigateButton;
- private View _calibrationView;
- private JoystickSeekBar _headingSlider;
- private JoystickSeekBar _altitudeSlider;
-
- // Static field for sharing route between views.
- public static RouteResult PassedRouteResult;
-
- // Objects for navigation.
- private RouteTracker _routeTracker;
- private TextToSpeech _textToSpeech;
-
- // Scene content.
- private GraphicsOverlay _routeOverlay;
- private ArcGISTiledElevationSource _elevationSource;
- private Surface _elevationSurface;
- private Scene _scene;
-
- // Custom location data source that enables calibration and returns
- // values relative to mean sea level rather than the WGS84 ellipsoid.
- private MslAdjustedARLocationDataSource _locationDataSource;
-
- // Calibration state fields.
- private bool _isCalibrating;
- private double _altitudeOffset;
-
- private bool IsCalibrating
- {
- get => _isCalibrating;
- set
- {
- _isCalibrating = value;
- if (_isCalibrating)
- {
- // Show the surface semitransparent for calibration.
- _scene.BaseSurface.Opacity = 0.5;
- _calibrationView.Visibility = ViewStates.Visible;
- }
- else
- {
- // Hide the scene when not calibrating.
- _scene.BaseSurface.Opacity = 0;
- _calibrationView.Visibility = ViewStates.Gone;
- }
- }
- }
-
- protected override void OnCreate(Bundle savedInstanceState)
- {
- base.OnCreate(savedInstanceState);
-
- if (PassedRouteResult == null)
- {
- ShowMessage("Didn't get route from previous activity", "Can't start", true);
- }
-
- // Create the layout.
- CreateLayout();
-
- // Configure the AR scene view.
- Initialize();
- }
-
- private void CreateLayout()
- {
- // Load the view.
- SetContentView(ArcGISRuntime.Resource.Layout.NavigateARNavigator);
-
- // Set up control references.
- _arSceneView = FindViewById(ArcGISRuntime.Resource.Id.arView);
- _helpLabel = FindViewById(ArcGISRuntime.Resource.Id.helpLabel);
- _calibrateButton = FindViewById(ArcGISRuntime.Resource.Id.calibrateButton);
- _navigateButton = FindViewById(ArcGISRuntime.Resource.Id.navigateStartButton);
- _calibrationView = FindViewById(ArcGISRuntime.Resource.Id.calibrationView);
- _headingSlider = FindViewById(ArcGISRuntime.Resource.Id.headingJoystick);
- _altitudeSlider = FindViewById(ArcGISRuntime.Resource.Id.altitudeJoystick);
-
- // Create the custom location data source and configure the AR scene view to use it.
- _locationDataSource = new MslAdjustedARLocationDataSource(this);
- _locationDataSource.AltitudeMode = MslAdjustedARLocationDataSource.AltitudeAdjustmentMode.NmeaParsedMsl;
- _arSceneView.LocationDataSource = _locationDataSource;
-
- // Listen for location changes to enable route tracking.
- _locationDataSource.LocationChanged += LocationDataSource_LocationChanged;
-
- // Disable plane rendering and visualization.
- _arSceneView.ArSceneView.PlaneRenderer.Enabled = false;
- _arSceneView.ArSceneView.PlaneRenderer.Visible = false;
-
- // Configure button click events.
- _navigateButton.Click += (o, e) => StartTurnByTurn();
- _calibrateButton.Click += (o, e) => IsCalibrating = !IsCalibrating;
-
- // Configure calibration sliders.
- _headingSlider.DeltaProgressChanged += HeadingSlider_DeltaProgressChanged;
- _altitudeSlider.DeltaProgressChanged += AltitudeSlider_DeltaProgressChanged;
- }
-
- private void AltitudeSlider_DeltaProgressChanged(object sender, DeltaChangedEventArgs e)
- {
- // Add the new value to the existing altitude offset.
- _altitudeOffset += e.DeltaProgress;
-
- // Update the altitude offset on the custom location data source.
- _locationDataSource.AltitudeOffset = _altitudeOffset;
- }
-
- private void HeadingSlider_DeltaProgressChanged(object sender, DeltaChangedEventArgs e)
- {
- // Get the old camera.
- Camera camera = _arSceneView.OriginCamera;
-
- // Calculate the new heading by applying the offset to the old camera's heading.
- double heading = camera.Heading + e.DeltaProgress;
-
- // Create a new camera by rotating the old camera to the new heading.
- Camera newCamera = camera.RotateTo(heading, camera.Pitch, camera.Roll);
-
- // Use the new camera as the origin camera.
- _arSceneView.OriginCamera = newCamera;
- }
-
- private async void LocationDataSource_LocationChanged(object sender, Location e)
- {
- if (_routeTracker != null)
- {
- try
- {
- // Pass location change to the route tracker.
- await _routeTracker.TrackLocationAsync(e);
- }
- catch (Exception ex)
- {
- ShowMessage("Failed to update current location", "error");
- System.Diagnostics.Debug.WriteLine(ex);
- }
- }
- }
-
- private void Initialize()
- {
- Toast.MakeText(this,
- "Calibrate your heading before navigating!",
- ToastLength.Long).Show();
-
- // Create the scene and show it.
- _scene = new Scene(BasemapStyle.ArcGISImageryStandard);
- _arSceneView.Scene = _scene;
-
- // Create and add the elevation surface.
- _elevationSource = new ArcGISTiledElevationSource(new Uri(
- "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"));
- _elevationSurface = new Surface();
- _elevationSurface.ElevationSources.Add(_elevationSource);
- _arSceneView.Scene.BaseSurface = _elevationSurface;
-
- // Hide the surface in AR.
- _elevationSurface.NavigationConstraint = NavigationConstraint.None;
- _elevationSurface.Opacity = 0;
-
- // Create and add a graphics overlay for showing routes.
- _routeOverlay = new GraphicsOverlay();
- _arSceneView.GraphicsOverlays.Add(_routeOverlay);
-
- // Configure the graphics overlay to render graphics as yellow 3D tubes.
- SolidStrokeSymbolLayer strokeSymbolLayer = new SolidStrokeSymbolLayer(1, System.Drawing.Color.Yellow, null,
- StrokeSymbolLayerLineStyle3D.Tube);
- strokeSymbolLayer.CapStyle = StrokeSymbolLayerCapStyle.Round;
- MultilayerPolylineSymbol tubeSymbol = new MultilayerPolylineSymbol(new[] {strokeSymbolLayer});
- _routeOverlay.Renderer = new SimpleRenderer(tubeSymbol);
-
- // Configure the space and atmosphere effects for AR.
- _arSceneView.SpaceEffect = SpaceEffect.None;
- _arSceneView.AtmosphereEffect = AtmosphereEffect.None;
-
- // Set up the route graphic.
- SetRoute(PassedRouteResult.Routes[0]);
- }
-
- private void SetRoute(Route inputRoute)
- {
- // Clear any existing route graphics.
- _routeOverlay.Graphics.Clear();
-
- // Create a new route graphic and show it in the view.
- Graphic routeGraphic = new Graphic(inputRoute.RouteGeometry);
- _routeOverlay.Graphics.Add(routeGraphic);
-
- // Configure the overlay to show routes 3 meters above the ground.
- _routeOverlay.SceneProperties.SurfacePlacement = SurfacePlacement.Relative;
- _routeOverlay.SceneProperties.AltitudeOffset = 3;
- }
-
- private void StartTurnByTurn()
- {
- // Create the route tracker.
- _routeTracker = new RouteTracker(PassedRouteResult, 0, true);
-
- // Create the speech synthesizer.
- _textToSpeech = new TextToSpeech(this, null, "com.google.android.tts");
-
- // Listen for updated guidance.
- _routeTracker.NewVoiceGuidance += RouteTracker_VoiceGuidanceChanged;
- _routeTracker.TrackingStatusChanged += RouteTracker_TrackingStatusChanged;
-
- // Prevent re-navigating.
- _navigateButton.Enabled = false;
- }
-
- private void RouteTracker_TrackingStatusChanged(object sender, RouteTrackerTrackingStatusChangedEventArgs e)
- {
- RunOnUiThread(() =>
- {
- // Update the help label with new guidance.
- _helpLabel.Text = _routeTracker.GenerateVoiceGuidance().Text;
- });
- }
-
- private void RouteTracker_VoiceGuidanceChanged(object sender, RouteTrackerNewVoiceGuidanceEventArgs e)
- {
- RunOnUiThread(() =>
- {
- // Update the help label with the new guidance.
- _helpLabel.Text = e.VoiceGuidance.Text;
-
- // Stop any currently running speech.
- _textToSpeech.Stop();
-
- // Speak the new guidance.
- _textToSpeech.Speak(e.VoiceGuidance.Text, QueueMode.Flush, null, null);
- });
- }
-
- private void ShowMessage(string message, string title, bool closeApp = false)
- {
- // Show a message and then exit after if needed.
- var dialog = new AlertDialog.Builder(this).SetMessage(message).SetTitle(title).Create();
- if (closeApp)
- {
- dialog.SetButton("OK", (o, e) => { Finish(); });
- }
-
- dialog.Show();
- }
-
- protected override async void OnPause()
- {
- base.OnPause();
- await _arSceneView.StopTrackingAsync();
- }
-
- protected override async void OnResume()
- {
- base.OnResume();
-
- // Start AR tracking without location updates.
- await _arSceneView.StartTrackingAsync(ARLocationTrackingMode.Continuous);
- }
-
- protected override void OnDestroy()
- {
- base.OnDestroy();
- if (_routeTracker != null)
- {
- _routeTracker.NewVoiceGuidance -= RouteTracker_VoiceGuidanceChanged;
- _routeTracker.TrackingStatusChanged -= RouteTracker_TrackingStatusChanged;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/readme.md b/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/readme.md
deleted file mode 100644
index e286c25775..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/readme.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# Navigate in AR
-
-Use a route displayed in the real world to navigate.
-
-![Route directions shown overlaid onto a real-world camera feed](NavigateAR.jpg)
-
-## Use case
-
-It can be hard to navigate using 2D maps in unfamiliar environments. You can use real-scale AR to show a route overlaid on the real-world for easier navigation.
-
-## How to use the sample
-
-The sample opens with a map centered on the current location. Tap the map to add an origin and a destination; the route will be shown as a line. When ready, click 'Confirm' to start the AR navigation. Calibrate the heading before starting to navigate. When you start, route instructions will be displayed and spoken. As you proceed through the route, new directions will be provided until you arrive.
-
-## How it works
-
-1. The map page is used to plan the route before starting the AR experience. See the *Find a route* and *Offline routing* samples for a more focused demonstration of that workflow.
-2. Pass the resulting `RouteResult` to the view used for the AR portion of the navigation experience.
-3. Start ARKit tracking with continuous location updates when the AR view is shown.
- * The sample uses a custom location data source that allows you to apply an altitude offset. The altitude reported by the system location data source is often off by tens of meters.
-4. Get the route geometry from the first route in the `RouteResult`. Display the route in an overlay configured to show graphics offset from the surface with `Relative` surface placement mode.
-5. Add the route geometry to a graphics overlay and add a renderer to the graphics overlay. This sample uses a `MultilayerPolylineSymbol` with a `SolidStrokeSymbolLayer` to visualize a tube along the route line.
-6. Create a calibration view. This sample uses a slider to manipulate the heading (direction you are facing). Because of limitations in on-device compasses, calibration is often necessary; small errors in heading cause big problems with the placement of scene content in the world.
- * Note that while this sample implemented a slider, there are many possible strategies for implementing heading calibration.
- * While calibrating, the basemap is shown at 50% opacity, to allow you to compare the basemap imagery with what is seen by the camera. While this works in some environments, it won't work indoors, in forested areas, or if the ground truth has changed since the basemap imagery was updated. Alternative scenarios can involve orienting relative to landmarks (for example, stage sets at a concert) or starting at a known orientation by lining up with a static image.
- * The slider in the sample implements a 'joystick' interaction; the heading is adjusted faster the further you move from the center of the slider. There are many possible slider interactions you could choose to implement.
-7. When the user starts navigating, create a `RouteTracker`, providing a `RouteResult` and the index of the route you want to use; this sample always picks the first returned result.
-8. Create a location data source and listen for location change events. When the location changes, call `routeTracker.TrackLocation` with the updated location.
-9. Keep the calibration view accessible throughout the navigation experience. As the user walks, small heading errors may become more noticeable and require recalibration.
-
-## Relevant API
-
-* ARSceneView
-* GeometryEngine
-* LocationDataSource
-* RouteResult
-* RouteTask
-* RouteTracker
-* Surface
-
-## About the data
-
-This sample uses Esri's [world elevation service](https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer) to ensure that route lines are placed appropriately in the 3D space. It uses the [world routing service](https://www.arcgis.com/home/item.html?id=1feb41652c5c4bd2ba5c60df2b4ea2c4) to calculate routes. The world routing service requires authentication and does consume ArcGIS Online credits.
-
-## Additional information
-
-This sample requires a device that is compatible with ARCore.
-
-Unlike other scene samples, there's no need for a basemap while navigating, because context is provided by the camera feed showing the real environment. The base surface's opacity is set to zero to prevent it from interfering with the AR experience. During calibration, the basemap is shown at 50% opacity to help the user verify that they have calibrated properly.
-
-A digital elevation model is used to ensure that the displayed route is positioned appropriately relative to the terrain of the route. If you don't want to display the route line floating, you could show the line draped on the surface instead.
-
-**Real-scale AR** is one of three main patterns for working with geographic information in augmented reality. See [Display scenes in augmented reality](https://developers.arcgis.com/net/scenes-3d/display-scenes-in-augmented-reality/) in the guide for more information.
-
-Because most navigation scenarios involve traveling beyond the accurate range for ARKit positioning, this sample relies on **continuous location updates** from the location data source. Because the origin camera is constantly being reset by the location data source, the sample doesn't allow the user to pan to calibrate or adjust the altitude with a slider. The location data source doesn't provide a heading, so it isn't overwritten when the location refreshes.
-
-## Tags
-
-augmented reality, directions, full-scale, guidance, mixed reality, navigate, navigation, real-scale, route, routing, world-scale
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/readme.metadata.json b/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/readme.metadata.json
deleted file mode 100644
index e63e923e12..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/NavigateAR/readme.metadata.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "category": "Augmented reality",
- "description": "Use a route displayed in the real world to navigate.",
- "formal_name": "NavigateAR",
- "ignore": false,
- "images": [
- "NavigateAR.jpg"
- ],
- "keywords": [
- "augmented reality",
- "directions",
- "full-scale",
- "guidance",
- "mixed reality",
- "navigate",
- "navigation",
- "real-scale",
- "route",
- "routing",
- "world-scale"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/navigatear.htm"
- ],
- "relevant_apis": [
- "ARSceneView",
- "GeometryEngine",
- "LocationDataSource",
- "RouteResult",
- "RouteTask",
- "RouteTracker",
- "Surface"
- ],
- "snippets": [
- "../../../Controls/JoystickSeekBar.cs",
- "../../../Helpers/ArcGISLoginPrompt.cs",
- "../../../Resources/layout/NavigateARNavigator.axml",
- "../../../Resources/layout/NavigateARRoutePlanner.axml",
- "../../../Resources/values/Attrs.xml",
- "MSLAdjustedARLocationDataSource.cs",
- "RoutePlanner.cs",
- "RouteViewerAR.cs"
- ],
- "title": "Navigate in AR"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/MSLAdjustedARLocationDataSource.cs b/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/MSLAdjustedARLocationDataSource.cs
deleted file mode 100644
index 56c445fa63..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/MSLAdjustedARLocationDataSource.cs
+++ /dev/null
@@ -1,188 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.Content;
-using Android.Locations;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Location;
-using System;
-using System.Globalization;
-using System.Threading.Tasks;
-using Location = Esri.ArcGISRuntime.Location.Location;
-
-namespace ArcGISRuntimeXamarin.Samples.ViewHiddenInfrastructureAR
-{
- ///
- /// Custom location data source that allows you to apply an altitude offset in addition to
- /// returning altitude values relative to mean sea level, rather than the WGS84 ellipsoid.
- ///
- public class MslAdjustedARLocationDataSource : LocationDataSource
- {
- public enum AltitudeAdjustmentMode
- {
- GpsRawEllipsoid,
- NmeaParsedMsl
- }
-
- private AltitudeAdjustmentMode _currentMode = AltitudeAdjustmentMode.GpsRawEllipsoid;
-
- // Enable configuration of the altitude mode, adding or removing NMEA listener as needed.
- public AltitudeAdjustmentMode AltitudeMode
- {
- get => _currentMode;
- set
- {
- _currentMode = value;
-
- if (_currentMode == AltitudeAdjustmentMode.NmeaParsedMsl)
- {
- GetLocationManager().AddNmeaListener(_listener, null);
- }
- else
- {
- GetLocationManager().RemoveNmeaListener(_listener);
- }
- }
- }
-
- // Object to handle NMEA messages from the onboard GNSS device.
- private readonly NmeaListener _listener = new NmeaListener();
-
- // Allow setting an altitude offset.
- private double _altitudeOffset;
-
- public double AltitudeOffset
- {
- get => _altitudeOffset;
- set
- {
- _altitudeOffset = value;
-
- // Raise a location changed event if possible.
- if (_lastLocation != null)
- {
- BaseSource_LocationChanged(_baseSource, _lastLocation);
- }
- }
- }
-
- // Track the last location so that a location changed
- // event can be raised when the altitude offset is changed.
- private Location _lastLocation;
-
- public IntPtr Handle => throw new NotImplementedException();
-
- // Track the last elevation received from the GNSS.
- private double _lastNmeaElevation;
-
- // Use the underlying system location data source.
- private readonly SystemLocationDataSource _baseSource;
-
- private readonly Context _context;
-
- public MslAdjustedARLocationDataSource(Context context)
- {
- _context = context;
-
- // Create and listen for updates from a new system location data source.
- _baseSource = new SystemLocationDataSource();
- _baseSource.HeadingChanged += BaseSource_HeadingChanged;
- _baseSource.LocationChanged += BaseSource_LocationChanged;
-
- // Listen for altitude change events from the onboard GNSS.
- _listener.NmeaAltitudeChanged += (o, e) => { _lastNmeaElevation = e.Altitude; };
- }
-
- private void BaseSource_LocationChanged(object sender, Location e)
- {
- // Store the last location to enable raising change events.
- _lastLocation = e;
-
- // Intercept location change events from the base source and either
- // apply an altitude offset, or return the offset altitude from the latest NMEA message.
- MapPoint newPosition = null;
- switch (AltitudeMode)
- {
- case AltitudeAdjustmentMode.GpsRawEllipsoid:
- newPosition = new MapPoint(e.Position.X, e.Position.Y, e.Position.Z + AltitudeOffset,
- e.Position.SpatialReference);
- break;
- case AltitudeAdjustmentMode.NmeaParsedMsl:
- newPosition = new MapPoint(e.Position.X, e.Position.Y, _lastNmeaElevation + AltitudeOffset,
- e.Position.SpatialReference);
- break;
- }
-
- Location newLocation = new Location(newPosition, e.HorizontalAccuracy, e.Velocity, e.Course, e.IsLastKnown);
-
- UpdateLocation(newLocation);
- }
-
- private void BaseSource_HeadingChanged(object sender, double e)
- {
- UpdateHeading(e);
- }
-
- protected override Task OnStartAsync() => _baseSource.StartAsync();
-
- protected override Task OnStopAsync() => _baseSource.StopAsync();
-
- private LocationManager _locationManager;
-
- private LocationManager GetLocationManager()
- {
- return _locationManager ?? (_locationManager = (LocationManager) _context.GetSystemService("location"));
- }
-
- private class NmeaListener : Java.Lang.Object, IOnNmeaMessageListener
- {
- private long _lastTimestamp;
- private double _lastElevation;
-
- public event EventHandler NmeaAltitudeChanged;
-
- public void OnNmeaMessage(string message, long timestamp)
- {
- if (message.StartsWith("$GPGGA") || message.StartsWith("$GNGNS") || message.StartsWith("$GNGGA"))
- {
- var parts = message.Split(',');
-
- if (parts.Length < 10)
- {
- return; // not enough
- }
-
- string mslAltitude = parts[9];
-
- if (string.IsNullOrEmpty(mslAltitude))
- {
- return;
- }
-
-
- if (double.TryParse(mslAltitude, NumberStyles.Float, CultureInfo.InvariantCulture,
- out double altitudeParsed))
- {
- if (timestamp > _lastTimestamp)
- {
- _lastElevation = altitudeParsed;
- _lastTimestamp = timestamp;
- NmeaAltitudeChanged?.Invoke(this, new AltitudeEventArgs {Altitude = _lastElevation});
- }
- }
- }
- }
-
- public class AltitudeEventArgs
- {
- public double Altitude { get; set; }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/PipePlacer.cs b/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/PipePlacer.cs
deleted file mode 100644
index 7700f121cf..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/PipePlacer.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.Content;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Linq;
-
-namespace ArcGISRuntimeXamarin.Samples.ViewHiddenInfrastructureAR
-{
- [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "View hidden infrastructure in AR",
- category: "Augmented reality",
- description: "Visualize hidden infrastructure in its real-world location using augmented reality.",
- instructions: "When you open the sample, you'll see a map centered on your current location. Use the tools to draw pipes around your location. An elevation surface will be queried to place the drawn infrastructure above or below ground. When you're ready, use the button to view the infrastructure you drew in AR.",
- tags: new[] { "augmented reality", "full-scale", "infrastructure", "lines", "mixed reality", "pipes", "real-scale", "underground", "visualization", "visualize", "world-scale" })]
- public class PipePlacer : Activity
- {
- // Hold references to the UI controls.
- private MapView _mapView;
- private Button _addButton;
- private Button _undoButton;
- private Button _redoButton;
- private Button _doneButton;
- private Button _viewButton;
- private SeekBar _elevationSlider;
- private TextView _helpLabel;
-
- // Graphics overlays for showing pipes.
- private GraphicsOverlay _pipesOverlay = new GraphicsOverlay();
-
- // Sketch editor for drawing pipes onto the MapView.
- private SketchEditor _sketchEditor = new SketchEditor();
-
- // Elevation source for getting altitude value for points.
- private ArcGISTiledElevationSource _elevationSource;
- private Surface _elevationSurface;
-
- private async void Initialize()
- {
- // Create and add the map.
- _mapView.Map = new Map(BasemapStyle.ArcGISImageryStandard);
-
- // Configure location display.
- _mapView.LocationDisplay.AutoPanMode = LocationDisplayAutoPanMode.Recenter;
- await _mapView.LocationDisplay.DataSource.StartAsync();
- _mapView.LocationDisplay.IsEnabled = true;
-
- // Add a graphics overlay for the drawn pipes.
- _mapView.GraphicsOverlays.Add(_pipesOverlay);
- _pipesOverlay.Renderer = new SimpleRenderer(new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.Red, 2));
-
- // Set the SketchEditor for the map.
- _mapView.SketchEditor = _sketchEditor;
-
- // Create an elevation source and Surface.
- _elevationSource = new ArcGISTiledElevationSource(new Uri("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"));
- await _elevationSource.LoadAsync();
- _elevationSurface = new Surface();
- _elevationSurface.ElevationSources.Add(_elevationSource);
- await _elevationSurface.LoadAsync();
-
- // Enable the add button.
- _addButton.Enabled = true;
- }
-
- private void DoneClicked(object sender, EventArgs e)
- {
- // Check if sketch can be completed.
- if (_mapView.SketchEditor.CompleteCommand.CanExecute(null))
- {
- // Complete the sketch.
- _mapView.SketchEditor.CompleteCommand.Execute(null);
-
- // Disable the editing buttons.
- _doneButton.Enabled = _undoButton.Enabled = _redoButton.Enabled = false;
- }
- }
-
- private async void AddSketch(object sender, EventArgs e)
- {
- // Enable the editing buttons.
- _doneButton.Enabled = _undoButton.Enabled = _redoButton.Enabled = true;
-
- // Prevent the user from adding pipes concurrently.
- _addButton.Enabled = false;
-
- // Get the geometry of the user drawn line.
- Geometry geometry = await _sketchEditor.StartAsync(SketchCreationMode.Polyline);
- _addButton.Enabled = true;
-
- // Verify that the user has drawn a polyline.
- if (!(geometry is Polyline))
- {
- return;
- }
-
- // Get the first point of the pipe.
- MapPoint firstPoint = ((Polyline)geometry).Parts[0].StartPoint;
- try
- {
- // Get the users selected elevation offset.
- int elevationOffset = _elevationSlider.Progress;
-
- // Get the elevation of the geometry from the first point of the pipe.
- double elevation = await _elevationSurface.GetElevationAsync(firstPoint);
-
- // Create a polyline for the pipe at the selected altitude.
- Polyline elevatedLine = GeometryEngine.SetZ(geometry, elevation + elevationOffset) as Polyline;
-
- // Create a graphic for the pipe.
- Graphic linegraphic = new Graphic(elevatedLine);
- _pipesOverlay.Graphics.Add(linegraphic);
-
- // Display a message with the pipes offset from the surface.
- if (elevationOffset < 0)
- {
- _helpLabel.Text = string.Format("Pipe added {0:0.0}m below surface", elevationOffset * -1);
- }
- else if (elevationOffset == 0)
- {
- _helpLabel.Text = "Pipe added at ground level";
- }
- else
- {
- _helpLabel.Text = string.Format("Pipe added {0:0.0}m above the surface", elevationOffset);
- }
-
- // Enable the view button once a pipe has been added to the graphics overlay.
- _viewButton.Enabled = true;
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.Message);
- }
- }
-
- private void ViewClicked(object sender, EventArgs e)
- {
- // Set the field for sharing data between views.
- PipeViewer.PipeGraphics = _pipesOverlay.Graphics.Select(x => new Graphic(x.Geometry));
-
- // Start the AR viewer activity.
- Intent myIntent = new Intent(this, typeof(PipeViewer));
- StartActivity(myIntent);
- }
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "View hidden infrastructure in AR";
-
- // Create the UI
- CreateLayout();
-
- // Initialize controls, set up event handlers, etc.
- Initialize();
- }
-
- private void CreateLayout()
- {
- // Create and show the layout.
- SetContentView(ArcGISRuntime.Resource.Layout.ViewHiddenARPipePlacer);
-
- // Set up control references.
- _addButton = FindViewById(ArcGISRuntime.Resource.Id.addButton);
- _undoButton = FindViewById(ArcGISRuntime.Resource.Id.undoButton);
- _redoButton = FindViewById(ArcGISRuntime.Resource.Id.redoButton);
- _doneButton = FindViewById(ArcGISRuntime.Resource.Id.doneButton);
- _viewButton = FindViewById(ArcGISRuntime.Resource.Id.viewButton);
- _elevationSlider = FindViewById(ArcGISRuntime.Resource.Id.elevationSlider);
-
- _helpLabel = FindViewById(ArcGISRuntime.Resource.Id.statusLabel);
- _mapView = FindViewById(ArcGISRuntime.Resource.Id.MapView);
-
- _addButton.Click += AddSketch;
- _undoButton.Click += (s, e) => { if (_mapView.SketchEditor.UndoCommand.CanExecute(null)) _mapView.SketchEditor.UndoCommand.Execute(null); };
- _redoButton.Click += (s, e) => { if (_mapView.SketchEditor.RedoCommand.CanExecute(null)) _mapView.SketchEditor.RedoCommand.Execute(null); };
- _doneButton.Click += DoneClicked;
- _viewButton.Click += ViewClicked;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/PipeViewer.cs b/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/PipeViewer.cs
deleted file mode 100644
index fb70474031..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/PipeViewer.cs
+++ /dev/null
@@ -1,262 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using ArcGISRuntimeXamarin.Samples.ARToolkit.Controls;
-using Esri.ArcGISRuntime.ARToolkit;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using System;
-using System.Collections.Generic;
-using Surface = Esri.ArcGISRuntime.Mapping.Surface;
-
-namespace ArcGISRuntimeXamarin.Samples.ViewHiddenInfrastructureAR
-{
- [Activity(Label = "PipeViewer")]
- public class PipeViewer : Activity
- {
- // Pipe graphics that have been passed in by the PipePlacer class.
- public static IEnumerable PipeGraphics;
-
- // Hold references to UI controls.
- private ARSceneView _arView;
- private TextView _helpLabel;
- private Button _calibrateButton;
- private Button _localButton;
- private Button _roamingButton;
- private View _calibrationView;
- private JoystickSeekBar _headingSlider;
- private JoystickSeekBar _altitudeSlider;
-
- // Scene content.
- private ArcGISTiledElevationSource _elevationSource;
- private Surface _elevationSurface;
-
- // Track when user is changing between AR and GPS localization.
- private bool _changingScale;
-
- // Custom location data source that enables calibration and returns
- // values relative to mean sea level rather than the WGS84 ellipsoid.
- private MslAdjustedARLocationDataSource _locationSource;
-
- // Calibration state fields.
- private bool _isCalibrating;
- private double _altitudeOffset;
-
- private bool IsCalibrating
- {
- get => _isCalibrating;
- set
- {
- _isCalibrating = value;
- if (_isCalibrating)
- {
- // Show the base surface so that the user can calibrate using the base surface on top of the real world.
- _arView.Scene.BaseSurface.Opacity = 0.5;
-
- // Enable scene interaction.
- _arView.InteractionOptions.IsEnabled = true;
-
- // Show the calibration controls.
- _calibrationView.Visibility = ViewStates.Visible;
- }
- else
- {
- // Hide the base surface.
- _arView.Scene.BaseSurface.Opacity = 0;
-
- // Disable scene interaction.
- _arView.InteractionOptions.IsEnabled = false;
-
- // Hide the calibration controls.
- _calibrationView.Visibility = ViewStates.Gone;
- }
- }
- }
-
- private async void RealScaleValueChanged(bool roaming)
- {
- // Prevent this from being called concurrently
- if (_changingScale)
- {
- return;
- }
- _changingScale = true;
-
- // Disable the associated UI controls while switching.
- _roamingButton.Enabled = false;
- _localButton.Enabled = false;
-
- // Check if using roaming for AR location mode.
- if (roaming)
- {
- await _arView.StopTrackingAsync();
-
- // Start AR tracking using a continuous GPS signal.
- await _arView.StartTrackingAsync(ARLocationTrackingMode.Continuous);
- _altitudeSlider.Enabled = true;
- _localButton.Enabled = true;
- _helpLabel.Text = "Using GPS signal";
- }
- else
- {
- await _arView.StopTrackingAsync();
-
- // Start AR tracking without using a GPS signal.
- await _arView.StartTrackingAsync(ARLocationTrackingMode.Ignore);
- _altitudeSlider.Enabled = false;
- _roamingButton.Enabled = true;
- _helpLabel.Text = "Using ARCore only";
- }
- _changingScale = false;
- }
-
- private void Initialize()
- {
- // Create and add the scene.
- _arView.Scene = new Scene(BasemapStyle.ArcGISImageryStandard);
-
- // Add the location data source to the AR view.
- _arView.LocationDataSource = _locationSource;
-
- // Create and add the elevation source.
- _elevationSource = new ArcGISTiledElevationSource(new Uri("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"));
- _elevationSurface = new Surface();
- _elevationSurface.ElevationSources.Add(_elevationSource);
- _arView.Scene.BaseSurface = _elevationSurface;
-
- // Configure the surface for AR: no navigation constraint and hidden by default.
- _elevationSurface.NavigationConstraint = NavigationConstraint.None;
- _elevationSurface.Opacity = 0;
-
- // Create a graphics overlay for the pipes.
- GraphicsOverlay pipesOverlay = new GraphicsOverlay();
-
- // Use absolute surface placement to see the graphics at the correct altitude.
- pipesOverlay.SceneProperties.SurfacePlacement = SurfacePlacement.Absolute;
-
- // Add graphics for the pipes.
- pipesOverlay.Graphics.AddRange(PipeGraphics);
-
- // Display routes as red 3D tubes.
- SolidStrokeSymbolLayer strokeSymbolLayer = new SolidStrokeSymbolLayer(0.3, System.Drawing.Color.Red, null, StrokeSymbolLayerLineStyle3D.Tube) { CapStyle = StrokeSymbolLayerCapStyle.Round };
- MultilayerPolylineSymbol tubeSymbol = new MultilayerPolylineSymbol(new[] { strokeSymbolLayer });
- pipesOverlay.Renderer = new SimpleRenderer(tubeSymbol);
-
- // Configure scene view display for real-scale AR: no space effect or atmosphere effect.
- _arView.SpaceEffect = SpaceEffect.None;
- _arView.AtmosphereEffect = AtmosphereEffect.None;
-
- // Add the graphics overlay to the scene.
- _arView.GraphicsOverlays.Add(pipesOverlay);
-
- // Disable scene interaction.
- _arView.InteractionOptions = new SceneViewInteractionOptions() { IsEnabled = false };
-
- // Enable the calibration button.
- _calibrateButton.Enabled = true;
- }
-
- protected override void OnCreate(Bundle savedInstanceState)
- {
- base.OnCreate(savedInstanceState);
-
- if (PipeGraphics == null)
- {
- // Show a message and then exit after if needed.
- var dialog = new AlertDialog.Builder(this).SetMessage("Didn't get data from previous activity").SetTitle("Can't start").Create();
- dialog.SetButton("OK", (o, e) => { Finish(); });
- dialog.Show();
- }
-
- // Create the layout.
- CreateLayout();
-
- // Configure the AR scene view.
- Initialize();
- }
-
- private void CreateLayout()
- {
- // Load the view.
- SetContentView(ArcGISRuntime.Resource.Layout.ViewHiddenARPipeViewer);
-
- // Set up control references.
- _arView = FindViewById(ArcGISRuntime.Resource.Id.arView);
- _helpLabel = FindViewById(ArcGISRuntime.Resource.Id.helpLabel);
- _calibrateButton = FindViewById(ArcGISRuntime.Resource.Id.calibrateButton);
- _roamingButton = FindViewById(ArcGISRuntime.Resource.Id.roamingButton);
- _localButton = FindViewById(ArcGISRuntime.Resource.Id.localButton);
-
- _calibrationView = FindViewById(ArcGISRuntime.Resource.Id.calibrationView);
- _headingSlider = FindViewById(ArcGISRuntime.Resource.Id.headingJoystick);
- _altitudeSlider = FindViewById(ArcGISRuntime.Resource.Id.altitudeJoystick);
-
- // Create the custom location data source and configure the AR scene view to use it.
- _locationSource = new MslAdjustedARLocationDataSource(this);
- _locationSource.AltitudeMode = MslAdjustedARLocationDataSource.AltitudeAdjustmentMode.NmeaParsedMsl;
- _arView.LocationDataSource = _locationSource;
-
- // Disable plane rendering and visualization.
- _arView.ArSceneView.PlaneRenderer.Enabled = false;
- _arView.ArSceneView.PlaneRenderer.Visible = false;
-
- // Configure button click events.
- _calibrateButton.Click += (o, e) => IsCalibrating = !IsCalibrating;
- _roamingButton.Click += (o, e) => RealScaleValueChanged(true);
- _localButton.Click += (o, e) => RealScaleValueChanged(false);
-
- // Configure calibration sliders.
- _headingSlider.DeltaProgressChanged += HeadingSlider_DeltaProgressChanged;
- _altitudeSlider.DeltaProgressChanged += AltitudeSlider_DeltaProgressChanged;
- }
-
- private void AltitudeSlider_DeltaProgressChanged(object sender, DeltaChangedEventArgs e)
- {
- // Add the new value to the existing altitude offset.
- _altitudeOffset += e.DeltaProgress;
-
- // Update the altitude offset on the custom location data source.
- _locationSource.AltitudeOffset = _altitudeOffset;
- }
-
- private void HeadingSlider_DeltaProgressChanged(object sender, DeltaChangedEventArgs e)
- {
- // Get the old camera.
- Camera camera = _arView.OriginCamera;
-
- // Calculate the new heading by applying the offset to the old camera's heading.
- double heading = camera.Heading + e.DeltaProgress;
-
- // Create a new camera by rotating the old camera to the new heading.
- Camera newCamera = camera.RotateTo(heading, camera.Pitch, camera.Roll);
-
- // Use the new camera as the origin camera.
- _arView.OriginCamera = newCamera;
- }
-
- protected override async void OnPause()
- {
- base.OnPause();
- await _arView.StopTrackingAsync();
- }
-
- protected override async void OnResume()
- {
- base.OnResume();
-
- // Start AR tracking without location updates.
- await _arView.StartTrackingAsync(ARLocationTrackingMode.Continuous);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/ViewHiddenInfrastructureAR.jpg b/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/ViewHiddenInfrastructureAR.jpg
deleted file mode 100644
index da81e59ac0..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/ViewHiddenInfrastructureAR.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/readme.md b/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/readme.md
deleted file mode 100644
index 3802742f75..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/readme.md
+++ /dev/null
@@ -1,60 +0,0 @@
-# View hidden infrastructure in AR
-
-Visualize hidden infrastructure in its real-world location using augmented reality.
-
-![Rendering of drawn pipes shown overlaid onto a real-world camera feed](ViewHiddenInfrastructureAR.jpg)
-
-## Use case
-
-You can use AR to 'x-ray' the ground to see pipes, wiring, or other infrastructure that isn't otherwise visible. You could use this feature to trace the flow of water through a building to help identify the source of a leak.
-
-## How to use the sample
-
-When you open the sample, you'll see a map centered on your current location. Use the tools to draw pipes around your location. An elevation surface will be queried to place the drawn infrastructure above or below ground. When you're ready, use the button to view the infrastructure you drew in AR.
-
-There are two calibration modes in the sample: roaming and local. In roaming calibration mode, your position is updated automatically from the location data source every second. Because of that, you can only adjust heading, not position or elevation. This mode is best when working in a large area, where you would travel beyond the useful range of ARKit/ARCore.
-
-When you're ready to take a more precise look at the infrastructure, switch to local calibration mode. In local calibration mode, you can make fine adjustments to location, altitude, and heading to ensure the content is exactly where it should be.
-
-## How it works
-
-1. See the 'Sketch on map' sample to learn how to use the sketch editor for creating graphics.
-2. When you start the AR visualization experience, create and show the `ARSceneView`.
-3. Access the `Scene` property of the AR View and set the space effect `SpaceEffect.None` and the atmosphere effect to `AtmosphereEffect.None`.
-4. Create an elevation source and add it to the scene's base surface. Set the navigation constraint to `NavigationConstraint.None` to allow going underground if needed.
-5. Configure a graphics overlay and renderer for showing the drawn pipes. This sample uses a `SolidStrokeSymbolLayer` with a `MultilayerPolylineSymbol` to draw the pipes as tubes. Add the drawn pipes to the overlay.
-6. Configure the calibration experience.
- * When in roaming (continuous location update) mode, only heading calibration should be enabled. In continuous update mode, the user's calibration is overwritten by sensor-based values every second.
- * When in local mode, the user needs to be able to adjust the heading, altitude, and position; position adjustment is achieved by panning.
- * This sample uses a basemap as a reference during calibration; consider how you will support your user's calibration efforts. A basemap-oriented approach won't work indoors or in areas without readily visible, unchanging features like roads.
-
-## Relevant API
-
-* ARSceneView
-* GraphicsOverlay
-* MultilayerPolylineSymbol
-* SketchEditor
-* SolidStrokeSymbolLayer
-* Surface
-
-## About the data
-
-This sample uses Esri's [world elevation service](https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer) to ensure that the infrastructure you create is accurately placed beneath the ground.
-
-Real-scale AR relies on having data in real-world locations near the user. It isn't practical to provide pre-made data like other Runtime samples, so you must draw your own nearby sample 'infrastructure' prior to starting the AR experience.
-
-## Additional information
-
-This sample requires a device that is compatible with ARKit 1 on iOS or ARCore 1.8 on Android.
-
-Note that unlike other scene samples, a basemap isn't shown most of the time, because the real world provides the context. Only while calibrating is the basemap displayed at 50% opacity, to give the user a visual reference to compare to.
-
-You may notice that pipes you draw underground appear to float more than you would expect. That floating is a normal result of the parallax effect that looks unnatural because you're not used to being able to see underground/obscured objects. Compare the behavior of underground pipes with equivalent pipes drawn above the surface - the behavior is the same, but probably feels more natural above ground because you see similar scenes day-to-day (e.g. utility wires).
-
-**Real-scale AR** is one of three main patterns for working with geographic information in augmented reality. See [Agumented reality](https://developers.arcgis.com/net/scenes-3d/display-scenes-in-augmented-reality/) in the guide for more information.
-
-This sample uses a combination of two location data source modes: continuous update and one-time update, presented as 'roaming' and 'local' calibration modes in the app. The error in the position provided by ARKit/ARCore increases as you move further from the origin, resulting in a poor experience when you move more than a few meters away. The location provided by GPS is more useful over large areas, but not good enough for a convincing AR experience on a small scale. With this sample, you can use 'roaming' mode to maintain good enough accuracy for basic context while navigating a large area. When you want to see a more precise visualization, you can switch to 'local' (ARKit/ARCore-only) mode and manually calibrate for best results.
-
-## Tags
-
-augmented reality, full-scale, infrastructure, lines, mixed reality, pipes, real-scale, underground, visualization, visualize, world-scale
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/readme.metadata.json b/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/readme.metadata.json
deleted file mode 100644
index ac202f0825..0000000000
--- a/src/Android/Xamarin.Android/Samples/AugmentedReality/ViewHiddenInfrastructureAR/readme.metadata.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "category": "Augmented reality",
- "description": "Visualize hidden infrastructure in its real-world location using augmented reality.",
- "formal_name": "ViewHiddenInfrastructureAR",
- "ignore": false,
- "images": [
- "ViewHiddenInfrastructureAR.jpg"
- ],
- "keywords": [
- "augmented reality",
- "full-scale",
- "infrastructure",
- "lines",
- "mixed reality",
- "pipes",
- "real-scale",
- "underground",
- "visualization",
- "visualize",
- "world-scale"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/viewhiddeninfrastructurear.htm"
- ],
- "relevant_apis": [
- "ARSceneView",
- "GraphicsOverlay",
- "MultilayerPolylineSymbol",
- "SketchEditor",
- "SolidStrokeSymbolLayer",
- "Surface"
- ],
- "snippets": [
- "../../../Controls/JoystickSeekBar.cs",
- "../../../Resources/layout/ViewHiddenARPipePlacer.axml",
- "../../../Resources/layout/ViewHiddenARPipeViewer.axml",
- "../../../Resources/values/Attrs.xml",
- "MSLAdjustedARLocationDataSource.cs",
- "PipePlacer.cs",
- "PipeViewer.cs"
- ],
- "title": "View hidden infrastructure in AR"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/AddFeatures/AddFeatures.cs b/src/Android/Xamarin.Android/Samples/Data/AddFeatures/AddFeatures.cs
deleted file mode 100644
index 158a216329..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/AddFeatures/AddFeatures.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-
-namespace ArcGISRuntimeXamarin.Samples.AddFeatures
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Add features",
- category: "Data",
- description: "Add features to a feature layer.",
- instructions: "Tap on a location on the map to add a feature at that location.",
- tags: new[] { "edit", "feature", "online service" })]
- public class AddFeatures : Activity
- {
- // Hold a reference to the MapView.
- private MapView _myMapView;
-
- // URL to the feature service.
- private const string FeatureServiceUrl = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0";
-
- // Hold a reference to the feature table.
- private ServiceFeatureTable _damageFeatureTable;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Add features (feature service)";
-
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create the map with streets basemap.
- _myMapView.Map = new Map(BasemapStyle.ArcGISStreets);
-
- // Create the feature table, referring to the Damage Assessment feature service.
- _damageFeatureTable = new ServiceFeatureTable(new Uri(FeatureServiceUrl));
-
- // Create a feature layer to visualize the features in the table.
- FeatureLayer damageLayer = new FeatureLayer(_damageFeatureTable);
-
- // Add the layer to the map.
- _myMapView.Map.OperationalLayers.Add(damageLayer);
-
- // Listen for user taps on the map - this will select the feature.
- _myMapView.GeoViewTapped += MapView_Tapped;
-
- // Zoom to the United States.
- _myMapView.SetViewpointCenterAsync(new MapPoint(-10800000, 4500000, SpatialReferences.WebMercator), 3e7);
- }
-
- private async void MapView_Tapped(object sender, GeoViewInputEventArgs e)
- {
- try
- {
- // Create the feature.
- ArcGISFeature feature = (ArcGISFeature) _damageFeatureTable.CreateFeature();
-
- // Get the normalized geometry for the tapped location and use it as the feature's geometry.
- MapPoint tappedPoint = (MapPoint) GeometryEngine.NormalizeCentralMeridian(e.Location);
- feature.Geometry = tappedPoint;
-
- // Set feature attributes.
- feature.SetAttributeValue("typdamage", "Minor");
- feature.SetAttributeValue("primcause", "Earthquake");
-
- // Add the feature to the table.
- await _damageFeatureTable.AddFeatureAsync(feature);
-
- // Apply the edits to the service.
- await _damageFeatureTable.ApplyEditsAsync();
-
- // Update the feature to get the updated objectid - a temporary ID is used before the feature is added.
- feature.Refresh();
-
- // Confirm feature addition.
- ShowMessage($"Created feature {feature.Attributes["objectid"]}", "Success!");
- }
- catch (Exception ex)
- {
- ShowMessage(ex.ToString(), "Error adding feature");
- }
- }
-
- private void ShowMessage(string message, string title)
- {
- // Display the message to the user.
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.SetMessage(message).SetTitle(title).Show();
- }
-
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- var layout = new LinearLayout(this) {Orientation = Orientation.Vertical};
-
- // Create the MapView.
- _myMapView = new MapView(this);
-
- // Create the help label.
- TextView helpLabel = new TextView(this);
- helpLabel.Text = "Tap to add features.";
- helpLabel.TextAlignment = TextAlignment.Center;
- helpLabel.Gravity = GravityFlags.Center;
-
- // Add the help label to the layout.
- layout.AddView(helpLabel);
-
- // Add the map view to the layout.
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/AddFeatures/AddFeatures.jpg b/src/Android/Xamarin.Android/Samples/Data/AddFeatures/AddFeatures.jpg
deleted file mode 100644
index a6ab590c50..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/AddFeatures/AddFeatures.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/AddFeatures/readme.md b/src/Android/Xamarin.Android/Samples/Data/AddFeatures/readme.md
deleted file mode 100644
index 69d5b38b5a..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/AddFeatures/readme.md
+++ /dev/null
@@ -1,34 +0,0 @@
-# Add features
-
-Add features to a feature layer.
-
-![Image of adding features](AddFeatures.jpg)
-
-## Use case
-
-An end-user performing a survey may want to add features to the map during the course of their work.
-
-## How to use the sample
-
-Tap on a location on the map to add a feature at that location.
-
-## How it works
-
-A `Feature` instance is added to a `ServiceFeatureTable` which then pushes that new feature to the server.
-
-1. Create a `ServiceFeatureTable` from a URL.
-2. Create a `FeatureLayer` derived from the `ServiceFeatureTable` instance.
-3. Create a `Feature` with attributes and a location using the `ServiceFeatureTable`.
-4. Add the `Feature` to the `ServiceFeatureTable`.
-5. *Apply edits* to the `ServiceFeatureTable` which will upload the new feature to the online service.
-
-## Relevant API
-
-* Feature
-* FeatureEditResult
-* FeatureLayer
-* ServiceFeatureTable
-
-## Tags
-
-edit, feature, online service
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/AddFeatures/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/AddFeatures/readme.metadata.json
deleted file mode 100644
index df4da2004b..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/AddFeatures/readme.metadata.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "category": "Data",
- "description": "Add features to a feature layer.",
- "formal_name": "AddFeatures",
- "ignore": false,
- "images": [
- "AddFeatures.jpg"
- ],
- "keywords": [
- "edit",
- "feature",
- "online service"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/addfeatures.htm"
- ],
- "relevant_apis": [
- "Feature",
- "FeatureEditResult",
- "FeatureLayer",
- "ServiceFeatureTable"
- ],
- "snippets": [
- "AddFeatures.cs"
- ],
- "title": "Add features"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/DeleteFeatures/DeleteFeatures.cs b/src/Android/Xamarin.Android/Samples/Data/DeleteFeatures/DeleteFeatures.cs
deleted file mode 100644
index 768da147d9..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/DeleteFeatures/DeleteFeatures.cs
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Linq;
-
-namespace ArcGISRuntimeXamarin.Samples.DeleteFeatures
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Delete features (feature service)",
- category: "Data",
- description: "Delete features from an online feature service.",
- instructions: "To delete a feature, tap it, then tap 'Delete incident'.",
- tags: new[] { "Service", "deletion", "feature", "online", "table" })]
- public class DeleteFeatures : Activity
- {
- // Hold a reference to the MapView.
- private MapView _myMapView;
-
- // URL to the feature service.
- private const string FeatureServiceUrl = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0";
-
- // Hold a reference to the feature layer.
- private FeatureLayer _damageLayer;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Delete features";
-
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create the map with streets basemap.
- _myMapView.Map = new Map(BasemapStyle.ArcGISStreets);
-
- // Create the feature table, referring to the Damage Assessment feature service.
- ServiceFeatureTable damageTable = new ServiceFeatureTable(new Uri(FeatureServiceUrl));
-
- // Create a feature layer to visualize the features in the table.
- _damageLayer = new FeatureLayer(damageTable);
-
- // Add the layer to the map.
- _myMapView.Map.OperationalLayers.Add(_damageLayer);
-
- // Listen for user taps on the map - on tap, a callout will be shown.
- _myMapView.GeoViewTapped += MapView_Tapped;
-
- // Zoom to the United States.
- _myMapView.SetViewpointCenterAsync(new MapPoint(-10800000, 4500000, SpatialReferences.WebMercator), 3e7);
- }
-
- private async void MapView_Tapped(object sender, GeoViewInputEventArgs e)
- {
- // Clear any existing selection.
- _damageLayer.ClearSelection();
-
- // Dismiss any existing callouts.
- _myMapView.DismissCallout();
-
- try
- {
- // Perform an identify to determine if a user tapped on a feature.
- IdentifyLayerResult identifyResult = await _myMapView.IdentifyLayerAsync(_damageLayer, e.Position, 8, false);
-
- // Do nothing if there are no results.
- if (!identifyResult.GeoElements.Any())
- {
- return;
- }
-
- // Otherwise, get the ID of the first result.
- long featureId = (long) identifyResult.GeoElements.First().Attributes["objectid"];
-
- // Get the feature by constructing a query and running it.
- QueryParameters qp = new QueryParameters();
- qp.ObjectIds.Add(featureId);
- FeatureQueryResult queryResult = await _damageLayer.FeatureTable.QueryFeaturesAsync(qp);
- Feature tappedFeature = queryResult.First();
-
- // Select the feature.
- _damageLayer.SelectFeature(tappedFeature);
-
- // Show the callout.
- ShowDeletionCallout(tappedFeature);
- }
- catch (Exception ex)
- {
- ShowMessage(ex.ToString(), "There was a problem.");
- }
- }
-
- private void ShowDeletionCallout(Feature tappedFeature)
- {
- // Create a button for deleting the feature.
- Button deleteButton = new Button(this);
- deleteButton.Text = "Delete feature";
-
- // Handle button clicks.
- deleteButton.Click += (o, e) => { DeleteFeature(tappedFeature); };
-
- // Show the callout.
- _myMapView.ShowCalloutAt((MapPoint) tappedFeature.Geometry, deleteButton);
- }
-
- private async void DeleteFeature(Feature featureToDelete)
- {
- // Dismiss the callout.
- _myMapView.DismissCallout();
-
- try
- {
- // Delete the feature.
- await _damageLayer.FeatureTable.DeleteFeatureAsync(featureToDelete);
-
- // Sync the change with the service.
- ServiceFeatureTable serviceTable = (ServiceFeatureTable) _damageLayer.FeatureTable;
- await serviceTable.ApplyEditsAsync();
-
- // Show a message confirming the deletion.
- ShowMessage($"Deleted feature with ID {featureToDelete.Attributes["objectid"]}", "Success!");
- }
- catch (Exception ex)
- {
- ShowMessage(ex.ToString(), "Couldn't delete feature");
- }
- }
-
- private void ShowMessage(string message, string title)
- {
- // Display the message to the user.
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.SetMessage(message).SetTitle(title).Show();
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- var layout = new LinearLayout(this) {Orientation = Orientation.Vertical};
-
- // Create the MapView.
- _myMapView = new MapView(this);
-
- // Create the help label.
- TextView helpLabel = new TextView(this);
- helpLabel.Text = "Tap to select a feature for deletion.";
- helpLabel.TextAlignment = TextAlignment.Center;
- helpLabel.Gravity = GravityFlags.Center;
-
- // Add the help label to the layout.
- layout.AddView(helpLabel);
-
- // Add the map view to the layout.
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/DeleteFeatures/DeleteFeatures.jpg b/src/Android/Xamarin.Android/Samples/Data/DeleteFeatures/DeleteFeatures.jpg
deleted file mode 100644
index cacfd5443b..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/DeleteFeatures/DeleteFeatures.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/DeleteFeatures/readme.md b/src/Android/Xamarin.Android/Samples/Data/DeleteFeatures/readme.md
deleted file mode 100644
index fb744ae2f1..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/DeleteFeatures/readme.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# Delete features (feature service)
-
-Delete features from an online feature service.
-
-![Image of delete features feature service](DeleteFeatures.jpg)
-
-## Use case
-
-Sometimes users may want to delete features from an online feature service.
-
-## How to use the sample
-
-To delete a feature, tap it, then tap 'Delete incident'.
-
-## How it works
-
-1. Create a `ServiceFeatureTable` object from a URL.
-2. Create a `FeatureLayer` object from the service feature table.
-3. Select features from the feature layer via `FeatureLayer.SelectFeatures()`.
-4. Remove the selected features from the service feature table using `ServiceFeatureTable.DeleteFeatureAsync()`.
-5. Update the table on the server using `ServiceFeatureTable.ApplyEditsAsync()`.
-
-## Relevant API
-
-* Feature
-* FeatureLayer
-* ServiceFeatureTable
-
-## Tags
-
-deletion, feature, online, Service, table
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/DeleteFeatures/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/DeleteFeatures/readme.metadata.json
deleted file mode 100644
index e38fb781d2..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/DeleteFeatures/readme.metadata.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "category": "Data",
- "description": "Delete features from an online feature service.",
- "formal_name": "DeleteFeatures",
- "ignore": false,
- "images": [
- "DeleteFeatures.jpg"
- ],
- "keywords": [
- "Service",
- "deletion",
- "feature",
- "online",
- "table"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/deletefeatures.htm"
- ],
- "relevant_apis": [
- "Feature",
- "FeatureLayer",
- "ServiceFeatureTable"
- ],
- "snippets": [
- "DeleteFeatures.cs"
- ],
- "title": "Delete features (feature service)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/EditAndSyncFeatures/EditAndSyncFeatures.cs b/src/Android/Xamarin.Android/Samples/Data/EditAndSyncFeatures/EditAndSyncFeatures.cs
deleted file mode 100644
index 77022c9ec4..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/EditAndSyncFeatures/EditAndSyncFeatures.cs
+++ /dev/null
@@ -1,614 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using ArcGISRuntime.Samples.Managers;
-using Esri.ArcGISRuntime.ArcGISServices;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.Tasks;
-using Esri.ArcGISRuntime.Tasks.Offline;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using Esri.ArcGISRuntime;
-
-namespace ArcGISRuntime.Samples.EditAndSyncFeatures
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("e4a398afe9a945f3b0f4dca1e4faccb5")]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Edit and sync features",
- category: "Data",
- description: "Synchronize offline edits with a feature service.",
- instructions: "Pan and zoom to position the red rectangle around the area you want to take offline. Tap \"Generate geodatabase\" to take the area offline. When complete, the map will update to only show the offline area. To edit features, tap to select a feature, and tap again anywhere else on the map to move the selected feature to the clicked location. To sync the edits with the feature service, tap the \"Sync geodatabase\" button.",
- tags: new[] { "feature service", "geodatabase", "offline", "synchronize" })]
- public class EditAndSyncFeatures : Activity
- {
- // Enumeration to track which phase of the workflow the sample is in.
- private enum EditState
- {
- NotReady, // Geodatabase has not yet been generated.
- Editing, // A feature is in the process of being moved.
- Ready // The geodatabase is ready for synchronization or further edits.
- }
-
- // URL for a feature service that supports geodatabase generation.
- private Uri _featureServiceUri = new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Sync/WildfireSync/FeatureServer");
-
- // Path to the geodatabase file on disk.
- private string _gdbPath;
-
- // Task to be used for generating the geodatabase.
- private GeodatabaseSyncTask _gdbSyncTask;
-
- // Flag to indicate which stage of the edit process the sample is in.
- private EditState _readyForEdits = EditState.NotReady;
-
- // Hold a reference to the generated geodatabase.
- private Geodatabase _resultGdb;
-
- // Mapview.
- private MapView myMapView;
-
- // Generate Button.
- private Button myGenerateButton;
-
- // Sync Button.
- private Button mySyncButton;
-
- // Progress bar.
- private ProgressBar myProgressBar;
-
- // Help label.
- private TextView myHelpLabel;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- Title = "Edit and Sync Features";
-
- // Create the UI, setup the control references and execute initialization.
- CreateLayout();
- Initialize();
- }
-
- private void CreateLayout()
- {
- // Create the layout.
- LinearLayout layout = new LinearLayout(this)
- {
- Orientation = Orientation.Vertical
- };
-
- // Add the help label.
- myHelpLabel = new TextView(this) { Text = "1. Click 'Generate'" };
- layout.AddView(myHelpLabel);
-
- // Add the progress bar.
- myProgressBar = new ProgressBar(this)
- {
- Visibility = Android.Views.ViewStates.Gone
- };
- layout.AddView(myProgressBar);
-
- // Add the generate button.
- myGenerateButton = new Button(this)
- {
- Text = "Generate",
- Enabled = false
- };
- myGenerateButton.Click += GenerateButton_Clicked;
- layout.AddView(myGenerateButton);
-
- // Add the sync button.
- mySyncButton = new Button(this)
- {
- Text = "Synchronize"
- };
- mySyncButton.Click += SyncButton_Click;
- mySyncButton.Enabled = false;
- layout.AddView(mySyncButton);
-
- // Add the mapview.
- myMapView = new MapView(this);
- layout.AddView(myMapView);
-
- // Add the layout to the view.
- SetContentView(layout);
- }
-
- private async void Initialize()
- {
- // Create a tile cache and load it with the SanFrancisco streets tpk.
- TileCache tileCache = new TileCache(DataManager.GetDataFolder("e4a398afe9a945f3b0f4dca1e4faccb5", "SanFrancisco.tpkx"));
-
- // Create the corresponding layer based on the tile cache.
- ArcGISTiledLayer tileLayer = new ArcGISTiledLayer(tileCache);
-
- // Create the basemap based on the tile cache.
- Basemap sfBasemap = new Basemap(tileLayer);
-
- // Create the map with the tile-based basemap.
- Map myMap = new Map(sfBasemap);
-
- // Assign the map to the MapView.
- myMapView.Map = myMap;
-
- // Create a new symbol for the extent graphic.
- SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Red, 2);
-
- // Create graphics overlay for the extent graphic and apply a renderer.
- GraphicsOverlay extentOverlay = new GraphicsOverlay
- {
- Renderer = new SimpleRenderer(lineSymbol)
- };
-
- // Add graphics overlay to the map view.
- myMapView.GraphicsOverlays.Add(extentOverlay);
-
- // Set up an event handler for when the viewpoint (extent) changes.
- myMapView.ViewpointChanged += MapViewExtentChanged;
-
- // Set up event handler for mapview taps.
- myMapView.GeoViewTapped += GeoViewTapped;
-
- try
- {
- // Create a task for generating a geodatabase (GeodatabaseSyncTask).
- _gdbSyncTask = await GeodatabaseSyncTask.CreateAsync(_featureServiceUri);
-
- // Add all graphics from the service to the map.
- foreach (IdInfo layer in _gdbSyncTask.ServiceInfo.LayerInfos)
- {
- // Get the Uri for this particular layer.
- Uri onlineTableUri = new Uri(_featureServiceUri + "/" + layer.Id);
-
- // Create the ServiceFeatureTable.
- ServiceFeatureTable onlineTable = new ServiceFeatureTable(onlineTableUri);
-
- // Wait for the table to load.
- await onlineTable.LoadAsync();
-
- // Skip tables that aren't for point features.
- if (onlineTable.GeometryType != GeometryType.Point)
- {
- continue;
- }
-
- // Add the layer to the map's operational layers if load succeeds.
- if (onlineTable.LoadStatus == LoadStatus.Loaded)
- {
- myMap.OperationalLayers.Add(new FeatureLayer(onlineTable));
- }
- }
-
- // Update the graphic - in case user doesn't interact with the map.
- UpdateMapExtent();
-
- // Enable the generate button now that the sample is ready.
- myGenerateButton.Enabled = true;
- }
- catch (Exception e)
- {
- ShowStatusMessage(e.ToString());
- }
- }
-
- private async void GeoViewTapped(object sender, GeoViewInputEventArgs e)
- {
- // Disregard if not ready for edits.
- try
- {
- if (_readyForEdits == EditState.NotReady) { return; }
-
- // If an edit is in process, finish it.
- if (_readyForEdits == EditState.Editing)
- {
- // Hold a list of any selected features.
- List selectedFeatures = new List();
-
- // Get all selected features then clear selection.
- foreach (FeatureLayer layer in myMapView.Map.OperationalLayers)
- {
- // Get the selected features.
- FeatureQueryResult layerFeatures = await layer.GetSelectedFeaturesAsync();
-
- // FeatureQueryResult implements IEnumerable, so it can be treated as a collection of features.
- selectedFeatures.AddRange(layerFeatures);
-
- // Clear the selection.
- layer.ClearSelection();
- }
-
- // Update all selected features' geometry.
- foreach (Feature feature in selectedFeatures)
- {
- // Get a reference to the correct feature table for the feature.
- GeodatabaseFeatureTable table = (GeodatabaseFeatureTable)feature.FeatureTable;
-
- // Ensure the geometry type of the table is point.
- if (table.GeometryType != GeometryType.Point)
- {
- continue;
- }
-
- // Set the new geometry.
- feature.Geometry = e.Location;
-
- try
- {
- // Update the feature in the table.
- await table.UpdateFeatureAsync(feature);
- }
- catch (Esri.ArcGISRuntime.ArcGISException)
- {
- ShowStatusMessage("Feature must be within extent of geodatabase.");
- }
- }
-
- // Update the edit state.
- _readyForEdits = EditState.Ready;
-
- // Enable the sync button.
- mySyncButton.Enabled = true;
-
- // Update the help label.
- myHelpLabel.Text = "4. Click 'Synchronize' or edit more features";
- }
- // Otherwise, start an edit.
- else
- {
- // Define a tolerance for use with identifying the feature.
- double tolerance = 15 * myMapView.UnitsPerPixel;
-
- // Define the selection envelope.
- Envelope selectionEnvelope = new Envelope(e.Location.X - tolerance, e.Location.Y - tolerance, e.Location.X + tolerance, e.Location.Y + tolerance);
-
- // Define query parameters for feature selection.
- QueryParameters query = new QueryParameters()
- {
- Geometry = selectionEnvelope
- };
-
- // Track whether any selections were made.
- bool selectedFeature = false;
-
- // Select the feature in all applicable tables.
- foreach (FeatureLayer layer in myMapView.Map.OperationalLayers)
- {
- FeatureQueryResult res = await layer.SelectFeaturesAsync(query, SelectionMode.New);
- selectedFeature = selectedFeature || res.Any();
- }
-
- // Only update state if a feature was selected.
- if (selectedFeature)
- {
- // Set the edit state.
- _readyForEdits = EditState.Editing;
-
- // Update the help label.
- myHelpLabel.Text = "3. Tap on the map to move the point";
- }
- }
- }
- catch (Exception ex)
- {
- ShowStatusMessage(ex.ToString());
- }
- }
-
- private void UpdateMapExtent()
- {
- // Return if mapview is null.
- if (myMapView == null) { return; }
-
- // Get the new viewpoint.
- Viewpoint myViewPoint = myMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry);
-
- // Return if viewpoint is null.
- if (myViewPoint == null) { return; }
-
- // Get the updated extent for the new viewpoint.
- Envelope extent = myViewPoint.TargetGeometry as Envelope;
-
- // Return if extent is null.
- if (extent == null) { return; }
-
- // Create an envelope that is a bit smaller than the extent.
- EnvelopeBuilder envelopeBldr = new EnvelopeBuilder(extent);
- envelopeBldr.Expand(0.80);
-
- // Get the (only) graphics overlay in the map view.
- GraphicsOverlay extentOverlay = myMapView.GraphicsOverlays.FirstOrDefault();
-
- // Return if the extent overlay is null.
- if (extentOverlay == null) { return; }
-
- // Get the extent graphic.
- Graphic extentGraphic = extentOverlay.Graphics.FirstOrDefault();
-
- // Create the extent graphic and add it to the overlay if it doesn't exist.
- if (extentGraphic == null)
- {
- extentGraphic = new Graphic(envelopeBldr.ToGeometry());
- extentOverlay.Graphics.Add(extentGraphic);
- }
- else
- {
- // Otherwise, update the graphic's geometry.
- extentGraphic.Geometry = envelopeBldr.ToGeometry();
- }
- }
-
- private async Task StartGeodatabaseGeneration()
- {
- // Update geodatabase path.
- _gdbPath = $"{Path.GetTempFileName()}.geodatabase";
-
- // Create a task for generating a geodatabase (GeodatabaseSyncTask).
- _gdbSyncTask = await GeodatabaseSyncTask.CreateAsync(_featureServiceUri);
-
- // Get the (only) graphic in the map view.
- Graphic redPreviewBox = myMapView.GraphicsOverlays.First().Graphics.First();
-
- // Get the current extent of the red preview box.
- Envelope extent = redPreviewBox.Geometry as Envelope;
-
- // Get the default parameters for the generate geodatabase task.
- GenerateGeodatabaseParameters generateParams = await _gdbSyncTask.CreateDefaultGenerateGeodatabaseParametersAsync(extent);
-
- // Create a generate geodatabase job.
- GenerateGeodatabaseJob generateGdbJob = _gdbSyncTask.GenerateGeodatabase(generateParams, _gdbPath);
-
- // Handle the progress changed event with an inline (lambda) function to show the progress bar.
- generateGdbJob.ProgressChanged += (sender, e) =>
- {
- // Get the job.
- GenerateGeodatabaseJob job = (GenerateGeodatabaseJob)sender;
-
- // Update the progress bar.
- UpdateProgressBar(job.Progress);
- };
-
- // Show the progress bar.
- myProgressBar.Visibility = Android.Views.ViewStates.Visible;
-
- // Start the job.
- generateGdbJob.Start();
-
- // Wait for the result.
- _resultGdb = await generateGdbJob.GetResultAsync();
-
- // Hide the progress bar.
- myProgressBar.Visibility = Android.Views.ViewStates.Gone;
-
- // Do the rest of the work.
- HandleGenerationCompleted(generateGdbJob);
- }
-
- private async void HandleGenerationCompleted(GenerateGeodatabaseJob job)
- {
- JobStatus status = job.Status;
-
- // If the job completed successfully, add the geodatabase data to the map.
- if (status == JobStatus.Succeeded)
- {
- // Clear out the existing layers.
- myMapView.Map.OperationalLayers.Clear();
-
- // Loop through all feature tables in the geodatabase and add a new layer to the map.
- foreach (GeodatabaseFeatureTable table in _resultGdb.GeodatabaseFeatureTables)
- {
- // Skip non-point tables.
- await table.LoadAsync();
- if (table.GeometryType != GeometryType.Point)
- {
- continue;
- }
-
- // Create a new feature layer for the table.
- FeatureLayer layer = new FeatureLayer(table);
-
- // Add the new layer to the map.
- myMapView.Map.OperationalLayers.Add(layer);
- }
-
- // Enable editing features.
- _readyForEdits = EditState.Ready;
-
- // Update the help label.
- myHelpLabel.Text = "2. Tap a point feature to select";
- }
-
- // See if the job failed.
- if (status == JobStatus.Failed)
- {
- // Create a message to show the user.
- string message = "Generate geodatabase job failed";
-
- // Show an error message (if there is one).
- if (job.Error != null)
- {
- message += ": " + job.Error.Message;
- }
- else
- {
- // If no error, show messages from the job.
- foreach (JobMessage m in job.Messages)
- {
- // Get the text from the JobMessage and add it to the output string.
- message += "\n" + m.Message;
- }
- }
-
- // Show the message.
- ShowStatusMessage(message);
- }
- }
-
- private void HandleSyncCompleted(SyncGeodatabaseJob job)
- {
- JobStatus status = job.Status;
-
- // Tell the user about job completion.
- if (status == JobStatus.Succeeded)
- {
- ShowStatusMessage("Sync task completed");
- }
-
- // See if the job failed.
- if (status == JobStatus.Failed)
- {
- // Create a message to show the user.
- string message = "Sync geodatabase job failed";
-
- // Show an error message (if there is one).
- if (job.Error != null)
- {
- message += ": " + job.Error.Message;
- }
- else
- {
- // If no error, show messages from the job.
- foreach (JobMessage m in job.Messages)
- {
- // Get the text from the JobMessage and add it to the output string.
- message += "\n" + m.Message;
- }
- }
-
- // Show the message.
- ShowStatusMessage(message);
- }
- }
-
- private async Task SyncGeodatabase()
- {
- // Return if not ready.
- if (_readyForEdits != EditState.Ready) { return; }
-
- // Disable the sync button.
- mySyncButton.Enabled = false;
-
- // Create parameters for the sync task.
- SyncGeodatabaseParameters parameters = new SyncGeodatabaseParameters()
- {
- GeodatabaseSyncDirection = SyncDirection.Bidirectional,
- RollbackOnFailure = false
- };
-
- // Get the layer Id for each feature table in the geodatabase, then add to the sync job.
- foreach (GeodatabaseFeatureTable table in _resultGdb.GeodatabaseFeatureTables)
- {
- // Get the ID for the layer.
- long id = table.ServiceLayerId;
-
- // Create the SyncLayerOption.
- SyncLayerOption option = new SyncLayerOption(id);
-
- // Add the option.
- parameters.LayerOptions.Add(option);
- }
-
- // Create job.
- SyncGeodatabaseJob job = _gdbSyncTask.SyncGeodatabase(parameters, _resultGdb);
-
- // Subscribe to progress updates.
- job.ProgressChanged += (o, e) =>
- {
- // Update the progress bar.
- UpdateProgressBar(job.Progress);
- };
-
- // Show the progress bar.
- myProgressBar.Visibility = Android.Views.ViewStates.Visible;
-
- // Start the sync.
- job.Start();
-
- // Wait for the job to finish.
- await job.GetResultAsync();
-
- // Hide the progress bar.
- myProgressBar.Visibility = Android.Views.ViewStates.Gone;
-
- // Do the rest of the work.
- HandleSyncCompleted(job);
-
- // Re-enable the sync button.
- mySyncButton.Enabled = true;
- }
-
- private void ShowStatusMessage(string message)
- {
- // Display the message to the user.
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.SetMessage(message).SetTitle("Alert").Show();
- }
-
- private async void GenerateButton_Clicked(object sender, EventArgs e)
- {
- // Fix the selection graphic extent.
- myMapView.ViewpointChanged -= MapViewExtentChanged;
-
- // Disable the generate button.
- try
- {
- myGenerateButton.Enabled = false;
-
- // Call the geodatabase generation method.
- await StartGeodatabaseGeneration();
- }
- catch (Exception ex)
- {
- ShowStatusMessage(ex.ToString());
- }
- }
-
- private void MapViewExtentChanged(object sender, EventArgs e)
- {
- // Call the map extent update method.
- UpdateMapExtent();
- }
-
- private void UpdateProgressBar(int progress)
- {
- // Due to the nature of the threading implementation,
- // the dispatcher needs to be used to interact with the UI.
- // The dispatcher takes an Action, provided here as a lambda function.
- RunOnUiThread(() =>
- {
- // Update the progress bar value.
- myProgressBar.Progress = progress;
- });
- }
-
- private async void SyncButton_Click(object sender, EventArgs e)
- {
- try
- {
- await SyncGeodatabase();
- }
- catch (Exception ex)
- {
- ShowStatusMessage(ex.ToString());
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/EditAndSyncFeatures/EditAndSyncFeatures.jpg b/src/Android/Xamarin.Android/Samples/Data/EditAndSyncFeatures/EditAndSyncFeatures.jpg
deleted file mode 100644
index 3229466533..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/EditAndSyncFeatures/EditAndSyncFeatures.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/EditAndSyncFeatures/readme.md b/src/Android/Xamarin.Android/Samples/Data/EditAndSyncFeatures/readme.md
deleted file mode 100644
index 080caab49e..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/EditAndSyncFeatures/readme.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# Edit and sync features
-
-Synchronize offline edits with a feature service.
-
-![Image of edit and sync features](EditAndSyncFeatures.jpg)
-
-## Use case
-
-A survey worker who works in an area without an internet connection could take a geodatabase of survey features offline at their office, make edits and add new features to the offline geodatabase in the field, and sync the updates with the online feature service after returning to the office.
-
-## How to use the sample
-
-Pan and zoom to position the red rectangle around the area you want to take offline. Tap "Generate geodatabase" to take the area offline. When complete, the map will update to only show the offline area. To edit features, tap to select a feature, and tap again anywhere else on the map to move the selected feature to the clicked location. To sync the edits with the feature service, tap the "Sync geodatabase" button.
-
-## How it works
-
-1. Create a `GeodatabaseSyncTask` from a URL to a feature service.
-2. Use `createDefaultGenerateGeodatabaseParametersAsync()` on the geodatabase sync task to create `GenerateGeodatabaseParameters`, passing in an `Envelope` extent as the parameter.
-3. Create a `GenerateGeodatabaseJob` from the `GeodatabaseSyncTask` using `generateGeodatabaseAsync(...)`, passing in the parameters and a path to where the geodatabase should be downloaded locally.
-4. Start the job and get the result `Geodatabase`.
-5. Load the geodatabase and get its feature tables. Create feature layers from the feature tables and add them to the map's operational layers collection.
-6. Create `SyncGeodatabaseParameters` and set the sync direction.
-7. Create a `SyncGeodatabaseJob` from `GeodatabaseSyncTask` using `.syncGeodatabaseAsync(...)` passing in the parameters and geodatabase as arguments.
-8. Start the sync job to synchronize the edits.
-
-## Relevant API
-
-* FeatureLayer
-* FeatureTable
-* GenerateGeodatabaseJob
-* GenerateGeodatabaseParameters
-* GeodatabaseSyncTask
-* SyncGeodatabaseJob
-* SyncGeodatabaseParameters
-* SyncLayerOption
-
-## Offline data
-
-This sample uses a [San Francisco offline basemap tile package](https://www.arcgis.com/home/item.html?id=e4a398afe9a945f3b0f4dca1e4faccb5).
-
-## About the data
-
-The basemap uses an offline tile package of San Francisco. The online feature service has features with wildfire information.
-
-## Tags
-
-feature service, geodatabase, offline, synchronize
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/EditAndSyncFeatures/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/EditAndSyncFeatures/readme.metadata.json
deleted file mode 100644
index f18baefdea..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/EditAndSyncFeatures/readme.metadata.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "category": "Data",
- "description": "Synchronize offline edits with a feature service.",
- "formal_name": "EditAndSyncFeatures",
- "ignore": false,
- "images": [
- "EditAndSyncFeatures.jpg"
- ],
- "keywords": [
- "feature service",
- "geodatabase",
- "offline",
- "synchronize"
- ],
- "offline_data": [
- "e4a398afe9a945f3b0f4dca1e4faccb5"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/editandsyncfeatures.htm"
- ],
- "relevant_apis": [
- "FeatureLayer",
- "FeatureTable",
- "GenerateGeodatabaseJob",
- "GenerateGeodatabaseParameters",
- "GeodatabaseSyncTask",
- "SyncGeodatabaseJob",
- "SyncGeodatabaseParameters",
- "SyncLayerOption"
- ],
- "snippets": [
- "EditAndSyncFeatures.cs"
- ],
- "title": "Edit and sync features"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/EditBranchVersioning/EditBranchVersioning.cs b/src/Android/Xamarin.Android/Samples/Data/EditBranchVersioning/EditBranchVersioning.cs
deleted file mode 100644
index de756d8efd..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/EditBranchVersioning/EditBranchVersioning.cs
+++ /dev/null
@@ -1,410 +0,0 @@
-// Copyright 2021 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using ArcGISRuntime;
-using Esri.ArcGISRuntime.ArcGISServices;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Security;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace ArcGISRuntimeXamarin.Samples.EditBranchVersioning
-{
- [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Edit with branch versioning",
- category: "Data",
- description: "Create, query and edit a specific server version using service geodatabase.",
- instructions: "Once loaded, the map will zoom to the extent of the feature layer. The current version is indicated at the top of the map. Tap \"Create Version\" to open a dialog to specify the version information (name, access, and description). See the *Additional information* section for restrictions on the version name.",
- tags: new[] { "branch versioning", "edit", "version control", "version management server" })]
- [ArcGISRuntime.Samples.Shared.Attributes.AndroidLayout("EditBranchVersioning.xml")]
- public class EditBranchVersioning : Activity
- {
- // Hold references to the UI controls.
- private MapView _myMapView;
- private TextView _versionLabel;
- private TextView _moveLabel;
- private Button _versionButton;
- private Button _cancelButton;
- private Button _closeButton;
- private Button _confirmButton;
- private Spinner _protectionSpinner;
- private Spinner _damageSpinner;
- private EditText _nameEntry;
- private EditText _descriptionEntry;
-
- private View _defaultView;
- private View _versionView;
- private View _damageView;
-
- private ArcGISFeature _selectedFeature;
- private FeatureLayer _featureLayer;
- private ServiceFeatureTable _featureTable;
- private ServiceGeodatabase _serviceGeodatabase;
-
- private string _userCreatedVersionName;
- private string _attributeFieldName = "typdamage";
-
- private List _accessLevels = new List { VersionAccess.Public, VersionAccess.Protected, VersionAccess.Private };
- private List _damageLevels = new List { "Destroyed", "Inaccessible", "Major", "Minor", "Affected" };
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Edit with branch versioning";
-
- CreateLayout();
- _ = Initialize();
- }
-
- private async Task Initialize()
- {
- // Handle the login to the feature service.
- AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) =>
- {
- try
- {
- // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample.
- string sampleServer7User = "editor01";
- string sampleServer7Pass = "S7#i2LWmYH75";
- return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.Message);
- return null;
- }
- });
-
- try
- {
- // Create a map.
- _myMapView.Map = new Map(BasemapStyle.ArcGISStreets);
-
- _damageSpinner.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, _damageLevels);
- _protectionSpinner.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, _accessLevels.Select(l => Enum.GetName(typeof(VersionAccess), l)).ToList());
-
- // Create and load a service geodatabase.
- _serviceGeodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/DamageAssessment/FeatureServer/0"));
- await _serviceGeodatabase.LoadAsync();
-
- // When the service geodatabase has loaded get the default version name.
- _versionLabel.Text = $"Current version: {_serviceGeodatabase.DefaultVersionName}";
-
- // Get the service feature table from the service geodatabase.
- _featureTable = _serviceGeodatabase.GetTable(0);
-
- // Create a feature layer from the service feature table and add it to the map.
- _featureLayer = new FeatureLayer(_featureTable);
- _myMapView.Map.OperationalLayers.Add(_featureLayer);
- await _featureLayer.LoadAsync();
-
- // When the feature layer has loaded set the viewpoint and update the UI.
- await _myMapView.SetViewpointAsync(new Viewpoint(_featureLayer.FullExtent));
-
- // Enable the UI.
- _versionButton.Enabled = true;
- _myMapView.GeoViewTapped += MapView_GeoViewTapped;
- }
- catch (Exception ex)
- {
- ShowAlert(ex.Message, ex.GetType().Name);
- }
- }
-
- private void VersionButtonClick(object sender, EventArgs e)
- {
- // Check if user version has been created.
- if (_userCreatedVersionName != null)
- {
- _ = SwitchVersion();
- }
- else
- {
- // Display UI for creating a new version.
- SwitchView(_versionView);
- }
-
- // Clear the selection.
- _featureLayer.ClearSelection();
- _selectedFeature = null;
- }
-
- private async Task SwitchVersion()
- {
- // Check if the default version is loaded.
- if (_serviceGeodatabase.VersionName == _serviceGeodatabase.DefaultVersionName)
- {
- // Switch to the user created version.
- await _serviceGeodatabase.SwitchVersionAsync(_userCreatedVersionName);
- _versionLabel.Text = $"Current version: {_serviceGeodatabase.VersionName}";
- }
- else
- {
- if (_serviceGeodatabase.HasLocalEdits())
- {
- // Apply the edits made to the service geodatabase.
- IReadOnlyList edits = await _serviceGeodatabase.ApplyEditsAsync();
- if (!(edits?.Count > 0))
- {
- // Verify that there were no errors when applying edits.
- if (!edits.ToArray()[0].EditResults[0].CompletedWithErrors)
- {
- ShowAlert("Applied edits successfully on the server");
- }
- else
- {
- ShowAlert(edits.ToArray()[0].EditResults[0].Error.Message);
- return;
- }
- }
- }
-
- // Switch to the default version.
- await _serviceGeodatabase.SwitchVersionAsync(_serviceGeodatabase.DefaultVersionName);
- _versionLabel.Text = $"Current version: {_serviceGeodatabase.VersionName}";
- }
- }
-
- private bool VersionNameValid(string versionName)
- {
- // Verify that the version name is valid.
- if (versionName.Contains('.') || versionName.Contains(';') || versionName.Contains('\'') || versionName.Contains('\"'))
- {
- ShowAlert("Please enter a valid version name.\nThe name cannot contain the following characters:\n. ; ' \" ");
- return false;
- }
- else if (versionName.Length > 0 && versionName.StartsWith(" "))
- {
- ShowAlert("Version name cannot begin with a space");
- return false;
- }
- else if (versionName.Length > 62)
- {
- ShowAlert("Version name must not exceed 62 characters");
- return false;
- }
- else if (versionName.Length == 0)
- {
- ShowAlert("Please enter a version name");
- return false;
- }
- return true;
- }
-
- private void ShowAlert(string alertText, string titleText = "Alert")
- {
- new AlertDialog.Builder(this).SetMessage(alertText).SetTitle(titleText).Show();
- }
-
- private async void MapView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
- {
- // Check if a feature is selected and the service geodatabase is not on the default version.
- if (_selectedFeature is ArcGISFeature && _serviceGeodatabase.VersionName != _serviceGeodatabase.DefaultVersionName)
- {
- try
- {
- // Load the feature.
- await _selectedFeature.LoadAsync();
-
- // Update the feature geometry.
- _selectedFeature.Geometry = e.Location;
-
- // Update the table.
- await _selectedFeature.FeatureTable.UpdateFeatureAsync(_selectedFeature);
-
- // Update the service.
- await ((ServiceFeatureTable)_selectedFeature.FeatureTable).ApplyEditsAsync();
-
- ShowAlert("Moved feature " + _selectedFeature.Attributes["objectid"]);
- }
- catch (Exception ex)
- {
- ShowAlert(ex.Message, "Failed to edit feature");
- }
- }
- else
- {
- try
- {
- // Clear the selection.
- _featureLayer.ClearSelection();
- _selectedFeature = null;
-
- // Perform an identify to determine if a user tapped on a feature.
- IdentifyLayerResult identifyResult = await _myMapView.IdentifyLayerAsync(_featureLayer, e.Position, 2, false);
-
- // Do nothing if there are no results.
- if (!identifyResult.GeoElements.Any())
- {
- SwitchView(_defaultView);
- return;
- }
-
- // Get the tapped feature.
- _selectedFeature = (ArcGISFeature)identifyResult.GeoElements.First();
-
- // Select the feature.
- _featureLayer.SelectFeature(_selectedFeature);
-
- // Get the current value.
- string currentAttributeValue = _selectedFeature.Attributes[_attributeFieldName].ToString();
-
- bool editable = _serviceGeodatabase.VersionName != _serviceGeodatabase.DefaultVersionName;
- _moveLabel.Visibility = editable ? ViewStates.Visible : ViewStates.Invisible;
- _damageSpinner.Enabled = editable;
-
- // Update the UI for the selection.
- SwitchView(_damageView);
- }
- catch (Exception ex)
- {
- ShowAlert(ex.Message, ex.GetType().Name);
- }
- }
- }
-
- private async Task ApplyDamageChange()
- {
- try
- {
- // Get the value from the UI.
- string selectedAttributeValue = _damageSpinner.SelectedItem.ToString();
-
- // Check if the new value is the same as the existing value.
- if (_selectedFeature.Attributes[_attributeFieldName].ToString() == selectedAttributeValue)
- {
- return;
- }
-
- // Load the feature.
- await _selectedFeature.LoadAsync();
-
- // Update the attribute value.
- _selectedFeature.SetAttributeValue(_attributeFieldName, selectedAttributeValue);
-
- // Update the table.
- await _selectedFeature.FeatureTable.UpdateFeatureAsync(_selectedFeature);
-
- // Update the service.
- await ((ServiceFeatureTable)_selectedFeature.FeatureTable).ApplyEditsAsync();
-
- ShowAlert("Edited feature " + _selectedFeature.Attributes["objectid"]);
-
- // Clear the selection.
- _featureLayer.ClearSelection();
- _selectedFeature = null;
- }
- catch (Exception ex)
- {
- ShowAlert(ex.Message, "Failed to edit feature");
- }
- }
-
- private async void ConfirmButtonClick(object sender, EventArgs e)
- {
- try
- {
- // Validate name and access input.
- if (!VersionNameValid(_nameEntry.Text))
- {
- return;
- }
-
- if (_protectionSpinner.SelectedItem != null)
- {
- VersionAccess access = (VersionAccess)Enum.Parse(typeof(VersionAccess), _protectionSpinner.SelectedItem.ToString());
-
- // Set the user defined name, access level and description as service version parameters
- ServiceVersionParameters newVersionParameters = new ServiceVersionParameters();
- newVersionParameters.Name = _nameEntry.Text;
- newVersionParameters.Access = access;
- newVersionParameters.Description = _descriptionEntry.Text ?? "";
-
- ServiceVersionInfo newVersion = await _serviceGeodatabase.CreateVersionAsync(newVersionParameters);
- _userCreatedVersionName = newVersion.Name;
- _ = SwitchVersion();
-
- _versionButton.Text = "Switch version";
- }
- else
- {
- ShowAlert("Please select an access level");
- return;
- }
- }
- catch (Exception ex)
- {
- ShowAlert(ex.Message, ex.GetType().Name);
- }
- finally
- {
- SwitchView(_defaultView);
- }
- }
-
- private void CancelButtonClick(object sender, EventArgs e) => SwitchView(_defaultView);
-
- private async void CloseDamage(object sender, EventArgs e)
- {
- SwitchView(_defaultView);
-
- if (_serviceGeodatabase.VersionName != _serviceGeodatabase.DefaultVersionName)
- {
- await ApplyDamageChange();
- }
-
- // Clear the selection.
- _featureLayer.ClearSelection();
- _selectedFeature = null;
- }
-
- private void SwitchView(View view)
- {
- _defaultView.Visibility = _versionView.Visibility = _damageView.Visibility = ViewStates.Gone;
- view.Visibility = ViewStates.Visible;
- }
-
- private void CreateLayout()
- {
- // Load the layout from the axml resource.
- SetContentView(Resource.Layout.EditBranchVersioning);
-
- _myMapView = FindViewById(Resource.Id.MapView);
- _versionLabel = FindViewById(Resource.Id.versionLabel);
- _moveLabel = FindViewById(Resource.Id.moveLabel);
- _versionButton = FindViewById(Resource.Id.versionButton);
- _cancelButton = FindViewById(Resource.Id.cancelButton);
- _closeButton = FindViewById(Resource.Id.closeButton);
- _confirmButton = FindViewById(Resource.Id.createButton);
- _protectionSpinner = FindViewById(Resource.Id.protectionSpinner);
- _damageSpinner = FindViewById(Resource.Id.damageSpinner);
- _nameEntry = FindViewById(Resource.Id.nameEditText);
- _descriptionEntry = FindViewById(Resource.Id.descriptionEditText);
-
- _defaultView = FindViewById(Resource.Id.defaultView);
- _damageView = FindViewById(Resource.Id.damageView);
- _versionView = FindViewById(Resource.Id.versionView);
-
- _versionButton.Click += VersionButtonClick;
- _cancelButton.Click += CancelButtonClick;
- _closeButton.Click += CloseDamage;
- _confirmButton.Click += ConfirmButtonClick;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/EditBranchVersioning/EditBranchVersioning.jpg b/src/Android/Xamarin.Android/Samples/Data/EditBranchVersioning/EditBranchVersioning.jpg
deleted file mode 100644
index a816e52ff7..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/EditBranchVersioning/EditBranchVersioning.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/EditBranchVersioning/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/EditBranchVersioning/readme.metadata.json
deleted file mode 100644
index 4cab8dc1d0..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/EditBranchVersioning/readme.metadata.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "category": "Data",
- "description": "Create, query and edit a specific server version using service geodatabase.",
- "formal_name": "EditBranchVersioning",
- "ignore": false,
- "images": [
- "EditBranchVersioning.jpg"
- ],
- "keywords": [
- "branch versioning",
- "edit",
- "version control",
- "version management server"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/editbranchversioning.htm"
- ],
- "relevant_apis": [
- "FeatureLayer",
- "ServiceFeatureTable",
- "ServiceGeodatabase",
- "ServiceGeodatabase.ApplyEditsAsync",
- "ServiceGeodatabase.CreateVersionAsync",
- "ServiceGeodatabase.SwitchVersionAsync",
- "ServiceVersionInfo",
- "ServiceVersionParameters",
- "VersionAccess"
- ],
- "snippets": [
- "../../../Resources/layout/EditBranchVersioning.xml",
- "EditBranchVersioning.cs"
- ],
- "title": "Edit with branch versioning"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/EditFeatureAttachments/EditFeatureAttachments.cs b/src/Android/Xamarin.Android/Samples/Data/EditFeatureAttachments/EditFeatureAttachments.cs
deleted file mode 100644
index b875c9b37c..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/EditFeatureAttachments/EditFeatureAttachments.cs
+++ /dev/null
@@ -1,349 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using Android.Content;
-using Android.Graphics;
-using Android.Views;
-
-namespace ArcGISRuntimeXamarin.Samples.EditFeatureAttachments
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Edit feature attachments",
- category: "Data",
- description: "Add, delete, and download attachments for features from a service.",
- instructions: "Tap a feature to load its attachments. Use the buttons to save, delete, or add attachments.",
- tags: new[] { "JPEG", "PDF", "PNG", "TXT", "data", "image", "picture" })]
- public class EditFeatureAttachments : Activity
- {
- // Hold references to the UI controls.
- private MapView _myMapView;
- private ListView _attachmentsListView;
- private Button _addButton;
-
- // Hold a reference to the layer.
- private FeatureLayer _damageLayer;
-
- // Hold references to the currently selected feature & any attachments.
- private ArcGISFeature _selectedFeature;
- private IReadOnlyList _featureAttachments;
-
- // URL to the feature service.
- private const string FeatureServiceUrl = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0";
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Edit feature attachments";
-
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create the map with streets basemap.
- _myMapView.Map = new Map(BasemapStyle.ArcGISStreets);
-
- // Create the feature table, referring to the Damage Assessment feature service.
- ServiceFeatureTable damageTable = new ServiceFeatureTable(new Uri(FeatureServiceUrl));
-
- // Create a feature layer to visualize the features in the table.
- _damageLayer = new FeatureLayer(damageTable);
-
- // Add the layer to the map.
- _myMapView.Map.OperationalLayers.Add(_damageLayer);
-
- // Listen for user taps on the map.
- _myMapView.GeoViewTapped += MapView_Tapped;
-
- // Zoom to the United States.
- _myMapView.SetViewpointCenterAsync(new MapPoint(-10800000, 4500000, SpatialReferences.WebMercator), 3e7);
- }
-
- private async void MapView_Tapped(object sender, GeoViewInputEventArgs e)
- {
- // Clear any existing selection.
- _damageLayer.ClearSelection();
- _addButton.Enabled = false;
- _attachmentsListView.Enabled = false;
-
- try
- {
- // Perform an identify to determine if a user tapped on a feature.
- IdentifyLayerResult identifyResult = await _myMapView.IdentifyLayerAsync(_damageLayer, e.Position, 2, false);
-
- // Do nothing if there are no results.
- if (!identifyResult.GeoElements.Any())
- {
- return;
- }
-
- // Get the selected feature as an ArcGISFeature. It is assumed that all GeoElements in the result are of type ArcGISFeature.
- GeoElement tappedElement = identifyResult.GeoElements.First();
- _selectedFeature = (ArcGISFeature) tappedElement;
-
- // Update the UI.
- UpdateUIForFeature();
- _addButton.Enabled = true;
- _attachmentsListView.Enabled = true;
- }
- catch (Exception ex)
- {
- ShowMessage(ex.ToString(), "Error selecting feature");
- }
- }
-
- private async void UpdateUIForFeature()
- {
- // Select the feature.
- _damageLayer.SelectFeature(_selectedFeature);
-
- // Get the attachments.
- _featureAttachments = await _selectedFeature.GetAttachmentsAsync();
-
- // Limit to only feature attachments with an image/jpeg content type.
- _featureAttachments = _featureAttachments.Where(attachment => attachment.ContentType == "image/jpeg").ToList();
-
- // Configure array adapter.
- ArrayAdapter attachmentAdapter = new ArrayAdapter(
- this,
- Android.Resource.Layout.SimpleListItem1,
- _featureAttachments.Select(attachment => attachment.Name).ToArray());
-
- // Populate the list.
- _attachmentsListView.Adapter = attachmentAdapter;
- }
-
- private async Task PreviewAttachment(Attachment selectedAttachment)
- {
- if (selectedAttachment.ContentType.Contains("image"))
- {
- // Get the image data.
- Stream contentStream = await selectedAttachment.GetDataAsync();
- byte[] attachmentData = new byte[contentStream.Length];
- contentStream.Read(attachmentData, 0, attachmentData.Length);
-
- // Convert the image into a usable form on Android.
- Bitmap bmp = BitmapFactory.DecodeByteArray (attachmentData, 0, attachmentData.Length);
-
- // Create the view that will present the image.
- ImageView imageView = new ImageView(this);
- imageView.SetImageBitmap(bmp);
-
- // Show the image view in a dialog.
- ShowImageDialog(imageView);
- }
- else
- {
- ShowMessage("This sample can only show image attachments", "Can't show attachment");
- }
- }
-
- private void ShowImageDialog(ImageView previewImageView)
- {
- // Create the dialog.
- Dialog imageDialog = new Dialog(this);
-
- // Remove the title bar for the dialog.
- imageDialog.Window.RequestFeature(WindowFeatures.NoTitle);
-
- // Add the image to the dialog.
- imageDialog.SetContentView(previewImageView);
-
- // Show the dialog.
- imageDialog.Show();
- }
-
- private async Task DeleteAttachment(Attachment attachmentToDelete)
- {
- try
- {
- // Delete the attachment.
- await _selectedFeature.DeleteAttachmentAsync(attachmentToDelete);
-
- // Get a reference to the feature's service feature table.
- ServiceFeatureTable serviceTable = (ServiceFeatureTable) _selectedFeature.FeatureTable;
-
- // Apply the edits to the service feature table.
- await serviceTable.ApplyEditsAsync();
-
- // Update UI.
- _selectedFeature.Refresh();
- _featureAttachments = await _selectedFeature.GetAttachmentsAsync();
- UpdateUIForFeature();
- ShowMessage("Successfully deleted attachment", "Success!");
- }
- catch (Exception exception)
- {
- ShowMessage(exception.ToString(), "Error deleting attachment");
- }
- }
-
- private void RequestImage()
- {
- // Start the process of requesting an image. Will be completed in OnActivityResult.
- Intent = new Intent();
- Intent.SetType("image/*");
- Intent.SetAction(Intent.ActionGetContent);
- StartActivityForResult(Intent.CreateChooser(Intent, "Select Picture"), 1000);
- }
-
- protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
- {
- // Method called when the image picker activity ends.
- if (requestCode == 1000 && resultCode == Result.Ok && data != null)
- {
- // Get the path to the selected image.
- Android.Net.Uri uri = data.Data;
-
- // Upload the image as an attachment.
- AddAttachment(uri);
- }
- else
- {
- ShowMessage("No image selected.", "Error adding attachment");
- }
- }
-
- private async void AddAttachment(Android.Net.Uri imageUri)
- {
- string contentType = "image/jpeg";
-
- // Read the image into a stream.
- Stream stream = ContentResolver.OpenInputStream(imageUri);
-
- // Read from the stream into the byte array.
- byte[] attachmentData;
- using (var memoryStream = new MemoryStream())
- {
- stream.CopyTo(memoryStream);
- attachmentData = memoryStream.ToArray();
- }
-
- // Add the attachment.
- // The contentType string is the MIME type for JPEG files, image/jpeg.
- await _selectedFeature.AddAttachmentAsync(imageUri.LastPathSegment + ".jpg", contentType, attachmentData);
-
- // Get a reference to the feature's service feature table.
- ServiceFeatureTable serviceTable = (ServiceFeatureTable) _selectedFeature.FeatureTable;
-
- // Apply the edits to the service feature table.
- await serviceTable.ApplyEditsAsync();
-
- // Update UI.
- _selectedFeature.Refresh();
- _featureAttachments = await _selectedFeature.GetAttachmentsAsync();
- UpdateUIForFeature();
- ShowMessage("Successfully added attachment", "Success!");
- }
-
- private void Attachment_Clicked(object sender, AdapterView.ItemClickEventArgs e)
- {
- // Get the selected attachment.
- Attachment selectedAttachment = _featureAttachments[e.Position];
-
- // Create menu to show options.
- PopupMenu menu = new PopupMenu(this, (ListView) sender);
-
- // Handle the click, calling the right method depending on the command.
- menu.MenuItemClick += async (o, menuArgs) =>
- {
- menu.Dismiss();
- switch (menuArgs.Item.ToString())
- {
- case "View":
- await PreviewAttachment(selectedAttachment);
- break;
- case "Delete":
- await DeleteAttachment(selectedAttachment);
- break;
- }
- UpdateUIForFeature();
- };
-
- // Add the menu commands.
- menu.Menu.Add("View");
- menu.Menu.Add("Delete");
-
- // Show menu in the view.
- menu.Show();
- }
-
- private void ShowMessage(string message, string title)
- {
- // Display the message to the user.
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.SetMessage(message).SetTitle(title).Show();
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- var layout = new LinearLayout(this) {Orientation = Orientation.Vertical};
-
- // Create the MapView.
- _myMapView = new MapView(this);
-
- // Create the help label.
- TextView helpLabel = new TextView(this);
- helpLabel.Text = "Tap to select features.";
- helpLabel.TextAlignment = TextAlignment.Center;
- helpLabel.Gravity = GravityFlags.Center;
-
- // Add the help label to the layout.
- layout.AddView(helpLabel);
-
- // Create and add a listview for showing attachments;
- _attachmentsListView = new ListView(this);
- _attachmentsListView.Enabled = false;
- _attachmentsListView.SetMinimumHeight(100);
- layout.AddView(_attachmentsListView);
- _attachmentsListView.ItemClick += Attachment_Clicked;
-
- // Create and add an 'add attachment' button.
- _addButton = new Button(this);
- _addButton.Text = "Add attachment";
- _addButton.Enabled = false;
- _addButton.Click += AddButton_Clicked;
- layout.AddView(_addButton);
-
- // Add the map view to the layout.
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
-
- private void AddButton_Clicked(object sender, EventArgs e)
- {
- // Do nothing if nothing selected.
- if (_selectedFeature == null)
- {
- return;
- }
-
- // Start the process of requesting an image to add.
- RequestImage();
- }
- }
-}
diff --git a/src/Android/Xamarin.Android/Samples/Data/EditFeatureAttachments/EditFeatureAttachments.jpg b/src/Android/Xamarin.Android/Samples/Data/EditFeatureAttachments/EditFeatureAttachments.jpg
deleted file mode 100644
index 57ffd106b3..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/EditFeatureAttachments/EditFeatureAttachments.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/EditFeatureAttachments/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/EditFeatureAttachments/readme.metadata.json
deleted file mode 100644
index cd82c45189..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/EditFeatureAttachments/readme.metadata.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "category": "Data",
- "description": "Add, delete, and download attachments for features from a service.",
- "formal_name": "EditFeatureAttachments",
- "ignore": false,
- "images": [
- "EditFeatureAttachments.jpg"
- ],
- "keywords": [
- "JPEG",
- "PDF",
- "PNG",
- "TXT",
- "data",
- "image",
- "picture"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/editfeatureattachments.htm"
- ],
- "relevant_apis": [
- "ApplyEditsAsync",
- "DeleteAttachmentAsync",
- "FeatureLayer",
- "FetchAttachmentsAsync",
- "FetchDataAsync",
- "ServiceFeatureTable",
- "UpdateFeatureAsync"
- ],
- "snippets": [
- "EditFeatureAttachments.cs"
- ],
- "title": "Edit feature attachments"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/EditFeatureLinkedAnnotation/EditFeatureLinkedAnnotation.cs b/src/Android/Xamarin.Android/Samples/Data/EditFeatureLinkedAnnotation/EditFeatureLinkedAnnotation.cs
deleted file mode 100644
index 35ae8dc0b0..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/EditFeatureLinkedAnnotation/EditFeatureLinkedAnnotation.cs
+++ /dev/null
@@ -1,239 +0,0 @@
-// Copyright 2021 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.Graphics;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using ArcGISRuntime;
-using ArcGISRuntime.Samples.Managers;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace ArcGISRuntimeXamarin.Samples.EditFeatureLinkedAnnotation
-{
- [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Edit features with feature-linked annotation",
- category: "Data",
- description: "Edit feature attributes which are linked to annotation through an expression.",
- instructions: "Pan and zoom the map to see that the text on the map is annotation, not labels. Tap one of the address points to update the house number (AD_ADDRESS) and street name (ST_STR_NAM). Tap one of the dashed parcel polylines and tap another location to change its geometry. NOTE: Selection is only enabled for points and straight (single segment) polylines.",
- tags: new[] { "annotation", "attributes", "feature-linked annotation", "features", "fields" })]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("74c0c9fa80f4498c9739cc42531e9948")]
- [ArcGISRuntime.Samples.Shared.Attributes.AndroidLayout("EditAttributeLayout.xml")]
- public class EditFeatureLinkedAnnotation : Activity
- {
- // Hold references to the UI controls.
- private MapView _myMapView;
-
- private Feature _selectedFeature;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Edit features with feature-linked annotation";
-
- CreateLayout();
- _ = Initialize();
- }
-
- private async Task Initialize()
- {
- // NOTE: to be a writable geodatabase, this geodatabase must be generated from a service with a GeodatabaseSyncTask. See the "Generate geodatabase" sample.
- try
- {
- // Create and load geodatabase.
- string geodatabasePath = DataManager.GetDataFolder("74c0c9fa80f4498c9739cc42531e9948", "loudoun_anno.geodatabase");
- Geodatabase geodatabase = await Geodatabase.OpenAsync(geodatabasePath);
-
- // Create feature layers from tables in the geodatabase.
- FeatureLayer addressFeatureLayer = new FeatureLayer(geodatabase.GetGeodatabaseFeatureTable("Loudoun_Address_Points_1"));
- FeatureLayer parcelFeatureLayer = new FeatureLayer(geodatabase.GetGeodatabaseFeatureTable("ParcelLines_1"));
-
- // Create annotation layers from tables in the geodatabase.
- AnnotationLayer addressAnnotationLayer = new AnnotationLayer(geodatabase.GetGeodatabaseAnnotationTable("Loudoun_Address_PointsAnno_1"));
- AnnotationLayer parcelAnnotationLayer = new AnnotationLayer(geodatabase.GetGeodatabaseAnnotationTable("ParcelLinesAnno_1"));
-
- // Create a map with the layers.
- _myMapView.Map = new Map(BasemapStyle.ArcGISLightGray);
- _myMapView.Map.OperationalLayers.AddRange(new List { addressFeatureLayer, parcelFeatureLayer, addressAnnotationLayer, parcelAnnotationLayer });
-
- // Zoom to the extent of the parcels.
- await parcelFeatureLayer.LoadAsync();
- _myMapView.SetViewpoint(new Viewpoint(parcelFeatureLayer.FullExtent));
- }
- catch (Exception ex)
- {
- new AlertDialog.Builder(this).SetMessage(ex.Message).SetTitle(ex.GetType().Name).Show();
- }
- }
-
- private void MapViewTapped(object sender, GeoViewInputEventArgs e)
- {
- // Check if there is already a selected feature.
- if (_selectedFeature == null)
- {
- _ = SelectFeature(e.Position);
- }
- else
- {
- // Project the user selected point.
- MapPoint projPoint = GeometryEngine.Project(e.Location, _selectedFeature.Geometry.SpatialReference) as MapPoint;
-
- // Update the geometry of the selected feature.
- _ = UpdateGeometry(projPoint);
- }
- }
-
- private async Task SelectFeature(PointF clickedPoint)
- {
- try
- {
- // Identify across all layers.
- IReadOnlyList identifyResults = await _myMapView.IdentifyLayersAsync(clickedPoint, 10.0, false);
- foreach (IdentifyLayerResult result in identifyResults)
- {
- if (result.LayerContent is FeatureLayer layer)
- {
- _selectedFeature = result.GeoElements.First() as Feature;
- if (_selectedFeature.Geometry is Polyline line)
- {
- // No support for curved lines.
- if (line.Parts.Count > 1)
- {
- _selectedFeature = null;
- return;
- }
- }
- else if (_selectedFeature.Geometry is MapPoint)
- {
- // Open attribute editor for point features.
- ShowEditableAttributes();
- }
-
- // Select the feature.
- layer.SelectFeature(_selectedFeature);
- break;
- }
- }
- }
- catch (Exception ex)
- {
- new AlertDialog.Builder(this).SetMessage(ex.Message).SetTitle(ex.GetType().Name).Show();
- }
- }
-
- private async Task UpdateGeometry(MapPoint point)
- {
- if (_selectedFeature.Geometry is Polyline line)
- {
- // Get the nearest point on the selected line.
- ProximityResult nearestVertex = GeometryEngine.NearestVertex(line, point);
-
- // Create a new polyline.
- PolylineBuilder polylineBuilder = new PolylineBuilder(line);
- Part part = polylineBuilder.Parts[nearestVertex.PartIndex];
-
- // Replace the nearest point with the new point.
- part.SetPoint(nearestVertex.PointIndex, point);
-
- // Update the geometry of the feature.
- _selectedFeature.Geometry = GeometryEngine.Project(polylineBuilder.ToGeometry(), _selectedFeature.Geometry.SpatialReference);
- await _selectedFeature.FeatureTable.UpdateFeatureAsync(_selectedFeature);
- }
- else if (_selectedFeature.Geometry is MapPoint)
- {
- // Update the geometry of the feature.
- _selectedFeature.Geometry = point;
- await _selectedFeature.FeatureTable.UpdateFeatureAsync(_selectedFeature);
- }
-
- // Clear the selection.
- (_selectedFeature.FeatureTable.Layer as FeatureLayer).ClearSelection();
- _selectedFeature = null;
- }
-
- private void ShowEditableAttributes()
- {
- // Create the view for the editing UI.
- Android.Views.View editAttributesView = LayoutInflater.Inflate(Resource.Layout.EditAttributeLayout, null);
-
- // Create an alert dialog.
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
- dialogBuilder.SetTitle("Edit feature attributes");
- dialogBuilder.SetView(editAttributesView);
- EditText addressText = editAttributesView.FindViewById(Resource.Id.addressNumberEditText);
- EditText streetText = editAttributesView.FindViewById(Resource.Id.streetEditText);
-
- // Populate entry fields with data from feature.
- addressText.Text = _selectedFeature.Attributes["AD_ADDRESS"].ToString();
- streetText.Text = _selectedFeature.Attributes["ST_STR_NAM"].ToString();
-
- // Add buttons to finish the dialog
- dialogBuilder.SetNegativeButton("Cancel", (s, e) => { });
- dialogBuilder.SetPositiveButton("Ok", async (s, e) =>
- {
- try
- {
- // Update the feature attributes with the user input.
- _selectedFeature.Attributes["AD_ADDRESS"] = int.Parse(addressText.Text);
- _selectedFeature.Attributes["ST_STR_NAM"] = streetText.Text;
- await _selectedFeature.FeatureTable.UpdateFeatureAsync(_selectedFeature);
- }
- catch (Exception ex)
- {
- new AlertDialog.Builder(this).SetMessage(ex.Message).SetTitle(ex.GetType().Name).Show();
- }
- });
-
- dialogBuilder.Show();
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- var layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create the help label.
- TextView helpLabel = new TextView(this);
- helpLabel.Text = "1. Tap to select a feature.\n2. For MapPoint features, edit the feature attributes.\n3. Tap again to move the feature.";
- helpLabel.TextAlignment = TextAlignment.TextStart;
- helpLabel.Gravity = GravityFlags.Center;
-
- // Add the help label to the layout.
- layout.AddView(helpLabel);
-
- // Add the map view to the layout.
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
-
- // Add an event handler for the map view.
- _myMapView.GeoViewTapped += MapViewTapped;
- }
-
- protected override void OnDestroy()
- {
- base.OnDestroy();
-
- // Unhook the event handler.
- _myMapView.GeoViewTapped -= MapViewTapped;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/EditFeatureLinkedAnnotation/EditFeatureLinkedAnnotation.jpg b/src/Android/Xamarin.Android/Samples/Data/EditFeatureLinkedAnnotation/EditFeatureLinkedAnnotation.jpg
deleted file mode 100644
index bfd152921c..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/EditFeatureLinkedAnnotation/EditFeatureLinkedAnnotation.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/EditFeatureLinkedAnnotation/readme.md b/src/Android/Xamarin.Android/Samples/Data/EditFeatureLinkedAnnotation/readme.md
deleted file mode 100644
index e500a1d978..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/EditFeatureLinkedAnnotation/readme.md
+++ /dev/null
@@ -1,50 +0,0 @@
-# Edit features with feature-linked annotation
-
-Edit feature attributes which are linked to annotation through an expression.
-
-![Image of edit features with feature-linked annotation](EditFeatureLinkedAnnotation.jpg)
-
-## Use case
-
-Annotation is useful for displaying text that you don't want to move or resize when the map is panned or zoomed (unlike labels which will move and resize). Feature-linked annotation will update when a feature attribute referenced by the annotation expression is also updated. Additionally, the position of the annotation will transform to match any transformation to the linked feature's geometry.
-
-## How to use the sample
-
-Pan and zoom the map to see that the text on the map is annotation, not labels. Tap one of the address points to update the house number (AD_ADDRESS) and street name (ST_STR_NAM). Tap one of the dashed parcel polylines and tap another location to change its geometry. NOTE: Selection is only enabled for points and straight (single segment) polylines.
-
-The feature-linked annotation will update accordingly.
-
-## How it works
-
-1. Load the geodatabase. NOTE: Read/write geodatabases should normally come from a `GeodatabaseSyncTask`, but this has been omitted here. That functionality is covered in the sample *Generate geodatabase*.
-2. Create `FeatureLayer`s from geodatabase feature tables found in the geodatabase with `geodatabase.GeodatabaseFeatureTable`.
-3. Create `AnnotationLayer`s from geodatabase feature tables found in the geodatabase with `geodatabase.GeodatabaseAnnotationTable`.
-4. Add the `FeatureLayer`s and `AnnotationLayer`s to the map's operational layers.
-5. Use a `GeoViewTapped` event handler to listen for clicks on the map to either select address points or parcel polyline features. NOTE: Selection is only enabled for points and straight (single segment) polylines.
- * For the address points, a dialog is opened to allow editing of the address number (AD_ADDRESS) and street name (ST_STR_NAM) attributes.
- * For the parcel lines, a second tap will change one of the polyline's vertices.
-
-Both expressions were defined by the data author in ArcGIS Pro using [the Arcade expression language](https://developers.arcgis.com/arcade/).
-
-## Relevant API
-
-* AnnotationLayer
-* Feature
-* FeatureLayer
-* Geodatabase
-
-## Offline data
-
-This sample downloads the following items from ArcGIS Online automatically:
-
-* [loudoun_anno geodatabase](https://www.arcgis.com/home/item.html?id=74c0c9fa80f4498c9739cc42531e9948)
-
-## About the data
-
-This sample uses data derived from the [Loudoun GeoHub](https://geohub-loudoungis.opendata.arcgis.com/).
-
-The annotation linked to the point data in this sample is defined by arcade expression `$feature.AD_ADDRESS + " " + $feature.ST_STR_NAM`. The annotation linked to the parcel polyline data is defined by `Round(Length(Geometry($feature), 'feet'), 2)`.
-
-## Tags
-
-annotation, attributes, features, feature-linked annotation, fields
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/EditFeatureLinkedAnnotation/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/EditFeatureLinkedAnnotation/readme.metadata.json
deleted file mode 100644
index c8ce05cd61..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/EditFeatureLinkedAnnotation/readme.metadata.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "category": "Data",
- "description": "Edit feature attributes which are linked to annotation through an expression.",
- "formal_name": "EditFeatureLinkedAnnotation",
- "ignore": false,
- "images": [
- "EditFeatureLinkedAnnotation.jpg"
- ],
- "keywords": [
- "annotation",
- "attributes",
- "feature-linked annotation",
- "features",
- "fields"
- ],
- "offline_data": [
- "74c0c9fa80f4498c9739cc42531e9948"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/editfeaturelinkedannotation.htm"
- ],
- "relevant_apis": [
- "AnnotationLayer",
- "Feature",
- "FeatureLayer",
- "Geodatabase"
- ],
- "snippets": [
- "../../../Resources/layout/EditAttributeLayout.xml",
- "EditFeatureLinkedAnnotation.cs"
- ],
- "title": "Edit features with feature-linked annotation"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeoPackage/FeatureLayerGeoPackage.cs b/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeoPackage/FeatureLayerGeoPackage.cs
deleted file mode 100644
index e207735689..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeoPackage/FeatureLayerGeoPackage.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright 2017 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using System;
-using System.Linq;
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using ArcGISRuntime.Samples.Managers;
-using Esri.ArcGISRuntime.Data;
-
-namespace ArcGISRuntime.Samples.FeatureLayerGeoPackage
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("68ec42517cdd439e81b036210483e8e7")]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Feature layer (GeoPackage)",
- category: "Data",
- description: "Display features from a local GeoPackage.",
- instructions: "Pan and zoom around the map. View the data loaded from the geopackage.",
- tags: new[] { "OGC", "feature table", "geopackage", "gpkg", "package", "standards" })]
- public class FeatureLayerGeoPackage : Activity
- {
- private MapView _myMapView;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Feature layer (GeoPackage)";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private async void Initialize()
- {
- // Create a new map centered on Aurora Colorado
- _myMapView.Map = new Map(BasemapStyle.ArcGISLightGray);
- _myMapView.Map.InitialViewpoint = new Viewpoint(39.7294, -104.8319, 175000);
-
- // Get the full path
- string geoPackagePath = GetGeoPackagePath();
-
- try
- {
- // Open the GeoPackage
- GeoPackage myGeoPackage = await GeoPackage.OpenAsync(geoPackagePath);
-
- // Read the feature tables and get the first one
- FeatureTable geoPackageTable = myGeoPackage.GeoPackageFeatureTables.FirstOrDefault();
-
- // Make sure a feature table was found in the package
- if (geoPackageTable == null) { return; }
-
- // Create a layer to show the feature table
- FeatureLayer newLayer = new FeatureLayer(geoPackageTable);
- await newLayer.LoadAsync();
-
- // Add the feature table as a layer to the map (with default symbology)
- _myMapView.Map.OperationalLayers.Add(newLayer);
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private static string GetGeoPackagePath()
- {
- return DataManager.GetDataFolder("68ec42517cdd439e81b036210483e8e7", "AuroraCO.gpkg");
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add a map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeoPackage/FeatureLayerGeoPackage.jpg b/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeoPackage/FeatureLayerGeoPackage.jpg
deleted file mode 100644
index 7893b5f0be..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeoPackage/FeatureLayerGeoPackage.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeoPackage/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeoPackage/readme.metadata.json
deleted file mode 100644
index f65c8dea58..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeoPackage/readme.metadata.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "category": "Data",
- "description": "Display features from a local GeoPackage.",
- "formal_name": "FeatureLayerGeoPackage",
- "ignore": false,
- "images": [
- "FeatureLayerGeoPackage.jpg"
- ],
- "keywords": [
- "OGC",
- "feature table",
- "geopackage",
- "gpkg",
- "package",
- "standards"
- ],
- "offline_data": [
- "68ec42517cdd439e81b036210483e8e7"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/featurelayergeopackage.htm"
- ],
- "relevant_apis": [
- "FeatureLayer",
- "GeoPackage",
- "GeoPackageFeatureTable",
- "Map"
- ],
- "snippets": [
- "FeatureLayerGeoPackage.cs"
- ],
- "title": "Feature layer (GeoPackage)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeodatabase/FeatureLayerGeodatabase.cs b/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeodatabase/FeatureLayerGeodatabase.cs
deleted file mode 100644
index 5d4506b135..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeodatabase/FeatureLayerGeodatabase.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using System;
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using ArcGISRuntime.Samples.Managers;
-
-namespace ArcGISRuntime.Samples.FeatureLayerGeodatabase
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("2b0f9e17105847809dfeb04e3cad69e0")]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Feature layer (geodatabase)",
- category: "Data",
- description: "Display features from a local geodatabase.",
- instructions: "",
- tags: new[] { "geodatabase", "mobile", "offline" })]
- public class FeatureLayerGeodatabase : Activity
- {
- // Create a reference to MapView.
- private MapView _myMapView;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Feature layer (geodatabase)";
-
- CreateLayout();
-
- // Open a mobile geodatabase (.geodatabase file) stored locally and add it to the map as a feature layer.
- Initialize();
- }
-
- private async void Initialize()
- {
- // Create a new map to display in the map view with a streets basemap.
- _myMapView.Map = new Map(BasemapStyle.ArcGISStreets);
-
- // Get the path to the downloaded mobile geodatabase (.geodatabase file).
- string mobileGeodatabaseFilePath = GetMobileGeodatabasePath();
-
- try
- {
- // Open the mobile geodatabase.
- Geodatabase mobileGeodatabase = await Geodatabase.OpenAsync(mobileGeodatabaseFilePath);
-
- // Get the 'Trailheads' geodatabase feature table from the mobile geodatabase.
- GeodatabaseFeatureTable trailheadsGeodatabaseFeatureTable = mobileGeodatabase.GetGeodatabaseFeatureTable("Trailheads");
-
- // Asynchronously load the 'Trailheads' geodatabase feature table.
- await trailheadsGeodatabaseFeatureTable.LoadAsync();
-
- // Create a feature layer based on the geodatabase feature table.
- FeatureLayer trailheadsFeatureLayer = new FeatureLayer(trailheadsGeodatabaseFeatureTable);
-
- // Add the feature layer to the operations layers collection of the map.
- _myMapView.Map.OperationalLayers.Add(trailheadsFeatureLayer);
-
- // Zoom the map to the extent of the feature layer.
- await _myMapView.SetViewpointGeometryAsync(trailheadsFeatureLayer.FullExtent, 50);
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private static string GetMobileGeodatabasePath()
- {
- // Use samples viewer's DataManager helper class to get the path of the downloaded dataset on disk.
- // NOTE: The url for the actual data is: https://www.arcgis.com/home/item.html?id=2b0f9e17105847809dfeb04e3cad69e0.
- return DataManager.GetDataFolder("2b0f9e17105847809dfeb04e3cad69e0", "LA_Trails.geodatabase");
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add a map view to the layout.
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeodatabase/FeatureLayerGeodatabase.jpg b/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeodatabase/FeatureLayerGeodatabase.jpg
deleted file mode 100644
index 068646501a..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeodatabase/FeatureLayerGeodatabase.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeodatabase/readme.md b/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeodatabase/readme.md
deleted file mode 100644
index ae28107a5e..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeodatabase/readme.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# Feature layer (geodatabase)
-
-Display features from a local geodatabase.
-
-![Image of feature layer geodatabase](FeatureLayerGeodatabase.jpg)
-
-## Use case
-
-Accessing data from a local geodatabase is useful when working in an environment that has an inconsistent internet connection or that does not have an internet connection at all. For example, a department of transportation field worker might source map data from a local geodatabase when conducting signage inspections in rural areas with poor network coverage.
-
-## How it works
-
-1. Create a geodatabase using the provided local resource, `new Geodatabase(geodatabaseResourceUrl)`.
-2. Wait for geodatabase to load.
-3. Get the 'Trailheads' `GeodatabaseFeatureTable` from the geodatabase, `Geodatabase.GeodatabaseFeatureTable(tableName)`.
-4. Create feature layer using the table from above, `new FeatureLayer(geodatabaseFeatureTable)`.
-5. Add feature layer to `Map` with `Map.OperationalLayers.Add(featureLayer)`.
-
-## Relevant API
-
-* FeatureLayer
-* Geodatabase
-* GeodatabaseFeatureTable
-
-## Offline data
-
-* [Los Angeles Vector Tile Package](https://www.arcgis.com/home/item.html?id=d9f8ce6f6ac84b90a665a861d71a5d0a) - Streets Vector Tile Package (vtpk) for the City of Los Angeles.
-* [Los Angeles Trailheads](https://www.arcgis.com/home/item.html?id=2b0f9e17105847809dfeb04e3cad69e0) - Mobile geodatabase containing LA trailhead locations
-
-## Additional information
-
-One of the ArcGIS Runtime data set types that can be accessed via the local storage of the device (i.e. hard drive, flash drive, micro SD card, USB stick, etc.) is a mobile geodatabase. A mobile geodatabase can be provisioned for use in an ArcGIS Runtime application by ArcMap. The following provide some helpful tips on how to create a mobile geodatabase file:
-
-In ArcMap, choose File > Share As > ArcGIS Runtime Content from the menu items to create the .geodatabase file (see the document: http://desktop.arcgis.com/en/arcmap/latest/map/working-with-arcmap/creating-arcgis-runtime-content.htm).
-
-Note: You could also use the 'Services Pattern' and access the `Geodatabase` class via a Feature Service served up via ArcGIS Online or ArcGIS Enterprise. Instead of using the `Geodatabase` class to access the .geodatabase file on disk, you would use `GeodatabaseSyncTask` to point to a Uri instead.
-
-## Tags
-
-geodatabase, mobile, offline
diff --git a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeodatabase/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeodatabase/readme.metadata.json
deleted file mode 100644
index 1e28a8a45b..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerGeodatabase/readme.metadata.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "category": "Data",
- "description": "Display features from a local geodatabase.",
- "formal_name": "FeatureLayerGeodatabase",
- "ignore": false,
- "images": [
- "FeatureLayerGeodatabase.jpg"
- ],
- "keywords": [
- "geodatabase",
- "mobile",
- "offline"
- ],
- "offline_data": [
- "d9f8ce6f6ac84b90a665a861d71a5d0a",
- "2b0f9e17105847809dfeb04e3cad69e0"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/featurelayergeodatabase.htm"
- ],
- "relevant_apis": [
- "FeatureLayer",
- "Geodatabase",
- "GeodatabaseFeatureTable"
- ],
- "snippets": [
- "FeatureLayerGeodatabase.cs"
- ],
- "title": "Feature layer (geodatabase)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerQuery/FeatureLayerQuery.cs b/src/Android/Xamarin.Android/Samples/Data/FeatureLayerQuery/FeatureLayerQuery.cs
deleted file mode 100644
index fc4cf83ef9..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerQuery/FeatureLayerQuery.cs
+++ /dev/null
@@ -1,203 +0,0 @@
-// Copyright 2016 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Linq;
-using System.Threading.Tasks;
-using Android.Text;
-
-namespace ArcGISRuntime.Samples.FeatureLayerQuery
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Feature layer query",
- category: "Data",
- description: "Find features in a feature table which match an SQL query.",
- instructions: "Input the name of a U.S. state into the text field. When you tap the button, a query is performed and the matching features are highlighted or an error is returned.",
- tags: new[] { "query", "search" })]
- public class FeatureLayerQuery : Activity
- {
- // Create reference to service of US States
- private string _statesUrl = "https://services.arcgis.com/jIL9msH9OI208GCb/arcgis/rest/services/USA_Daytime_Population_2016/FeatureServer/0";
-
- // Hold a reference to the map view
- private MapView _myMapView;
-
- // Create globally available text box for easy referencing
- private EditText _queryTextBox;
-
- // Create globally available feature table for easy referencing
- private ServiceFeatureTable _featureTable;
-
- // Create globally available feature layer for easy referencing
- private FeatureLayer _featureLayer;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- Title = "Feature layer query";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create new Map with basemap
- Map myMap = new Map(BasemapStyle.ArcGISTopographic);
-
- // Create and set initial map location
- MapPoint initialLocation = new MapPoint(
- -11000000, 5000000, SpatialReferences.WebMercator);
- myMap.InitialViewpoint = new Viewpoint(initialLocation, 100000000);
-
- // Create feature table using a url
- _featureTable = new ServiceFeatureTable(new Uri(_statesUrl));
-
- // Create feature layer using this feature table
- _featureLayer = new FeatureLayer(_featureTable)
- {
- // Set the Opacity of the Feature Layer
- Opacity = 0.6,
- // Work around service setting
- MaxScale = 10
- };
-
- // Create a new renderer for the States Feature Layer.
- SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Black, 1);
- SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, Color.Transparent, lineSymbol);
-
- // Set States feature layer renderer
- _featureLayer.Renderer = new SimpleRenderer(fillSymbol);
-
- // Add feature layer to the map
- myMap.OperationalLayers.Add(_featureLayer);
-
- // Update the selection color
- _myMapView.SelectionProperties.Color = Color.Cyan;
-
- // Assign the map to the MapView
- _myMapView.Map = myMap;
- }
-
- private async void OnQueryClicked(object sender, EventArgs e)
- {
- // Remove any previous feature selections that may have been made
- _featureLayer.ClearSelection();
-
- // Begin query process
- await QueryStateFeature(_queryTextBox.Text);
- }
-
- private async Task QueryStateFeature(string stateName)
- {
- // Create dialog to display alert information
- AlertDialog.Builder alert = new AlertDialog.Builder(this);
-
- try
- {
- // Create a query parameters that will be used to Query the feature table
- QueryParameters queryParams = new QueryParameters
- {
-
- // Construct and assign the where clause that will be used to query the feature table
- WhereClause = "upper(STATE_NAME) LIKE '%" + stateName.Trim().ToUpper() + "%'"
- };
-
- // Query the feature table
- FeatureQueryResult queryResult = await _featureTable.QueryFeaturesAsync(queryParams);
-
- // Cast the QueryResult to a List so the results can be interrogated.
- List features = queryResult.ToList();
-
- if (features.Any())
- {
- // Create an envelope.
- EnvelopeBuilder envBuilder = new EnvelopeBuilder(SpatialReferences.WebMercator);
-
- // Loop over each feature from the query result.
- foreach (Feature feature in features)
- {
- // Add the extent of each matching feature to the envelope.
- envBuilder.UnionOf(feature.Geometry.Extent);
-
- // Select each feature.
- _featureLayer.SelectFeature(feature);
- }
-
- // Zoom to the extent of the selected feature(s).
- await _myMapView.SetViewpointGeometryAsync(envBuilder.ToGeometry(), 50);
- }
- else
- {
- alert.SetTitle("State Not Found!");
- alert.SetMessage("Add a valid state name.");
- alert.Show();
- }
- }
- catch (Exception ex)
- {
- alert.SetTitle("Sample Error");
- alert.SetMessage(ex.Message);
- alert.Show();
- }
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create new Text box that will take the query parameter
- _queryTextBox = new EditText(this)
- {
- InputType = InputTypes.ClassText | InputTypes.TextVariationNormal
- };
- _queryTextBox.SetMaxLines(1);
-
- // Create Button that will start the Feature Query
- Button queryButton = new Button(this)
- {
- Text = "Query"
- };
- queryButton.Click += OnQueryClicked;
-
- // Create and add a help label
- TextView helpLabel = new TextView(this)
- {
- Text = "Enter the name of a state, then press 'Query' to search."
- };
- layout.AddView(helpLabel);
-
- // Add TextBox to the layout
- layout.AddView(_queryTextBox);
-
- // Add Button to the layout
- layout.AddView(queryButton);
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerQuery/FeatureLayerQuery.jpg b/src/Android/Xamarin.Android/Samples/Data/FeatureLayerQuery/FeatureLayerQuery.jpg
deleted file mode 100644
index d049492a47..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerQuery/FeatureLayerQuery.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerQuery/readme.md b/src/Android/Xamarin.Android/Samples/Data/FeatureLayerQuery/readme.md
deleted file mode 100644
index 17c749f434..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerQuery/readme.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Feature layer query
-
-Find features in a feature table which match an SQL query.
-
-![Image of feature layer query](FeatureLayerQuery.jpg)
-
-## Use case
-
-Query expressions can be used in ArcGIS to select a subset of features from a feature table. This is most useful in large or complicated data sets. A possible use case might be on a feature table marking the location of street furniture through a city. A user may wish to query by a TYPE column to return "benches". In this sample, we query a U.S. state by STATE_NAME from a feature table containing all U.S. states.
-
-## How to use the sample
-
-Input the name of a U.S. state into the text field. When you tap the button, a query is performed and the matching features are highlighted or an error is returned.
-
-## How it works
-
-1. Create a `ServiceFeatureTable` using the URL of a feature service.
-2. Create a `QueryParameters` with a where clause specified using the `WhereClause` property.
-3. Perform the query using `QueryFeaturesAsync(query)` on the service feature table.
-4. When complete, the query will return a `FeatureQueryResult` which can be iterated over to get the matching features.
-
-## Relevant API
-
-* FeatureLayer
-* FeatureQueryResult
-* QueryParameters
-* ServiceFeatureTable
-
-## About the data
-
-This sample uses U.S. State polygon features from the [USA 2016 Daytime Population](https://www.arcgis.com/home/item.html?id=f01f0eda766344e29f42031e7bfb7d04) feature service.
-
-## Tags
-
-search, query
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerQuery/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/FeatureLayerQuery/readme.metadata.json
deleted file mode 100644
index 114c459749..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerQuery/readme.metadata.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "category": "Data",
- "description": "Find features in a feature table which match an SQL query.",
- "formal_name": "FeatureLayerQuery",
- "ignore": false,
- "images": [
- "FeatureLayerQuery.jpg"
- ],
- "keywords": [
- "query",
- "search"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/featurelayerquery.htm"
- ],
- "relevant_apis": [
- "FeatureLayer",
- "FeatureQueryResult",
- "QueryParameters",
- "ServiceFeatureTable"
- ],
- "snippets": [
- "FeatureLayerQuery.cs"
- ],
- "title": "Feature layer query"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerShapefile/FeatureLayerShapefile.cs b/src/Android/Xamarin.Android/Samples/Data/FeatureLayerShapefile/FeatureLayerShapefile.cs
deleted file mode 100644
index e9a6f8d806..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerShapefile/FeatureLayerShapefile.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2017 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using System;
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using ArcGISRuntime.Samples.Managers;
-
-namespace ArcGISRuntime.Samples.FeatureLayerShapefile
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("d98b3e5293834c5f852f13c569930caa")]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Feature layer (shapefile)",
- category: "Data",
- description: "Open a shapefile stored on the device and display it as a feature layer with default symbology.",
- instructions: "Pan and zoom around the map to observe the data from the shapefile.",
- tags: new[] { "layers", "shapefile", "shp", "vector" })]
- public class FeatureLayerShapefile : Activity
- {
- private MapView _myMapView;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Feature layer (shapefile)";
- CreateLayout();
-
- // Download (if necessary) and add a local shapefile dataset to the map
- Initialize();
- }
-
- private async void Initialize()
- {
- // Create a new map to display in the map view with a streets basemap
- _myMapView.Map = new Map(BasemapStyle.ArcGISStreets);
-
- // Get the path to the downloaded shapefile
- string filepath = GetShapefilePath();
-
- try
- {
- // Open the shapefile
- ShapefileFeatureTable myShapefile = await ShapefileFeatureTable.OpenAsync(filepath);
-
- // Create a feature layer to display the shapefile
- FeatureLayer newFeatureLayer = new FeatureLayer(myShapefile);
-
- // Add the feature layer to the map
- _myMapView.Map.OperationalLayers.Add(newFeatureLayer);
-
- // Zoom the map to the extent of the shapefile
- await _myMapView.SetViewpointGeometryAsync(newFeatureLayer.FullExtent, 50);
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private static string GetShapefilePath()
- {
- return DataManager.GetDataFolder("d98b3e5293834c5f852f13c569930caa", "Public_Art.shp");
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add a map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerShapefile/FeatureLayerShapefile.jpg b/src/Android/Xamarin.Android/Samples/Data/FeatureLayerShapefile/FeatureLayerShapefile.jpg
deleted file mode 100644
index 7bcc64ed5e..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerShapefile/FeatureLayerShapefile.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerShapefile/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/FeatureLayerShapefile/readme.metadata.json
deleted file mode 100644
index 54c498ee3e..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/FeatureLayerShapefile/readme.metadata.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "category": "Data",
- "description": "Open a shapefile stored on the device and display it as a feature layer with default symbology.",
- "formal_name": "FeatureLayerShapefile",
- "ignore": false,
- "images": [
- "FeatureLayerShapefile.jpg"
- ],
- "keywords": [
- "layers",
- "shapefile",
- "shp",
- "vector"
- ],
- "offline_data": [
- "d98b3e5293834c5f852f13c569930caa"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/featurelayershapefile.htm"
- ],
- "relevant_apis": [
- "FeatureLayer",
- "ShapefileFeatureTable"
- ],
- "snippets": [
- "FeatureLayerShapefile.cs"
- ],
- "title": "Feature layer (shapefile)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/GenerateGeodatabase/GenerateGeodatabase.cs b/src/Android/Xamarin.Android/Samples/Data/GenerateGeodatabase/GenerateGeodatabase.cs
deleted file mode 100644
index 8a00e48fbc..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/GenerateGeodatabase/GenerateGeodatabase.cs
+++ /dev/null
@@ -1,349 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using ArcGISRuntime.Samples.Managers;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.Tasks;
-using Esri.ArcGISRuntime.Tasks.Offline;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Drawing;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using Esri.ArcGISRuntime.ArcGISServices;
-
-namespace ArcGISRuntime.Samples.GenerateGeodatabase
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("e4a398afe9a945f3b0f4dca1e4faccb5")]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Generate geodatabase",
- category: "Data",
- description: "Generate a local geodatabase from an online feature service.",
- instructions: "Zoom to any extent. Then tap the generate button to generate a geodatabase of features from a feature service filtered to the current extent. A red outline will show the extent used. The job's progress is shown while the geodatabase is generated.",
- tags: new[] { "disconnected", "local geodatabase", "offline", "sync" })]
- public class GenerateGeodatabase : Activity
- {
- // URL for a feature service that supports geodatabase generation.
- private Uri _featureServiceUri = new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Sync/WildfireSync/FeatureServer");
-
- // Path to the geodatabase file on disk.
- private string _gdbPath;
-
- // Task to be used for generating the geodatabase.
- private GeodatabaseSyncTask _gdbSyncTask;
-
- // Job used to generate the geodatabase.
- private GenerateGeodatabaseJob _generateGdbJob;
-
- // Mapview.
- private MapView myMapView;
-
- // Generate Button.
- private Button myGenerateButton;
-
- // Progress indicator.
- private AlertDialog alertDialog;
- private ProgressBar progressIndicator;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- Title = "Generate geodatabase";
-
- // Create the UI, setup the control references and execute initialization.
- CreateLayout();
- Initialize();
- }
-
- private void CreateLayout()
- {
- // Create the layout.
- LinearLayout layout = new LinearLayout(this)
- {
- Orientation = Orientation.Vertical
- };
-
- // Add the generate button.
- myGenerateButton = new Button(this)
- {
- Text = "Generate",
- Enabled = false
- };
- myGenerateButton.Click += GenerateButton_Clicked;
- layout.AddView(myGenerateButton);
-
- // Add the mapview.
- myMapView = new MapView(this);
- layout.AddView(myMapView);
-
- // Add the layout to the view.
- SetContentView(layout);
-
- // Create the progress dialog display.
- progressIndicator = new ProgressBar(this);
- AlertDialog.Builder builder = new AlertDialog.Builder(this).SetView(progressIndicator);
- builder.SetMessage("Generating geodatabase");
- alertDialog = builder.Create();
- }
-
- private async void Initialize()
- {
- // Create a tile cache and load it with the SanFrancisco streets tpk.
- try
- {
- TileCache tileCache = new TileCache(DataManager.GetDataFolder("e4a398afe9a945f3b0f4dca1e4faccb5", "SanFrancisco.tpkx"));
-
- // Create the corresponding layer based on the tile cache.
- ArcGISTiledLayer tileLayer = new ArcGISTiledLayer(tileCache);
-
- // Create the basemap based on the tile cache.
- Basemap sfBasemap = new Basemap(tileLayer);
-
- // Create the map with the tile-based basemap.
- Map myMap = new Map(sfBasemap);
-
- // Assign the map to the MapView.
- myMapView.Map = myMap;
-
- // Create a new symbol for the extent graphic.
- SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Red, 2);
-
- // Create graphics overlay for the extent graphic and apply a renderer.
- GraphicsOverlay extentOverlay = new GraphicsOverlay
- {
- Renderer = new SimpleRenderer(lineSymbol)
- };
-
- // Add graphics overlay to the map view.
- myMapView.GraphicsOverlays.Add(extentOverlay);
-
- // Set up an event handler for when the viewpoint (extent) changes.
- myMapView.ViewpointChanged += MapViewExtentChanged;
-
- // Create a task for generating a geodatabase (GeodatabaseSyncTask).
- _gdbSyncTask = await GeodatabaseSyncTask.CreateAsync(_featureServiceUri);
-
- // Add all graphics from the service to the map.
- foreach (IdInfo layer in _gdbSyncTask.ServiceInfo.LayerInfos)
- {
- // Create the ServiceFeatureTable for this particular layer.
- ServiceFeatureTable onlineTable = new ServiceFeatureTable(new Uri(_featureServiceUri + "/" + layer.Id));
-
- // Wait for the table to load.
- await onlineTable.LoadAsync();
-
- // Add the layer to the map's operational layers if load succeeds.
- if (onlineTable.LoadStatus == Esri.ArcGISRuntime.LoadStatus.Loaded)
- {
- myMap.OperationalLayers.Add(new FeatureLayer(onlineTable));
- }
- }
-
- // Update the graphic - in case user doesn't interact with the map.
- UpdateMapExtent();
-
- // Enable the generate button now that the sample is ready.
- myGenerateButton.Enabled = true;
- }
- catch (Exception ex)
- {
- ShowStatusMessage(ex.ToString());
- }
- }
-
- private void UpdateMapExtent()
- {
- // Return if mapview is null.
- if (myMapView == null) { return; }
-
- // Get the new viewpoint.
- Viewpoint myViewPoint = myMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry);
-
- // Return if viewpoint is null.
- if (myViewPoint == null) { return; }
-
- // Get the updated extent for the new viewpoint.
- Envelope extent = myViewPoint.TargetGeometry as Envelope;
-
- // Return if extent is null.
- if (extent == null) { return; }
-
- // Create an envelope that is a bit smaller than the extent.
- EnvelopeBuilder envelopeBldr = new EnvelopeBuilder(extent);
- envelopeBldr.Expand(0.80);
-
- // Get the (only) graphics overlay in the map view.
- GraphicsOverlay extentOverlay = myMapView.GraphicsOverlays.FirstOrDefault();
-
- // Return if the extent overlay is null.
- if (extentOverlay == null) { return; }
-
- // Get the extent graphic.
- Graphic extentGraphic = extentOverlay.Graphics.FirstOrDefault();
-
- // Create the extent graphic and add it to the overlay if it doesn't exist.
- if (extentGraphic == null)
- {
- extentGraphic = new Graphic(envelopeBldr.ToGeometry());
- extentOverlay.Graphics.Add(extentGraphic);
- }
- else
- {
- // Otherwise, update the graphic's geometry.
- extentGraphic.Geometry = envelopeBldr.ToGeometry();
- }
- }
-
- private async Task StartGeodatabaseGeneration()
- {
- // Update the geodatabase path.
- _gdbPath = $"{Path.GetTempFileName()}.geodatabase";
-
- // Create a task for generating a geodatabase (GeodatabaseSyncTask).
- _gdbSyncTask = await GeodatabaseSyncTask.CreateAsync(_featureServiceUri);
-
- // Get the current extent of the red preview box.
- Envelope extent = myMapView.GraphicsOverlays.First().Graphics.First().Geometry as Envelope;
-
- // Get the default parameters for the generate geodatabase task.
- GenerateGeodatabaseParameters generateParams = await _gdbSyncTask.CreateDefaultGenerateGeodatabaseParametersAsync(extent);
-
- // Create a generate geodatabase job.
- _generateGdbJob = _gdbSyncTask.GenerateGeodatabase(generateParams, _gdbPath);
-
- // Handle the progress changed event (to show progress bar).
- _generateGdbJob.ProgressChanged += (sender, e) =>
- {
- UpdateProgressBar();
- };
-
- // Show the progress bar.
- alertDialog.Show();
-
- // Start the job.
- _generateGdbJob.Start();
-
- // Wait for the geodatabase.
- Geodatabase resultGdb = await _generateGdbJob.GetResultAsync();
-
- // Hide the progress bar.
- alertDialog.Dismiss();
-
- // Do the rest of the work.
- await HandleGenerationCompleted(_generateGdbJob, resultGdb);
- }
-
- private async Task HandleGenerationCompleted(GenerateGeodatabaseJob job, Geodatabase resultGdb)
- {
- JobStatus status = job.Status;
-
- // If the job completed successfully, add the geodatabase data to the map.
- if (status == JobStatus.Succeeded)
- {
- // Clear out the existing layers.
- myMapView.Map.OperationalLayers.Clear();
-
- // Loop through all feature tables in the geodatabase and add a new layer to the map.
- foreach (GeodatabaseFeatureTable table in resultGdb.GeodatabaseFeatureTables)
- {
- // Create a new feature layer for the table.
- FeatureLayer _layer = new FeatureLayer(table);
-
- // Add the new layer to the map.
- myMapView.Map.OperationalLayers.Add(_layer);
- }
- // Best practice is to unregister the geodatabase.
- await _gdbSyncTask.UnregisterGeodatabaseAsync(resultGdb);
-
- // Tell the user that the geodatabase was unregistered.
- ShowStatusMessage("Since no edits will be made, the local geodatabase has been unregistered per best practice.");
-
- // Re-enable the generate button.
- myGenerateButton.Enabled = true;
- }
-
- // See if the job failed.
- if (status == JobStatus.Failed)
- {
- // Create a message to show the user.
- string message = "Generate geodatabase job failed";
-
- // Show an error message (if there is one).
- if (job.Error != null)
- {
- message += ": " + job.Error.Message;
- }
- else
- {
- // If no error, show messages from the job.
- message += ": " + string.Join("\n", job.Messages.Select(m => m.Message));
- }
-
- // Show error message.
- ShowStatusMessage(message);
-
- // Re-enable the generate button.
- myGenerateButton.Enabled = true;
- }
- }
-
- private void ShowStatusMessage(string message)
- {
- // Display the message to the user.
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.SetMessage(message).SetTitle("Alert").Show();
- }
-
- private async void GenerateButton_Clicked(object sender, EventArgs e)
- {
- // Fix the extent of the graphic.
- myMapView.ViewpointChanged -= MapViewExtentChanged;
-
- try
- {
- // Disable the generate button.
- myGenerateButton.Enabled = false;
-
- // Call the geodatabase generation method.
- await StartGeodatabaseGeneration();
- }
- catch (Exception ex)
- {
- ShowStatusMessage(ex.ToString());
- }
- }
-
- private void MapViewExtentChanged(object sender, EventArgs e)
- {
- // Call the map extent update method.
- UpdateMapExtent();
- }
-
- private void UpdateProgressBar()
- {
- // Due to the nature of the threading implementation,
- // the dispatcher needs to be used to interact with the UI.
- RunOnUiThread(() =>
- {
- // Update the progress bar value.
- progressIndicator.Progress = _generateGdbJob.Progress;
- alertDialog.SetMessage($"Generating geodatabase ({_generateGdbJob.Progress}%)");
- });
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/GenerateGeodatabase/GenerateGeodatabase.jpg b/src/Android/Xamarin.Android/Samples/Data/GenerateGeodatabase/GenerateGeodatabase.jpg
deleted file mode 100644
index ef47935cf8..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/GenerateGeodatabase/GenerateGeodatabase.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/GenerateGeodatabase/readme.md b/src/Android/Xamarin.Android/Samples/Data/GenerateGeodatabase/readme.md
deleted file mode 100644
index 3a5ebc82d0..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/GenerateGeodatabase/readme.md
+++ /dev/null
@@ -1,32 +0,0 @@
-# Generate geodatabase
-
-Generate a local geodatabase from an online feature service.
-
-![Image of generate geodatabase](GenerateGeodatabase.jpg)
-
-## Use case
-
-Generating geodatabases is the first step toward taking a feature service offline. It allows you to save features locally for offline display.
-
-## How to use the sample
-
-Zoom to any extent. Then tap the generate button to generate a geodatabase of features from a feature service filtered to the current extent. A red outline will show the extent used. The job's progress is shown while the geodatabase is generated.
-
-## How it works
-
-1. Create a `GeodatabaseSyncTask` with the URL of the feature service and load it.
-2. Create `GenerateGeodatabaseParameters` specifying the extent and whether to include attachments.
-3. Create a `GenerateGeodatabaseJob` with `geodatabaseSyncTask.GenerateGeodatabaseAsync(parameters, downloadPath)`. Start the job with `job.Start()`.
-4. When the job is done, `job.GetResultAsync()` will return the geodatabase. Inside the geodatabase are feature tables which can be used to add feature layers to the map.
-5. Call `syncTask.UnregisterGeodatabaseAsync(geodatabase)` after generation when you're not planning on syncing changes to the service.
-
-## Relevant API
-
-* GenerateGeodatabaseJob
-* GenerateGeodatabaseParameters
-* Geodatabase
-* GeodatabaseSyncTask
-
-## Tags
-
-disconnected, local geodatabase, offline, sync
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/GenerateGeodatabase/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/GenerateGeodatabase/readme.metadata.json
deleted file mode 100644
index a6369dec56..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/GenerateGeodatabase/readme.metadata.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "category": "Data",
- "description": "Generate a local geodatabase from an online feature service.",
- "formal_name": "GenerateGeodatabase",
- "ignore": false,
- "images": [
- "GenerateGeodatabase.jpg"
- ],
- "keywords": [
- "disconnected",
- "local geodatabase",
- "offline",
- "sync"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/generategeodatabase.htm"
- ],
- "relevant_apis": [
- "GenerateGeodatabaseJob",
- "GenerateGeodatabaseParameters",
- "Geodatabase",
- "GeodatabaseSyncTask"
- ],
- "snippets": [
- "GenerateGeodatabase.cs"
- ],
- "title": "Generate geodatabase"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/GeodatabaseTransactions/GeodatabaseTransactions.cs b/src/Android/Xamarin.Android/Samples/Data/GeodatabaseTransactions/GeodatabaseTransactions.cs
deleted file mode 100644
index 9217285757..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/GeodatabaseTransactions/GeodatabaseTransactions.cs
+++ /dev/null
@@ -1,605 +0,0 @@
-// Copyright 2017 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// Language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Tasks;
-using Esri.ArcGISRuntime.Tasks.Offline;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.IO;
-using System.Threading.Tasks;
-using Android.Views;
-
-namespace ArcGISRuntime.Samples.GeodatabaseTransactions
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Geodatabase transactions",
- category: "Data",
- description: "Use transactions to manage how changes are committed to a geodatabase.",
- instructions: "When the sample loads, a feature service is taken offline as a geodatabase. When the geodatabase is ready, you can add multiple types of features. To apply edits directly, uncheck the 'Require a transaction for edits' checkbox. When using transactions, use the buttons to start editing and stop editing. When you stop editing, you can choose to commit the changes or roll them back. At any point, you can synchronize the local geodatabase with the feature service.",
- tags: new[] { "commit", "database", "geodatabase", "transact", "transactions" })]
- public class GeodatabaseTransactions : Activity
- {
- // URL for the editable feature service
- private const string SyncServiceUrl = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Sync/SaveTheBaySync/FeatureServer/";
-
- // Map view
- private MapView _mapView;
-
- // Work in a small extent south of Galveston, TX
- private Envelope _extent = new Envelope(-95.3035, 29.0100, -95.1053, 29.1298, SpatialReferences.Wgs84);
-
- // Store the local geodatabase to edit
- private Geodatabase _localGeodatabase;
-
- // Store references to two tables to edit: Birds and Marine points
- private GeodatabaseFeatureTable _birdTable;
- private GeodatabaseFeatureTable _marineTable;
-
- // Switch to control whether or not transactions are required for edits
- private Switch _requireTransactionSwitch;
-
- // Buttons to start/stop an edit transaction
- private Button _startEditingButton;
- private Button _stopEditingButton;
-
- // Buttons to add bird or marine features
- private Button _addBirdButton;
- private Button _addMarineButton;
-
- // Button to synchronize local edits with the service
- private Button _syncEditsButton;
-
- // Text view to show status messages
- private TextView _messageTextBlock;
-
- // Progress bar
- private ProgressBar _progressBar;
-
- // Dialog for choosing how to end the transaction (commit, rollback, cancel)
- private AlertDialog _stopEditDialog;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- Title = "Geodatabase transactions";
-
- // Create the UI
- CreateLayout();
-
- // Initialize the map and load local data (generate a local geodatabase if necessary)
- Initialize();
- }
-
- private void CreateLayout()
- {
- // Layout params for making buttons fill page width
- LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.MatchParent,
- ViewGroup.LayoutParams.MatchParent,
- 1.0f
- );
-
- // Button to start an edit transaction
- _startEditingButton = new Button(this)
- {
- Text = "Start",
- LayoutParameters = param
- };
- _startEditingButton.Click += BeginTransaction;
-
- // Button to stop a transaction
- _stopEditingButton = new Button(this)
- {
- Text = "Stop",
- Enabled = false,
- LayoutParameters = param
- };
- _stopEditingButton.Click += StopEditTransaction;
-
- // Button to synchronize local edits with the service
- _syncEditsButton = new Button(this)
- {
- Text = "Sync",
- Enabled = false,
- LayoutParameters = param
- };
- _syncEditsButton.Click += SynchronizeEdits;
-
- // Button to add bird features
- _addBirdButton = new Button(this)
- {
- Text = "Add Bird",
- Enabled = false,
- LayoutParameters = param
- };
- _addBirdButton.Click += AddNewFeature;
-
- // Button to add marine features
- _addMarineButton = new Button(this)
- {
- Text = "Add Marine",
- Enabled = false,
- LayoutParameters = param
- };
- _addMarineButton.Click += AddNewFeature;
-
- // Layout to hold the first row of buttons (start, stop, sync)
- LinearLayout editButtonsRow1 = new LinearLayout(this)
- {
- Orientation = Orientation.Horizontal
- };
- editButtonsRow1.AddView(_startEditingButton);
- editButtonsRow1.AddView(_stopEditingButton);
- editButtonsRow1.AddView(_syncEditsButton);
-
- // Layout to hold the second row of buttons (add bird, add marine)
- LinearLayout editButtonsRow2 = new LinearLayout(this)
- {
- Orientation = Orientation.Horizontal
- };
- editButtonsRow2.AddView(_addBirdButton);
- editButtonsRow2.AddView(_addMarineButton);
-
- // Layout for the 'require transaction' switch
- LinearLayout editSwitchRow = new LinearLayout(this)
- {
- Orientation = Orientation.Horizontal
- };
- _requireTransactionSwitch = new Switch(this)
- {
- Checked = true,
- Text = "Require transaction"
- };
- _requireTransactionSwitch.CheckedChange += RequireTransactionChanged;
- editSwitchRow.AddView(_requireTransactionSwitch);
-
- // Progress bar
- _progressBar = new ProgressBar(this)
- {
- Visibility = Android.Views.ViewStates.Gone
- };
-
- // Use the rest of the view to show status messages
- _messageTextBlock = new TextView(this);
-
- // Create the main layout
- LinearLayout layout = new LinearLayout(this)
- {
- Orientation = Orientation.Vertical
- };
-
- // Add the first row of buttons
- layout.AddView(editButtonsRow1);
-
- // Add the second row of buttons
- layout.AddView(editButtonsRow2);
-
- // Add the 'require transaction' switch and label
- layout.AddView(editSwitchRow);
-
- // Add the messages text view
- layout.AddView(_messageTextBlock);
-
- // Add the progress bar
- layout.AddView(_progressBar);
-
- // Add the map view
- _mapView = new MapView(this);
- layout.AddView(_mapView);
-
- // Add the layout to the view
- SetContentView(layout);
- }
-
- private void Initialize()
- {
- // When the spatial reference changes (the map loads) add the local geodatabase tables as feature layers
- _mapView.SpatialReferenceChanged += async (s, e) =>
- {
- // Call a function (and await it) to get the local geodatabase (or generate it from the feature service)
- await GetLocalGeodatabase();
-
- // Once the local geodatabase is available, load the tables as layers to the map
- LoadLocalGeodatabaseTables();
- };
-
- // Create a new map with the oceans basemap and add it to the map view
- _mapView.Map = new Map(BasemapStyle.ArcGISOceans);
- }
-
- private async Task GetLocalGeodatabase()
- {
- // Get the path to the local geodatabase for this platform (temp directory, for example)
- string localGeodatabasePath = GetGdbPath();
-
- try
- {
- // See if the geodatabase file is already present
- if (File.Exists(localGeodatabasePath))
- {
- // If the geodatabase is already available, open it, hide the progress control, and update the message
- _localGeodatabase = await Geodatabase.OpenAsync(localGeodatabasePath);
- _progressBar.Visibility = Android.Views.ViewStates.Gone;
- _messageTextBlock.Text = "Using local geodatabase from '" + _localGeodatabase.Path + "'";
- }
- else
- {
- // Create a new GeodatabaseSyncTask with the uri of the feature server to pull from
- GeodatabaseSyncTask gdbTask = await GeodatabaseSyncTask.CreateAsync(new Uri(SyncServiceUrl));
-
- // Create parameters for the task: layers and extent to include, out spatial reference, and sync model
- GenerateGeodatabaseParameters gdbParams = await gdbTask.CreateDefaultGenerateGeodatabaseParametersAsync(_extent);
- gdbParams.OutSpatialReference = _mapView.SpatialReference;
- gdbParams.SyncModel = SyncModel.Layer;
- gdbParams.LayerOptions.Clear();
- gdbParams.LayerOptions.Add(new GenerateLayerOption(0));
- gdbParams.LayerOptions.Add(new GenerateLayerOption(1));
-
- // Create a geodatabase job that generates the geodatabase
- GenerateGeodatabaseJob generateGdbJob = gdbTask.GenerateGeodatabase(gdbParams, localGeodatabasePath);
-
- // Handle the job changed event and check the status of the job; store the geodatabase when it's ready
- generateGdbJob.StatusChanged += (s, e) =>
- {
- // Call a function to update the progress bar
- RunOnUiThread(() => UpdateProgressBar(generateGdbJob.Progress));
-
- // See if the job succeeded
- if (generateGdbJob.Status == JobStatus.Succeeded)
- {
- RunOnUiThread(() =>
- {
- // Hide the progress control and update the message
- _progressBar.Visibility = Android.Views.ViewStates.Gone;
- _messageTextBlock.Text = "Created local geodatabase";
- });
- }
- else if (generateGdbJob.Status == JobStatus.Failed)
- {
- RunOnUiThread(() =>
- {
- // Hide the progress control and report the exception
- _progressBar.Visibility = Android.Views.ViewStates.Gone;
- _messageTextBlock.Text = "Unable to create local geodatabase: " + generateGdbJob.Error.Message;
- });
- }
- };
-
- // Start the generate geodatabase job
- _localGeodatabase = await generateGdbJob.GetResultAsync();
- }
- }
- catch (Exception ex)
- {
- // Show a message for the exception encountered
- RunOnUiThread(() =>
- {
- ShowStatusMessage("Generate Geodatabase", "Unable to create offline database: " + ex.Message);
- });
- }
- }
-
- // Function that loads the two point tables from the local geodatabase and displays them as feature layers
- private async void LoadLocalGeodatabaseTables()
- {
- if (_localGeodatabase == null) { return; }
-
- // Read the geodatabase tables and add them as layers
- foreach (GeodatabaseFeatureTable table in _localGeodatabase.GeodatabaseFeatureTables)
- {
- try
- {
- // Load the table so the TableName can be read
- await table.LoadAsync();
-
- // Store a reference to the Birds table
- if (table.TableName.ToLower().Contains("birds"))
- {
- _birdTable = table;
- }
-
- // Store a reference to the Marine table
- if (table.TableName.ToLower().Contains("marine"))
- {
- _marineTable = table;
- }
-
- // Create a new feature layer to show the table in the map
- FeatureLayer layer = new FeatureLayer(table);
- RunOnUiThread(() => _mapView.Map.OperationalLayers.Add(layer));
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- // Handle the transaction status changed event
- _localGeodatabase.TransactionStatusChanged += GdbTransactionStatusChanged;
-
- // Zoom the map view to the extent of the generated local datasets
- RunOnUiThread(() =>
- {
- _mapView.SetViewpoint(new Viewpoint(_marineTable.Extent));
- _startEditingButton.Enabled = true;
- });
- }
-
- private void GdbTransactionStatusChanged(object sender, TransactionStatusChangedEventArgs e)
- {
- // Update UI controls based on whether the geodatabase has a current transaction
- RunOnUiThread(() =>
- {
- // These buttons should be enabled when there IS a transaction
- _addBirdButton.Enabled = e.IsInTransaction;
- _addMarineButton.Enabled = e.IsInTransaction;
- _stopEditingButton.Enabled = e.IsInTransaction;
-
- // These buttons should be enabled when there is NOT a transaction
- _startEditingButton.Enabled = !e.IsInTransaction;
- _syncEditsButton.Enabled = !e.IsInTransaction;
- });
- }
-
- private void BeginTransaction(object sender, EventArgs e)
- {
- // See if there is a transaction active for the geodatabase
- if (_localGeodatabase!= null && !_localGeodatabase.IsInTransaction)
- {
- // If not, begin a transaction
- _localGeodatabase.BeginTransaction();
- _messageTextBlock.Text = "Transaction started";
- }
- else
- {
- _messageTextBlock.Text = "Not yet ready for new transaction.";
- }
- }
-
- private async void AddNewFeature(object sender, EventArgs args)
- {
- // See if it was the "Birds" or "Marine" button that was clicked
- Button addFeatureButton = (Button)sender;
-
- try
- {
- // Cancel execution of the sketch task if it is already active
- if (_mapView.SketchEditor.CancelCommand.CanExecute(null))
- {
- _mapView.SketchEditor.CancelCommand.Execute(null);
- }
-
- // Store the correct table to edit (for the button clicked)
- GeodatabaseFeatureTable editTable = null;
- if (addFeatureButton == _addBirdButton)
- {
- editTable = _birdTable;
- }
- else
- {
- editTable = _marineTable;
- }
-
- // Inform the user which table is being edited
- _messageTextBlock.Text = "Click the map to add a new feature to the geodatabase table '" + editTable.TableName + "'";
-
- // Create a random value for the 'type' attribute (integer between 1 and 7)
- Random random = new Random(DateTime.Now.Millisecond);
- int featureType = random.Next(1, 7);
-
- // Use the sketch editor to allow the user to draw a point on the map
- MapPoint clickPoint = await _mapView.SketchEditor.StartAsync(SketchCreationMode.Point, false) as MapPoint;
-
- // Create a new feature (row) in the selected table
- Feature newFeature = editTable.CreateFeature();
-
- // Set the geometry with the point the user clicked and the 'type' with the random integer
- newFeature.Geometry = clickPoint;
- newFeature.SetAttributeValue("type", featureType);
-
- // Add the new feature to the table
- await editTable.AddFeatureAsync(newFeature);
-
- // Clear the message
- _messageTextBlock.Text = "New feature added to the '" + editTable.TableName + "' table";
- }
- catch (TaskCanceledException)
- {
- // Ignore if the edit was canceled
- }
- catch (Exception ex)
- {
- // Report other exception messages
- _messageTextBlock.Text = ex.Message;
- }
- }
-
- private void StopEditTransaction(object sender, EventArgs e)
- {
- // Create a dialog to prompt the user to commit or rollback
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
-
- // Create the layout
- LinearLayout dialogLayout = new LinearLayout(this)
- {
- Orientation = Orientation.Vertical
- };
-
- // Create a button to commit edits
- Button commitButton = new Button(this)
- {
- Text = "Commit"
- };
-
- // Handle the click event for the Commit button
- commitButton.Click += (s, args) =>
- {
- // See if there is a transaction active for the geodatabase
- if (_localGeodatabase.IsInTransaction)
- {
- // If there is, commit the transaction to store the edits (this will also end the transaction)
- _localGeodatabase.CommitTransaction();
- _messageTextBlock.Text = "Edits were committed to the local geodatabase.";
- }
-
- _stopEditDialog.Dismiss();
- };
-
- // Create a button to rollback edits
- Button rollbackButton = new Button(this)
- {
- Text = "Rollback"
- };
-
- // Handle the click event for the Rollback button
- rollbackButton.Click += (s, args) =>
- {
- // See if there is a transaction active for the geodatabase
- if (_localGeodatabase.IsInTransaction)
- {
- // If there is, rollback the transaction to discard the edits (this will also end the transaction)
- _localGeodatabase.RollbackTransaction();
- _messageTextBlock.Text = "Edits were rolled back and not stored to the local geodatabase.";
- }
-
- _stopEditDialog.Dismiss();
- };
-
- // Create a button to cancel and return to the transaction
- Button cancelButton = new Button(this)
- {
- Text = "Cancel"
- };
-
- // Handle the click event for the Cancel button
- rollbackButton.Click += (s, args) => _stopEditDialog.Dismiss();
-
- // Add the controls to the dialog
- dialogLayout.AddView(cancelButton);
- dialogLayout.AddView(rollbackButton);
- dialogLayout.AddView(commitButton);
- dialogBuilder.SetView(dialogLayout);
- dialogBuilder.SetTitle("Stop Editing");
-
- // Show the dialog
- _stopEditDialog = dialogBuilder.Show();
- }
-
- // Change which controls are enabled if the user chooses to require/not require transactions for edits
- private void RequireTransactionChanged(object sender, EventArgs e)
- {
- // If the local geodatabase isn't created yet, return
- if (_localGeodatabase == null) { return; }
-
- // Get the value of the "require transactions" switch
- bool mustHaveTransaction = _requireTransactionSwitch.Checked;
-
- // Warn the user if disabling transactions while a transaction is active
- if (!mustHaveTransaction && _localGeodatabase.IsInTransaction)
- {
- ShowStatusMessage("Stop editing to end the current transaction.", "Current Transaction");
- _requireTransactionSwitch.Checked = true;
- return;
- }
-
- // Enable or disable controls according to the switch value
- _startEditingButton.Enabled = mustHaveTransaction;
- _stopEditingButton.Enabled = mustHaveTransaction && _localGeodatabase.IsInTransaction;
- _addBirdButton.Enabled = !mustHaveTransaction;
- _addMarineButton.Enabled = !mustHaveTransaction;
- }
-
- // Synchronize edits in the local geodatabase with the service
- public async void SynchronizeEdits(object sender, EventArgs e)
- {
- // Show the progress bar while the sync is working
- _progressBar.Visibility = Android.Views.ViewStates.Visible;
-
- try
- {
- // Create a sync task with the URL of the feature service to sync
- GeodatabaseSyncTask syncTask = await GeodatabaseSyncTask.CreateAsync(new Uri(SyncServiceUrl));
-
- // Create sync parameters
- SyncGeodatabaseParameters taskParameters = await syncTask.CreateDefaultSyncGeodatabaseParametersAsync(_localGeodatabase);
-
- // Create a synchronize geodatabase job, pass in the parameters and the geodatabase
- SyncGeodatabaseJob job = syncTask.SyncGeodatabase(taskParameters, _localGeodatabase);
-
- // Handle the JobChanged event for the job
- job.StatusChanged += (s, arg) =>
- {
- RunOnUiThread(() =>
- {
- // Update the progress bar
- UpdateProgressBar(job.Progress);
-
- // Report changes in the job status
- if (job.Status == JobStatus.Succeeded)
- {
- _messageTextBlock.Text = "Synchronization is complete!";
- _progressBar.Visibility = Android.Views.ViewStates.Gone;
- }
- else if (job.Status == JobStatus.Failed)
- {
- // Report failure ...
- _messageTextBlock.Text = job.Error.Message;
- _progressBar.Visibility = Android.Views.ViewStates.Gone;
- }
- else
- {
- // Report that the job is in progress ...
- _messageTextBlock.Text = "Sync in progress ...";
- }
-
- });
- };
-
- // Await the completion of the job
- await job.GetResultAsync();
- }
- catch (Exception ex)
- {
- // Show the message if an exception occurred
- _messageTextBlock.Text = "Error when synchronizing: " + ex.Message;
- }
- }
-
- private string GetGdbPath()
- {
- return GetFileStreamPath("wildfire.geodatabase").AbsolutePath;
- }
-
- private void ShowStatusMessage(string title, string message)
- {
- // Display the message to the user
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.SetMessage(message).SetTitle(title).Show();
- }
-
- private void UpdateProgressBar(int progress)
- {
- // Due to the nature of the threading implementation,
- // the dispatcher needs to be used to interact with the UI
- RunOnUiThread(() =>
- {
- // Update the progress bar value
- _progressBar.Progress = progress;
- });
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/GeodatabaseTransactions/GeodatabaseTransactions.jpg b/src/Android/Xamarin.Android/Samples/Data/GeodatabaseTransactions/GeodatabaseTransactions.jpg
deleted file mode 100644
index bafee9245f..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/GeodatabaseTransactions/GeodatabaseTransactions.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/GeodatabaseTransactions/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/GeodatabaseTransactions/readme.metadata.json
deleted file mode 100644
index ea5c14d34d..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/GeodatabaseTransactions/readme.metadata.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "category": "Data",
- "description": "Use transactions to manage how changes are committed to a geodatabase.",
- "formal_name": "GeodatabaseTransactions",
- "ignore": false,
- "images": [
- "GeodatabaseTransactions.jpg"
- ],
- "keywords": [
- "commit",
- "database",
- "geodatabase",
- "transact",
- "transactions"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/geodatabasetransactions.htm"
- ],
- "relevant_apis": [
- "Geodatabase",
- "Geodatabase.BeginTransaction",
- "Geodatabase.CommitTransaction",
- "Geodatabase.IsInTransaction",
- "Geodatabase.RollbackTransaction"
- ],
- "snippets": [
- "GeodatabaseTransactions.cs"
- ],
- "title": "Geodatabase transactions"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/ListRelatedFeatures/ListRelatedFeatures.cs b/src/Android/Xamarin.Android/Samples/Data/ListRelatedFeatures/ListRelatedFeatures.cs
deleted file mode 100644
index 92947ea46f..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/ListRelatedFeatures/ListRelatedFeatures.cs
+++ /dev/null
@@ -1,184 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Portal;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Linq;
-
-namespace ArcGISRuntime.Samples.ListRelatedFeatures
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "List related features",
- category: "Data",
- description: "List features related to the selected feature.",
- instructions: "Tap on a feature to select it. The related features will be displayed in a list.",
- tags: new[] { "features", "identify", "query", "related", "relationship", "search" })]
- public class ListRelatedFeatures : Activity
- {
- // URL to the web map
- private readonly Uri _mapUri =
- new Uri("https://arcgisruntime.maps.arcgis.com/home/item.html?id=dcc7466a91294c0ab8f7a094430ab437");
-
- // Reference to the feature layer
- private FeatureLayer _myFeatureLayer;
-
- // Hold a reference to the map view
- private MapView _myMapView;
-
- // Hold a reference to the ListView
- private ListView _myDisplayList;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "List related features";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private async void Initialize()
- {
- try
- {
- // Create the portal item from the URL to the webmap
- PortalItem alaskaPortalItem = await PortalItem.CreateAsync(_mapUri);
-
- // Create the map from the portal item
- Map myMap = new Map(alaskaPortalItem);
-
- // Add the map to the mapview
- _myMapView.Map = myMap;
-
- // Wait for the map to load
- await myMap.LoadAsync();
-
- // Get the feature layer from the map
- _myFeatureLayer = (FeatureLayer)myMap.OperationalLayers.First();
-
- // Update the selection color
- _myMapView.SelectionProperties.Color = Color.Yellow;
-
- // Listen for GeoViewTapped events
- _myMapView.GeoViewTapped += MyMapViewOnGeoViewTapped;
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private async void MyMapViewOnGeoViewTapped(object sender, GeoViewInputEventArgs e)
- {
- // Clear any existing feature selection and results list
- _myFeatureLayer.ClearSelection();
- _myDisplayList.Adapter = null;
-
- try
- {
- // Identify the tapped feature
- IdentifyLayerResult results = await _myMapView.IdentifyLayerAsync(_myFeatureLayer, e.Position, 10, false);
-
- // Return if there are no results
- if (results.GeoElements.Count < 1) { return; }
-
- // Get the first result
- ArcGISFeature myFeature = (ArcGISFeature)results.GeoElements.First();
-
- // Select the feature
- _myFeatureLayer.SelectFeature(myFeature);
-
- // Get the feature table for the feature
- ArcGISFeatureTable myFeatureTable = (ArcGISFeatureTable)myFeature.FeatureTable;
-
- // Query related features
- IReadOnlyList relatedFeaturesResult = await myFeatureTable.QueryRelatedFeaturesAsync(myFeature);
-
- // Create a list to hold the formatted results of the query
- List queryResultsForUi = new List();
-
- // For each query result
- foreach (RelatedFeatureQueryResult result in relatedFeaturesResult)
- {
- // And then for each feature in the result
- foreach (Feature resultFeature in result)
- {
- // Get a reference to the feature's table
- ArcGISFeatureTable relatedTable = (ArcGISFeatureTable)resultFeature.FeatureTable;
-
- // Get the display field name - this is the name of the field that is intended for display
- string displayFieldName = relatedTable.LayerInfo.DisplayFieldName;
-
- // Get the name of the feature's table
- string tableName = relatedTable.TableName;
-
- // Get the display name for the feature
- string featureDisplayname = resultFeature.Attributes[displayFieldName].ToString();
-
- // Create a formatted result string
- string formattedResult = $"{tableName} - {featureDisplayname}";
-
- // Add the result to the list
- queryResultsForUi.Add(formattedResult);
- }
- }
-
- // Create an array adapter for the layer display
- ArrayAdapter adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, queryResultsForUi);
-
- // Apply the adapter to show the results in the UI
- _myDisplayList.Adapter = adapter;
- }
- catch (Exception ex)
- {
- new AlertDialog.Builder(this).SetMessage(ex.ToString()).SetTitle("Error").Show();
- }
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create the listview for displaying results
- _myDisplayList = new ListView(this);
-
- // Create a scrollviewer for the listview
- ScrollView myScrollView = new ScrollView(this);
-
- // Set the height so that it always appears on screen
- myScrollView.SetMinimumHeight(Resources.DisplayMetrics.HeightPixels / 3);
- myScrollView.FillViewport = true;
-
- // Add the listview to the scroll view
- myScrollView.AddView(_myDisplayList);
-
- // Add the scroll view to the layout
- layout.AddView(myScrollView);
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/ListRelatedFeatures/ListRelatedFeatures.jpg b/src/Android/Xamarin.Android/Samples/Data/ListRelatedFeatures/ListRelatedFeatures.jpg
deleted file mode 100644
index 8f3bb8446b..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/ListRelatedFeatures/ListRelatedFeatures.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/ListRelatedFeatures/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/ListRelatedFeatures/readme.metadata.json
deleted file mode 100644
index 19baa769c3..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/ListRelatedFeatures/readme.metadata.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "category": "Data",
- "description": "List features related to the selected feature.",
- "formal_name": "ListRelatedFeatures",
- "ignore": false,
- "images": [
- "ListRelatedFeatures.jpg"
- ],
- "keywords": [
- "features",
- "identify",
- "query",
- "related",
- "relationship",
- "search"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/listrelatedfeatures.htm"
- ],
- "relevant_apis": [
- "ArcGISFeature",
- "ArcGISFeatureTable",
- "FeatureQueryResult",
- "FeatureTable.QueryRelatedFeatures",
- "RelatedFeatureQueryResult"
- ],
- "snippets": [
- "ListRelatedFeatures.cs"
- ],
- "title": "List related features"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/RasterLayerGeoPackage/RasterLayerGeoPackage.cs b/src/Android/Xamarin.Android/Samples/Data/RasterLayerGeoPackage/RasterLayerGeoPackage.cs
deleted file mode 100644
index cc908f9f47..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/RasterLayerGeoPackage/RasterLayerGeoPackage.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright 2017 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using System;
-using System.Linq;
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using ArcGISRuntime.Samples.Managers;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Rasters;
-
-namespace ArcGISRuntime.Samples.RasterLayerGeoPackage
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("68ec42517cdd439e81b036210483e8e7")]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Raster layer (GeoPackage)",
- category: "Data",
- description: "Display a raster contained in a GeoPackage.",
- instructions: "When the sample starts, a raster will be loaded from a GeoPackage and displayed in the map view.",
- tags: new[] { "OGC", "container", "data", "image", "import", "layer", "package", "raster", "visualization" })]
- public class RasterLayerGeoPackage : Activity
- {
- private MapView _myMapView;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Raster layer (GeoPackage)";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private async void Initialize()
- {
- // Create a new map
- _myMapView.Map = new Map(BasemapStyle.ArcGISLightGray);
-
- // Get the full path
- string geoPackagePath = GetGeoPackagePath();
-
- try
- {
- // Open the GeoPackage
- GeoPackage myGeoPackage = await GeoPackage.OpenAsync(geoPackagePath);
-
- // Read the raster images and get the first one
- Raster gpkgRaster = myGeoPackage.GeoPackageRasters.FirstOrDefault();
-
- // Make sure an image was found in the package
- if (gpkgRaster == null) { return; }
-
- // Create a layer to show the raster
- RasterLayer newLayer = new RasterLayer(gpkgRaster);
- await newLayer.LoadAsync();
-
- // Set the viewpoint
- await _myMapView.SetViewpointAsync(new Viewpoint(newLayer.FullExtent));
-
- // Add the image as a raster layer to the map (with default symbology)
- _myMapView.Map.OperationalLayers.Add(newLayer);
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private static string GetGeoPackagePath()
- {
- return DataManager.GetDataFolder("68ec42517cdd439e81b036210483e8e7", "AuroraCO.gpkg");
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add a map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/RasterLayerGeoPackage/RasterLayerGeoPackage.jpg b/src/Android/Xamarin.Android/Samples/Data/RasterLayerGeoPackage/RasterLayerGeoPackage.jpg
deleted file mode 100644
index cce6bcc87b..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/RasterLayerGeoPackage/RasterLayerGeoPackage.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/RasterLayerGeoPackage/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/RasterLayerGeoPackage/readme.metadata.json
deleted file mode 100644
index b814fa9059..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/RasterLayerGeoPackage/readme.metadata.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "category": "Data",
- "description": "Display a raster contained in a GeoPackage.",
- "formal_name": "RasterLayerGeoPackage",
- "ignore": false,
- "images": [
- "RasterLayerGeoPackage.jpg"
- ],
- "keywords": [
- "OGC",
- "container",
- "data",
- "image",
- "import",
- "layer",
- "package",
- "raster",
- "visualization"
- ],
- "offline_data": [
- "68ec42517cdd439e81b036210483e8e7"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/rasterlayergeopackage.htm"
- ],
- "relevant_apis": [
- "GeoPackage",
- "GeoPackageRaster",
- "RasterLayer"
- ],
- "snippets": [
- "RasterLayerGeoPackage.cs"
- ],
- "title": "Raster layer (GeoPackage)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/ReadGeoPackage/ReadGeoPackage.cs b/src/Android/Xamarin.Android/Samples/Data/ReadGeoPackage/ReadGeoPackage.cs
deleted file mode 100644
index 7454a3dacf..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/ReadGeoPackage/ReadGeoPackage.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using ArcGISRuntime.Samples.Managers;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Rasters;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-
-namespace ArcGISRuntime.Samples.ReadGeoPackage
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Read GeoPackage",
- category: "Data",
- description: "Add rasters and feature tables from a GeoPackage to a map.",
- instructions: "When the sample loads, the feature tables and rasters from the GeoPackage will be shown on the map.",
- tags: new[] { "GeoPackage", "OGC", "container", "layer", "map", "package", "raster", "table" })]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("68ec42517cdd439e81b036210483e8e7")]
- public class ReadGeoPackage : Activity
- {
- // Member MapView UI control used in the sample.
- private MapView _myMapView;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Read a GeoPackage";
- CreateLayout();
- Initialize();
- }
-
- private async void Initialize()
- {
- // Create a new map centered on Aurora Colorado.
- _myMapView.Map = new Map(BasemapStyle.ArcGISStreets);
- _myMapView.Map.InitialViewpoint = new Viewpoint(39.7294, -104.70, 175000);
-
- // Get the full path to the GeoPackage on the device.
- string myGeoPackagePath = GetGeoPackagePath();
-
- try
- {
- // Open the GeoPackage.
- GeoPackage myGeoPackage = await GeoPackage.OpenAsync(myGeoPackagePath);
-
- // Get the read only list of GeoPackageRasters from the GeoPackage.
- IReadOnlyList myReadOnlyListOfGeoPackageRasters = myGeoPackage.GeoPackageRasters;
-
- // Loop through each GeoPackageRaster.
- foreach (GeoPackageRaster oneGeoPackageRaster in myReadOnlyListOfGeoPackageRasters)
- {
- // Create a RasterLayer from the GeoPackageRaster.
- RasterLayer myRasterLayer = new RasterLayer(oneGeoPackageRaster)
- {
- // Set the opacity on the RasterLayer to partially visible.
- Opacity = 0.55
- };
-
- // Add the layer to the map.
- _myMapView.Map.OperationalLayers.Add(myRasterLayer);
- }
-
- // Get the read only list of GeoPackageFeatureTabless from the GeoPackage.
- IReadOnlyList myReadOnlyListOfGeoPackageFeatureTables = myGeoPackage.GeoPackageFeatureTables;
-
- // Loop through each GeoPackageFeatureTable.
- foreach (GeoPackageFeatureTable oneGeoPackageFeatureTable in myReadOnlyListOfGeoPackageFeatureTables)
- {
- // Create a FeatureLayer from the GeoPackageFeatureLayer.
- FeatureLayer myFeatureLayer = new FeatureLayer(oneGeoPackageFeatureTable);
-
- // Add the layer to the map.
- _myMapView.Map.OperationalLayers.Add(myFeatureLayer);
- }
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- LinearLayout layout = new LinearLayout(this) {Orientation = Orientation.Vertical};
-
- // Add a map view to the layout.
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
-
- private static string GetGeoPackagePath() => DataManager.GetDataFolder("68ec42517cdd439e81b036210483e8e7", "AuroraCO.gpkg");
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/ReadGeoPackage/ReadGeoPackage.jpg b/src/Android/Xamarin.Android/Samples/Data/ReadGeoPackage/ReadGeoPackage.jpg
deleted file mode 100644
index 175d34a802..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/ReadGeoPackage/ReadGeoPackage.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/ReadGeoPackage/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/ReadGeoPackage/readme.metadata.json
deleted file mode 100644
index 96563d64b6..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/ReadGeoPackage/readme.metadata.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "category": "Data",
- "description": "Add rasters and feature tables from a GeoPackage to a map.",
- "formal_name": "ReadGeoPackage",
- "ignore": false,
- "images": [
- "ReadGeoPackage.jpg"
- ],
- "keywords": [
- "GeoPackage",
- "OGC",
- "container",
- "layer",
- "map",
- "package",
- "raster",
- "table"
- ],
- "offline_data": [
- "68ec42517cdd439e81b036210483e8e7"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/readgeopackage.htm"
- ],
- "relevant_apis": [
- "GeoPackage",
- "GeoPackage.GeoPackageFeatureTables",
- "GeoPackage.GeoPackageRasters",
- "GeoPackageFeatureTable",
- "GeoPackageRaster"
- ],
- "snippets": [
- "ReadGeoPackage.cs"
- ],
- "title": "Read GeoPackage"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/ReadShapefileMetadata/ReadShapefileMetadata.cs b/src/Android/Xamarin.Android/Samples/Data/ReadShapefileMetadata/ReadShapefileMetadata.cs
deleted file mode 100644
index 62202353d2..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/ReadShapefileMetadata/ReadShapefileMetadata.cs
+++ /dev/null
@@ -1,206 +0,0 @@
-// Copyright 2017 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.Graphics;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using ArcGISRuntime.Samples.Managers;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using ContextThemeWrapper = AndroidX.AppCompat.View.ContextThemeWrapper;
-
-namespace ArcGISRuntime.Samples.ReadShapefileMetadata
-{
- [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("d98b3e5293834c5f852f13c569930caa")]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Read shapefile metadata",
- category: "Data",
- description: "Read a shapefile and display its metadata.",
- instructions: "The shapefile's metadata will be displayed when you open the sample.",
- tags: new[] { "credits", "description", "metadata", "package", "shape file", "shapefile", "summary", "symbology", "tags", "visualization" })]
- public class ReadShapefileMetadata : Activity
- {
- // Store the app's map view
- private MapView _myMapView;
-
- // Store the object that holds the shapefile metadata
- private ShapefileInfo _shapefileMetadata;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Read shapefile metadata";
- CreateLayout();
-
- // Download (if necessary) and add a local shapefile dataset to the map
- Initialize();
- }
-
- private async void Initialize()
- {
- // Create a new map to display in the map view with a streets basemap
- Map streetMap = new Map(BasemapStyle.ArcGISStreets);
-
- // Get the path to the downloaded shapefile
- string filepath = GetShapefilePath();
-
- try
- {
- // Open the shapefile
- ShapefileFeatureTable myShapefile = await ShapefileFeatureTable.OpenAsync(filepath);
-
- // Read metadata about the shapefile and display it in the UI
- _shapefileMetadata = myShapefile.Info;
-
- // Create a feature layer to display the shapefile
- FeatureLayer newFeatureLayer = new FeatureLayer(myShapefile);
- await newFeatureLayer.LoadAsync();
-
- // Zoom the map to the extent of the shapefile
- _myMapView.SpatialReferenceChanged += async (s, e) =>
- {
- await _myMapView.SetViewpointGeometryAsync(newFeatureLayer.FullExtent);
- };
-
- // Add the feature layer to the map
- streetMap.OperationalLayers.Add(newFeatureLayer);
-
- // Show the map in the MapView
- _myMapView.Map = streetMap;
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private static string GetShapefilePath()
- {
- return DataManager.GetDataFolder("d98b3e5293834c5f852f13c569930caa", "TrailBikeNetwork.shp");
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add a button to show the metadata
- Button showMetadataButton = new Button(this)
- {
- Text = "Show Metadata"
- };
- showMetadataButton.Click += ShowMetadataDialog;
- layout.AddView(showMetadataButton);
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
-
- private void ShowMetadataDialog(object sender, System.EventArgs e)
- {
- MetadataDialogFragment metadataDialog = new MetadataDialogFragment(_shapefileMetadata);
-
- // Begin a transaction to show a UI fragment (the metadata dialog)
- FragmentTransaction trans = FragmentManager.BeginTransaction();
- metadataDialog.Show(trans, "metadata");
- }
- }
-
- // A custom DialogFragment class to show shapefile metadata
- public class MetadataDialogFragment : DialogFragment
- {
- private ShapefileInfo _metadata;
- private ImageView _thumbnailImageView;
-
- public MetadataDialogFragment(ShapefileInfo metadata)
- {
- _metadata = metadata;
- }
-
- public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
- {
- base.OnCreateView(inflater, container, savedInstanceState);
-
- // Dialog to display
- LinearLayout dialogView = null;
-
- // Get the context for creating the dialog controls
- Android.Content.Context ctx = Activity.ApplicationContext;
- AndroidX.AppCompat.View.ContextThemeWrapper ctxWrapper = new ContextThemeWrapper(ctx, Android.Resource.Style.ThemeMaterialLight);
-
- // Set a dialog title
- Dialog.SetTitle(_metadata.Credits);
-
- // The container for the dialog is a vertical linear layout
- dialogView = new LinearLayout(ctxWrapper)
- {
- Orientation = Orientation.Vertical
- };
- dialogView.SetPadding(20, 20, 20, 20);
-
- // Add a text box for showing metadata summary
- TextView summaryTextView = new TextView(ctxWrapper)
- {
- Text = _metadata.Summary
- };
- dialogView.AddView(summaryTextView);
-
- // Add an image to show the thumbnail
- _thumbnailImageView = new ImageView(ctxWrapper);
- _thumbnailImageView.SetMinimumHeight(200);
- _thumbnailImageView.SetMinimumWidth(200);
- dialogView.AddView(_thumbnailImageView);
-
- // Call a function to load the thumbnail image from the metadata
- LoadThumbnail();
-
- // Add a text box for showing metadata tags
- TextView tagsTextView = new TextView(ctxWrapper)
- {
- Text = string.Join(",", _metadata.Tags)
- };
- dialogView.AddView(tagsTextView);
-
- // Add a button to close the dialog
- Button dismissButton = new Button(ctxWrapper)
- {
- Text = "OK"
- };
- dismissButton.Click += (s, e) => Dismiss();
- dialogView.AddView(dismissButton);
-
- // Return the new view for display
- return dialogView;
- }
-
- private async void LoadThumbnail()
- {
- try
- {
- Bitmap img = await _metadata.Thumbnail.ToImageSourceAsync();
- _thumbnailImageView.SetImageBitmap(img);
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(Context).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/ReadShapefileMetadata/ReadShapefileMetadata.jpg b/src/Android/Xamarin.Android/Samples/Data/ReadShapefileMetadata/ReadShapefileMetadata.jpg
deleted file mode 100644
index d2051df9b0..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/ReadShapefileMetadata/ReadShapefileMetadata.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/ReadShapefileMetadata/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/ReadShapefileMetadata/readme.metadata.json
deleted file mode 100644
index 9fd115423e..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/ReadShapefileMetadata/readme.metadata.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "category": "Data",
- "description": "Read a shapefile and display its metadata.",
- "formal_name": "ReadShapefileMetadata",
- "ignore": false,
- "images": [
- "ReadShapefileMetadata.jpg"
- ],
- "keywords": [
- "credits",
- "description",
- "metadata",
- "package",
- "shape file",
- "shapefile",
- "summary",
- "symbology",
- "tags",
- "visualization"
- ],
- "offline_data": [
- "d98b3e5293834c5f852f13c569930caa"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/readshapefilemetadata.htm"
- ],
- "relevant_apis": [
- "ShapefileFeatureTable",
- "ShapefileFeatureTable.Info",
- "ShapefileFeatureTable.OpenAsync",
- "ShapefileInfo",
- "ShapefileInfo.Credits",
- "ShapefileInfo.Summary",
- "ShapefileInfo.Tags",
- "ShapefileInfo.Thumbnail"
- ],
- "snippets": [
- "ReadShapefileMetadata.cs"
- ],
- "title": "Read shapefile metadata"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableCache/ServiceFeatureTableCache.cs b/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableCache/ServiceFeatureTableCache.cs
deleted file mode 100644
index 32a42e235e..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableCache/ServiceFeatureTableCache.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2016 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-
-namespace ArcGISRuntime.Samples.ServiceFeatureTableCache
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Service feature table (on interaction cache)",
- category: "Data",
- description: "Display a feature layer from a service using the **on interaction cache** feature request mode.",
- instructions: "Run the sample and pan and zoom around the map. With each interaction, features will be requested and stored in a local cache. Each subsequent interaction will display features from the cache and only request new features from the service.",
- tags: new[] { "cache", "feature request mode", "performance" })]
- public class ServiceFeatureTableCache : Activity
- {
- // Hold a reference to the map view
- private MapView _myMapView;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Feature service table (cache)";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create new Map with basemap
- Map myMap = new Map(BasemapStyle.ArcGISTopographic);
-
- // Create and set initial map area
- Envelope initialLocation = new Envelope(
- -1.30758164047166E7, 4014771.46954516, -1.30730056797177E7, 4016869.78617381,
- SpatialReferences.WebMercator);
- myMap.InitialViewpoint = new Viewpoint(initialLocation);
-
- // Create uri to the used feature service
- Uri serviceUri = new Uri(
- "https://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0");
-
- // Create feature table for the pools feature service
- ServiceFeatureTable poolsFeatureTable = new ServiceFeatureTable(serviceUri)
- {
-
- // Define the request mode
- FeatureRequestMode = FeatureRequestMode.OnInteractionCache
- };
-
- // Create FeatureLayer that uses the created table
- FeatureLayer poolsFeatureLayer = new FeatureLayer(poolsFeatureTable);
-
- // Add created layer to the map
- myMap.OperationalLayers.Add(poolsFeatureLayer);
-
- // Assign the map to the MapView
- _myMapView.Map = myMap;
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableCache/ServiceFeatureTableCache.jpg b/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableCache/ServiceFeatureTableCache.jpg
deleted file mode 100644
index 628876fd58..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableCache/ServiceFeatureTableCache.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableCache/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableCache/readme.metadata.json
deleted file mode 100644
index a569aedafc..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableCache/readme.metadata.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "category": "Data",
- "description": "Display a feature layer from a service using the **on interaction cache** feature request mode.",
- "formal_name": "ServiceFeatureTableCache",
- "ignore": false,
- "images": [
- "ServiceFeatureTableCache.jpg"
- ],
- "keywords": [
- "cache",
- "feature request mode",
- "performance"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/servicefeaturetablecache.htm"
- ],
- "relevant_apis": [
- "FeatureLayer",
- "FeatureRequestMode.OnInteractionCache",
- "ServiceFeatureTable",
- "ServiceFeatureTable.FeatureRequestMode"
- ],
- "snippets": [
- "ServiceFeatureTableCache.cs"
- ],
- "title": "Service feature table (on interaction cache)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableManualCache/ServiceFeatureTableManualCache.cs b/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableManualCache/ServiceFeatureTableManualCache.cs
deleted file mode 100644
index 8f0f3bc855..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableManualCache/ServiceFeatureTableManualCache.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright 2016 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-
-namespace ArcGISRuntime.Samples.ServiceFeatureTableManualCache
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Service feature table (manual cache)",
- category: "Data",
- description: "Display a feature layer from a service using the **manual cache** feature request mode.",
- instructions: "Run the sample and pan and zoom around the map. Observe the features loaded from the table.",
- tags: new[] { "cache", "feature request mode", "performance" })]
- public class ServiceFeatureTableManualCache : Activity
- {
- // Hold a reference to the map view
- private MapView _myMapView;
-
- private ServiceFeatureTable _incidentsFeatureTable;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Feature service table (manual cache)";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create new Map with basemap
- Map myMap = new Map(BasemapStyle.ArcGISTopographic);
-
- // Create and set initial map location
- MapPoint initialLocation = new MapPoint(
- -13630484, 4545415, SpatialReferences.WebMercator);
- myMap.InitialViewpoint = new Viewpoint(initialLocation, 500000);
-
- // Create uri to the used feature service
- Uri serviceUri = new Uri(
- "https://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer/0");
-
- // Create feature table for the incident feature service
- _incidentsFeatureTable = new ServiceFeatureTable(serviceUri)
- {
-
- // Define the request mode
- FeatureRequestMode = FeatureRequestMode.ManualCache
- };
-
- // When feature table is loaded, populate data
- _incidentsFeatureTable.LoadStatusChanged += OnLoadedPopulateData;
-
- // Create FeatureLayer that uses the created table
- FeatureLayer incidentsFeatureLayer = new FeatureLayer(_incidentsFeatureTable);
-
- // Add created layer to the map
- myMap.OperationalLayers.Add(incidentsFeatureLayer);
-
- // Assign the map to the MapView
- _myMapView.Map = myMap;
- }
-
- private async void OnLoadedPopulateData(object sender, Esri.ArcGISRuntime.LoadStatusEventArgs e)
- {
- // If layer isn't loaded, do nothing
- if (e.Status != Esri.ArcGISRuntime.LoadStatus.Loaded)
- return;
-
- // Create new query object that contains parameters to query specific request types
- QueryParameters queryParameters = new QueryParameters()
- {
- WhereClause = "req_Type = 'Tree Maintenance or Damage'"
- };
-
- // Create list of the fields that are returned from the service
- string[] outputFields = { "*" };
-
- try
- {
- // Populate feature table with the data based on query
- await _incidentsFeatureTable.PopulateFromServiceAsync(queryParameters, true, outputFields);
- }
- catch (Exception ex)
- {
- new AlertDialog.Builder(this).SetMessage(ex.ToString()).SetTitle("Error").Show();
- }
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableManualCache/ServiceFeatureTableManualCache.jpg b/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableManualCache/ServiceFeatureTableManualCache.jpg
deleted file mode 100644
index b8e69ace7c..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableManualCache/ServiceFeatureTableManualCache.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableManualCache/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableManualCache/readme.metadata.json
deleted file mode 100644
index 06a7979829..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableManualCache/readme.metadata.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "category": "Data",
- "description": "Display a feature layer from a service using the **manual cache** feature request mode.",
- "formal_name": "ServiceFeatureTableManualCache",
- "ignore": false,
- "images": [
- "ServiceFeatureTableManualCache.jpg"
- ],
- "keywords": [
- "cache",
- "feature request mode",
- "performance"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/servicefeaturetablemanualcache.htm"
- ],
- "relevant_apis": [
- "FeatureLayer",
- "FeatureRequestMode.ManualCache",
- "ServiceFeatureTable",
- "ServiceFeatureTable.FeatureRequestMode",
- "ServiceFeatureTable.PopulateFromServiceAsync"
- ],
- "snippets": [
- "ServiceFeatureTableManualCache.cs"
- ],
- "title": "Service feature table (manual cache)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableNoCache/ServiceFeatureTableNoCache.cs b/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableNoCache/ServiceFeatureTableNoCache.cs
deleted file mode 100644
index ad282cf51f..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableNoCache/ServiceFeatureTableNoCache.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2016 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-
-namespace ArcGISRuntime.Samples.ServiceFeatureTableNoCache
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Service feature table (no cache)",
- category: "Data",
- description: "Display a feature layer from a service using the **no cache** feature request mode.",
- instructions: "Run the sample and pan and zoom around the map. With each interaction, new features will be requested from the service and displayed on the map.",
- tags: new[] { "cache", "feature request mode", "performance" })]
- public class ServiceFeatureTableNoCache : Activity
- {
- // Hold a reference to the map view
- private MapView _myMapView;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Feature service table (no cache)";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create new Map with basemap
- Map myMap = new Map(BasemapStyle.ArcGISTopographic);
-
- // Create and set initial map area
- Envelope initialLocation = new Envelope(
- -1.30758164047166E7, 4014771.46954516, -1.30730056797177E7, 4016869.78617381,
- SpatialReferences.WebMercator);
- myMap.InitialViewpoint = new Viewpoint(initialLocation);
-
- // Create uri to the used feature service
- Uri serviceUri = new Uri(
- "https://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0");
-
- // Create feature table for the pools feature service
- ServiceFeatureTable poolsFeatureTable = new ServiceFeatureTable(serviceUri)
- {
-
- // Define the request mode
- FeatureRequestMode = FeatureRequestMode.OnInteractionNoCache
- };
-
- // Create FeatureLayer that uses the created table
- FeatureLayer poolsFeatureLayer = new FeatureLayer(poolsFeatureTable);
-
- // Add created layer to the map
- myMap.OperationalLayers.Add(poolsFeatureLayer);
-
- // Assign the map to the MapView
- _myMapView.Map = myMap;
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableNoCache/ServiceFeatureTableNoCache.jpg b/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableNoCache/ServiceFeatureTableNoCache.jpg
deleted file mode 100644
index f1d5b1be50..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableNoCache/ServiceFeatureTableNoCache.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableNoCache/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableNoCache/readme.metadata.json
deleted file mode 100644
index 36f7ae67a4..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/ServiceFeatureTableNoCache/readme.metadata.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "category": "Data",
- "description": "Display a feature layer from a service using the **no cache** feature request mode.",
- "formal_name": "ServiceFeatureTableNoCache",
- "ignore": false,
- "images": [
- "ServiceFeatureTableNoCache.jpg"
- ],
- "keywords": [
- "cache",
- "feature request mode",
- "performance"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/servicefeaturetablenocache.htm"
- ],
- "relevant_apis": [
- "FeatureLayer",
- "FeatureRequestMode.NoCache",
- "ServiceFeatureTable",
- "ServiceFeatureTable.FeatureRequestMode",
- "ServiceFeatureTable.PopulateFromServiceAsync"
- ],
- "snippets": [
- "ServiceFeatureTableNoCache.cs"
- ],
- "title": "Service feature table (no cache)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/StatisticalQuery/StatisticalQuery.cs b/src/Android/Xamarin.Android/Samples/Data/StatisticalQuery/StatisticalQuery.cs
deleted file mode 100644
index eb89063def..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/StatisticalQuery/StatisticalQuery.cs
+++ /dev/null
@@ -1,209 +0,0 @@
-// Copyright 2017 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace ArcGISRuntime.Samples.StatisticalQuery
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Statistical query",
- category: "Data",
- description: "Query a table to get aggregated statistics back for a specific field.",
- instructions: "Pan and zoom to define the extent for the query. Use the 'Cities in current extent' checkbox to control whether the query only includes features in the visible extent. Use the 'Cities grater than 5M' checkbox to filter the results to only those cities with a population greater than 5 million people. Tap 'Get statistics' to perform the query. The query will return population-based statistics from the combined results of all features matching the query criteria.",
- tags: new[] { "analysis", "average", "bounding geometry", "filter", "intersect", "maximum", "mean", "minimum", "query", "spatial query", "standard deviation", "statistics", "sum", "variance" })]
- public class StatisticalQuery : Activity
- {
- // Hold a reference to the map view
- private MapView _myMapView;
-
- // URI for the world cities map service layer
- private Uri _worldCitiesServiceUri = new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0");
-
- // World cities feature table
- private FeatureTable _worldCitiesTable;
-
- // Linear layout UI control for arranging query controls
- private LinearLayout _controlsLayout;
-
- // UI controls (switches) that will need to be referenced
- private Switch _onlyInExtentSwitch;
- private Switch _onlyBigCitiesSwitch;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Statistical query";
-
- // Create the UI
- CreateLayout();
-
- // Initialize the map and layers
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a new Map with the world streets basemap
- Map myMap = new Map(BasemapStyle.ArcGISStreets);
-
- // Create feature table using the world cities URI
- _worldCitiesTable = new ServiceFeatureTable(_worldCitiesServiceUri);
-
- // Create a new feature layer to display features in the world cities table
- FeatureLayer worldCitiesLayer = new FeatureLayer(_worldCitiesTable);
-
- // Add the world cities layer to the map
- myMap.OperationalLayers.Add(worldCitiesLayer);
-
- // Assign the map to the MapView
- _myMapView.Map = myMap;
- }
-
- private async void OnExecuteStatisticsQueryClicked(object sender, EventArgs e)
- {
- // Create definitions for each statistic to calculate
- StatisticDefinition statDefinitionAvgPop = new StatisticDefinition("POP", StatisticType.Average, "");
- StatisticDefinition statDefinitionMinPop = new StatisticDefinition("POP", StatisticType.Minimum, "");
- StatisticDefinition statDefinitionMaxPop = new StatisticDefinition("POP", StatisticType.Maximum, "");
- StatisticDefinition statDefinitionSumPop = new StatisticDefinition("POP", StatisticType.Sum, "");
- StatisticDefinition statDefinitionStdDevPop = new StatisticDefinition("POP", StatisticType.StandardDeviation, "");
- StatisticDefinition statDefinitionVarPop = new StatisticDefinition("POP", StatisticType.Variance, "");
-
- // Create a definition for count that includes an alias for the output
- StatisticDefinition statDefinitionCount = new StatisticDefinition("POP", StatisticType.Count, "CityCount");
-
- // Add the statistics definitions to a list
- List statDefinitions = new List
- { statDefinitionAvgPop,
- statDefinitionCount,
- statDefinitionMinPop,
- statDefinitionMaxPop,
- statDefinitionSumPop,
- statDefinitionStdDevPop,
- statDefinitionVarPop
- };
-
- // Create the statistics query parameters, pass in the list of definitions
- StatisticsQueryParameters statQueryParams = new StatisticsQueryParameters(statDefinitions);
-
- // If only using features in the current extent, set up the spatial filter for the statistics query parameters
- if (_onlyInExtentSwitch.Checked)
- {
- // Get the current extent (envelope) from the map view
- Envelope currentExtent = _myMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry as Envelope;
-
- // Set the statistics query parameters geometry with the envelope
- statQueryParams.Geometry = currentExtent;
-
- // Set the spatial relationship to Intersects (which is the default)
- statQueryParams.SpatialRelationship = SpatialRelationship.Intersects;
- }
-
- // If only evaluating the largest cities (over 5 million in population), set up an attribute filter
- if (_onlyBigCitiesSwitch.Checked)
- {
- // Set a where clause to get the largest cities (could also use "POP_CLASS = '5,000,000 and greater'")
- statQueryParams.WhereClause = "POP_RANK = 1";
- }
-
- try
- {
- // Execute the statistical query with these parameters and await the results
- StatisticsQueryResult statQueryResult = await _worldCitiesTable.QueryStatisticsAsync(statQueryParams);
-
- // Display results in a list in a dialog
- List> statsList = statQueryResult.First().Statistics.ToList();
- ShowStatsList(statsList);
- }
- catch (Exception ex)
- {
- new AlertDialog.Builder(this).SetMessage(ex.Message).SetTitle("Error").Show();
- }
- }
-
- private void ShowStatsList(IList> stats)
- {
- // Create a list of statistics results (field names and values) to show in the list
- IList statInfoList = new List();
- foreach (KeyValuePair kvp in stats)
- {
- // If the value is null, display "--"
- string displayString = "--";
-
- if (kvp.Value != null)
- {
- displayString = kvp.Value.ToString();
- }
-
- statInfoList.Add(kvp.Key + " : " + displayString);
- }
-
- // Create an array adapter for the stats list
- ArrayAdapter statsArrayAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, statInfoList);
- statsArrayAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleListItem1);
-
- // Create a list view to display the results
- ListView statsListView = new ListView(this)
- {
- Adapter = statsArrayAdapter
- };
-
- // Show the list view in a dialog
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
- dialogBuilder.SetView(statsListView);
- dialogBuilder.Show();
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- _controlsLayout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create switches for controlling which features are included in the query
- _onlyBigCitiesSwitch = new Switch(this)
- {
- Text = "Only cities over 5M"
- };
- _onlyInExtentSwitch = new Switch(this)
- {
- Text = "Only in current extent"
- };
-
- // Create a Button to execute the statistical query
- Button getStatsButton = new Button(this)
- {
- Text = "Get Statistics"
- };
- getStatsButton.Click += OnExecuteStatisticsQueryClicked;
-
- // Add the query controls to the layout
- _controlsLayout.AddView(_onlyBigCitiesSwitch);
- _controlsLayout.AddView(_onlyInExtentSwitch);
- _controlsLayout.AddView(getStatsButton);
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- _controlsLayout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(_controlsLayout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/StatisticalQuery/StatisticalQuery.jpg b/src/Android/Xamarin.Android/Samples/Data/StatisticalQuery/StatisticalQuery.jpg
deleted file mode 100644
index 0a7127825d..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/StatisticalQuery/StatisticalQuery.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/StatisticalQuery/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/StatisticalQuery/readme.metadata.json
deleted file mode 100644
index 3e4f446cf9..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/StatisticalQuery/readme.metadata.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "category": "Data",
- "description": "Query a table to get aggregated statistics back for a specific field.",
- "formal_name": "StatisticalQuery",
- "ignore": false,
- "images": [
- "StatisticalQuery.jpg"
- ],
- "keywords": [
- "analysis",
- "average",
- "bounding geometry",
- "filter",
- "intersect",
- "maximum",
- "mean",
- "minimum",
- "query",
- "spatial query",
- "standard deviation",
- "statistics",
- "sum",
- "variance"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/statisticalquery.htm"
- ],
- "relevant_apis": [
- "QueryParameters",
- "ServiceFeatureTable",
- "StatisticDefinition",
- "StatisticRecord",
- "StatisticType",
- "StatisticsQueryParameters",
- "StatisticsQueryResult"
- ],
- "snippets": [
- "StatisticalQuery.cs"
- ],
- "title": "Statistical query"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/StatsQueryGroupAndSort/StatsQueryGroupAndSort.cs b/src/Android/Xamarin.Android/Samples/Data/StatsQueryGroupAndSort/StatsQueryGroupAndSort.cs
deleted file mode 100644
index e076aeaaa8..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/StatsQueryGroupAndSort/StatsQueryGroupAndSort.cs
+++ /dev/null
@@ -1,1030 +0,0 @@
-// Copyright 2017 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.Content;
-using Android.OS;
-using Android.Util;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using ContextThemeWrapper = AndroidX.AppCompat.View.ContextThemeWrapper;
-
-namespace ArcGISRuntime.Samples.StatsQueryGroupAndSort
-{
- [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.AndroidLayout("GroupedResultsList_DataItem.axml", "GroupedResultsList_GroupItem.axml")]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Statistical query group and sort",
- category: "Data",
- description: "Query a feature table for statistics, grouping and sorting by different fields.",
- instructions: "The sample will start with some default options selected. You can immediately tap the \"Get Statistics\" button to see the results for these options. There are several ways to customize your queries:",
- tags: new[] { "correlation", "data", "fields", "filter", "group", "sort", "statistics", "table" })]
- public class StatsQueryGroupAndSort : Activity
- {
- // URI for the US states map service
- private Uri _usStatesServiceUri = new Uri("https://services.arcgis.com/jIL9msH9OI208GCb/arcgis/rest/services/Counties_Obesity_Inactivity_Diabetes_2013/FeatureServer/0");
-
- // US states feature table
- private FeatureTable _usStatesTable;
-
- // List of field names from the table
- private List _fieldNames = new List();
-
- // Selected fields for grouping results
- private Dictionary _groupByFields = new Dictionary();
-
- // Collection to hold fields to order results by
- private List _orderByFields = new List();
-
- // List of statistics definitions to use in the query
- private List _statisticDefinitions = new List();
-
- // Linear layout UI control for arranging query controls
- private LinearLayout _controlsLayout;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Statistical query group and sort";
-
- // Create the UI
- CreateLayout();
-
- // Initialize the service feature table
- Initialize();
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- _controlsLayout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Button for launching the UI to view or define statistics definitions for the query
- Button showStatDefinitionsButton = new Button(this)
- {
- Text = "Statistic Definitions"
- };
- showStatDefinitionsButton.Click += ShowStatDefinitions;
-
- // Button to choose fields with which to group results
- Button showGroupFieldsButton = new Button(this)
- {
- Text = "Group Fields"
- };
- showGroupFieldsButton.Click += ShowGroupFields;
-
- // Button to choose fields with which to sort results (must be one of the 'group by' fields)
- Button showOrderByFieldsButton = new Button(this)
- {
- Text = "Order By Fields"
- };
- showOrderByFieldsButton.Click += ShowOrderByFields;
-
- // Create a Button to execute the statistical query
- Button getStatsButton = new Button(this)
- {
- Text = "Execute Query"
- };
- getStatsButton.Click += ExecuteStatisticsQuery;
-
- // Define additional space (margin) between the execute button and the others
- Space space = new Space(this);
- space.SetMinimumHeight(200);
-
- // Add the query controls to the layout
- _controlsLayout.AddView(showStatDefinitionsButton);
- _controlsLayout.AddView(showGroupFieldsButton);
- _controlsLayout.AddView(showOrderByFieldsButton);
- _controlsLayout.AddView(space);
- _controlsLayout.AddView(getStatsButton);
-
- // Show the layout in the app
- SetContentView(_controlsLayout);
- }
-
- private async void Initialize()
- {
- // Create the US states feature table
- _usStatesTable = new ServiceFeatureTable(_usStatesServiceUri);
-
- try
- {
- // Load the table
- await _usStatesTable.LoadAsync();
-
- // Get a list of field names from the table
- _fieldNames = _usStatesTable.Fields.Select(field => field.Name).ToList();
-
- // Create a dictionary of fields the user can select for grouping
- // The value for each is set to false initially, as nothing is selected by default
- _groupByFields = _fieldNames.ToDictionary(name => name, name => false);
-
- // Create a list of field options for ordering results (initially empty)
- _orderByFields = new List();
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private void ShowStatDefinitions(object sender, EventArgs e)
- {
- // Create a dialog for choosing statistics (field names and statistic types)
- StatDefinitionsDialog statsDefDialog = new StatDefinitionsDialog(_fieldNames, _statisticDefinitions);
-
- // Begin a transaction to show a UI fragment (stats definitions dialog)
- FragmentTransaction trans = FragmentManager.BeginTransaction();
- statsDefDialog.Show(trans, "stats_defs");
- }
-
- private void ShowGroupFields(object sender, EventArgs e)
- {
- // Create a dialog for choosing fields to group results with
- GroupFieldsDialog groupFieldsDialog = new GroupFieldsDialog(_groupByFields);
-
- // Handle the dialog closing event to read the selected fields
- groupFieldsDialog.GroupFieldDialogClosed += (s, args) =>
- {
- // Update the dictionary of group fields from the dialog
- _groupByFields = args;
-
- // Get the current list of group fields and create/update the sort field choices
- // (only fields selected for grouping can be used to order results)
- List> currentGroupFields = _groupByFields.Where(field => field.Value == true).ToList();
-
- // Loop through the group fields
- foreach (KeyValuePair groupField in currentGroupFields)
- {
- // Check if this field is missing from the current sort field options
- OrderFieldOption existingOption = _orderByFields.Find((opt) => opt.OrderInfo.FieldName == groupField.Key);
- if (existingOption == null)
- {
- // If the field is missing, create a new OrderFieldOption and add it to the list
- existingOption = new OrderFieldOption(false, new OrderBy(groupField.Key, SortOrder.Ascending));
- _orderByFields.Add(existingOption);
- }
- }
-
- // Also make sure to remove any 'order by' fields that were removed from the 'group by' list
- for (int i = _orderByFields.Count - 1; i >= 0; i--)
- {
- // If the order by field is not also one of the group fields, remove it from the list
- OrderFieldOption opt = _orderByFields.ElementAt(i);
- KeyValuePair existingGroupField = currentGroupFields.FirstOrDefault(field => field.Key == opt.OrderInfo.FieldName);
- if (existingGroupField.Key == null)
- {
- _orderByFields.RemoveAt(i);
- }
- }
- };
-
- // Begin a transaction to show a UI fragment (group fields dialog)
- FragmentTransaction trans = FragmentManager.BeginTransaction();
- groupFieldsDialog.Show(trans, "group_flds");
- }
-
- private void ShowOrderByFields(object sender, EventArgs e)
- {
- // If there are no available order fields, don't show the (empty) list
- if (_orderByFields.Count == 0)
- {
- // Warn the user to choose group fields first
- ShowMessage("Results can only be ordered by group fields.", "No Group Fields");
- return;
- }
-
- // Create a new dialog for choosing fields to order with
- OrderByFieldsDialog orderFieldsDialog = new OrderByFieldsDialog(_orderByFields);
-
- // Handle the dialog closing event to capture the current order field choices
- orderFieldsDialog.OrderFieldDialogClosed += (s, args) =>
- {
- _orderByFields = args;
- };
-
- // Begin a transaction to show a UI fragment (order by fields dialog)
- FragmentTransaction trans = FragmentManager.BeginTransaction();
- orderFieldsDialog.Show(trans, "order_flds");
- }
-
- private async void ExecuteStatisticsQuery(object sender, EventArgs e)
- {
- // Verify that there is at least one statistic definition
- if (!_statisticDefinitions.Any())
- {
- // Warn the user to define a statistic to query
- ShowMessage("Please define at least one statistic for the query.", "Statistical Query");
- return;
- }
-
- // Create the statistics query parameters, pass in the list of statistic definitions
- StatisticsQueryParameters statQueryParams = new StatisticsQueryParameters(_statisticDefinitions);
-
- // Specify the selected group fields (if any)
- if (_groupByFields != null)
- {
- // Find fields in the dictionary with a 'true' value and add them to the group by field names
- foreach (KeyValuePair groupField in _groupByFields.Where(field => field.Value))
- {
- statQueryParams.GroupByFieldNames.Add(groupField.Key);
- }
- }
-
- // Specify the fields to order by (if any)
- if (_orderByFields != null)
- {
- foreach (OrderFieldOption orderBy in _orderByFields)
- {
- statQueryParams.OrderByFields.Add(orderBy.OrderInfo);
- }
- }
-
- // Ignore counties with missing data
- statQueryParams.WhereClause = "\"State\" IS NOT NULL";
-
- try
- {
- // Execute the statistical query with these parameters and await the results
- StatisticsQueryResult statQueryResult = await _usStatesTable.QueryStatisticsAsync(statQueryParams);
-
- // Get results formatted as a dictionary (group names and their associated dictionary of results)
- Dictionary> resultsLookup = statQueryResult.ToDictionary(r => string.Join(", ", r.Group.Values), r => r.Statistics);
-
- // Create an instance of a custom list adapter that has logic to show results as expandable groups
- ExpandableResultsListAdapter expandableListAdapter = new ExpandableResultsListAdapter(this, resultsLookup);
-
- // Create an expandable list view and assign the expandable adapter
- ExpandableListView expandableResultsListView = new ExpandableListView(this);
- expandableResultsListView.SetAdapter(expandableListAdapter);
-
- // Show the expandable list view in a dialog
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
- dialogBuilder.SetView(expandableResultsListView);
- dialogBuilder.Show();
- }
- catch (Exception ex)
- {
- new AlertDialog.Builder(this).SetMessage(ex.ToString()).SetTitle("Error").Show();
- }
- }
-
- private void ShowMessage(string message, string title)
- {
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle(title);
- alertBuilder.SetMessage(message);
- alertBuilder.Show();
- }
- }
-
- // Simple class to describe an "order by" option
- public class OrderFieldOption
- {
- // Whether or not to use this field to order results
- public bool OrderWith { get; set; }
-
- // The order by info: field name and sort order
- public OrderBy OrderInfo { get; set; }
-
- public OrderFieldOption(bool orderWith, OrderBy orderInfo)
- {
- OrderWith = orderWith;
- OrderInfo = orderInfo;
- }
- }
-
- // A class that defines a custom dialog for defining statistics to use in the query
- public class StatDefinitionsDialog : DialogFragment
- {
- // List of field names from the table
- private List _fieldNames;
-
- // List of statistic definitions for the query
- private List _statisticDefinitions;
-
- // Spinner (drop down) to display fields from the table
- private Spinner _fieldSpinner;
-
- // Spinner to display available statistic types (average, sum, maximum, etc.)
- private Spinner _statSpinner;
-
- // ListView to show chosen statistic definitions (field name and statistic type)
- private ListView _statDefListView;
-
- public StatDefinitionsDialog(List fieldNames, List statisticDefs)
- {
- // Store field names for the table being queried
- _fieldNames = fieldNames;
-
- // Store a list of the current statistic definitions
- _statisticDefinitions = statisticDefs;
- }
-
- public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
- {
- // Dialog UI to display
- LinearLayout dialogView = null;
-
- // Get the context for creating the dialog controls
- Android.Content.Context ctx = Activity.ApplicationContext;
- ContextThemeWrapper ctxWrapper = new ContextThemeWrapper(ctx, Android.Resource.Style.ThemeMaterialLight);
-
- // Set a dialog title
- Dialog.SetTitle("Statistics Definitions");
-
- // Call OnCreateView on the base
- base.OnCreateView(inflater, container, savedInstanceState);
-
- // The container for the dialog is a vertical linear layout
- dialogView = new LinearLayout(ctxWrapper)
- {
- Orientation = Orientation.Vertical
- };
-
- // Spinner for choosing a field to get statistics for
- _fieldSpinner = new Spinner(ctxWrapper);
-
- // Create an array adapter to display the fields
- ArrayAdapter fieldsAdapter = new ArrayAdapter(ctxWrapper, Android.Resource.Layout.SimpleSpinnerItem);
- foreach (string field in _fieldNames)
- {
- fieldsAdapter.Add(field);
- }
-
- // Set the drop down style for the array adapter, then assign it to the field spinner control
- fieldsAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
- _fieldSpinner.Adapter = fieldsAdapter;
-
- // Create a horizontal layout to display the field spinner (with a label)
- LinearLayout fieldView = new LinearLayout(ctxWrapper)
- {
- Orientation = Orientation.Horizontal
- };
-
- // Create a label for the spinner
- TextView fieldLabel = new TextView(ctxWrapper)
- {
- Text = "Field:",
- LabelFor = _fieldSpinner.Id
- };
-
- // Add field controls to the horizontal layout
- fieldView.AddView(fieldLabel);
- fieldView.AddView(_fieldSpinner);
- fieldView.SetPadding(140, 0, 0, 0);
- dialogView.AddView(fieldView);
-
- // Spinner for selecting the statistic type
- _statSpinner = new Spinner(ctx);
-
- // Create an array adapter to display the statistic types
- ArrayAdapter statTypeAdapter = new ArrayAdapter(ctxWrapper, Android.Resource.Layout.SimpleSpinnerItem);
-
- // Read the statistic types from the StatisticType enum
- Array statTypes = Enum.GetValues(typeof(StatisticType));
- foreach (object stat in statTypes)
- {
- // Add each statistic type to the adapter
- statTypeAdapter.Add(stat.ToString());
- }
-
- // Set the drop down style for the array adapter, then assign it to the statistic type spinner control
- statTypeAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
- _statSpinner.Adapter = statTypeAdapter;
-
- // Create a horizontal layout to display the statistic type spinner (with a label)
- LinearLayout statTypeView = new LinearLayout(ctxWrapper)
- {
- Orientation = Orientation.Horizontal
- };
-
- // Create the label for the statistic type list
- TextView typeLabel = new TextView(ctxWrapper)
- {
- Text = "Type:",
- LabelFor = _statSpinner.Id
- };
-
- // Add statistic type controls to the horizontal layout
- statTypeView.AddView(typeLabel);
- statTypeView.AddView(_statSpinner);
- statTypeView.SetPadding(140, 0, 0, 0);
-
- // Add the statistic type layout to the dialog
- dialogView.AddView(statTypeView);
-
- // Create a button to add a new statistic definition (selected field and statistic type)
- Button addStatDefButton = new Button(ctxWrapper)
- {
- Text = "Add"
- };
- addStatDefButton.Click += AddStatisticDefinition;
-
- // Create a button to remove the selected statistic definition
- Button removeStatDefButton = new Button(ctxWrapper)
- {
- Text = "Remove"
- };
- removeStatDefButton.Click += RemoveStatisticDefinition;
-
- // Create a horizontal layout to contain the add and remove buttons
- LinearLayout buttonView = new LinearLayout(ctxWrapper)
- {
- Orientation = Orientation.Horizontal
- };
- buttonView.AddView(addStatDefButton);
- buttonView.AddView(removeStatDefButton);
-
- // Add the button layout to the dialog
- dialogView.AddView(buttonView);
-
- // Create a list view and an instance of a custom list adapter to show the statistic definitions
- StatDefinitionListAdapter listAdapter = new StatDefinitionListAdapter(Activity, _statisticDefinitions);
- _statDefListView = new ListView(ctxWrapper)
- {
- Adapter = listAdapter,
-
- // Only allow one choice in the statistic definitions list ('remove' button will work on the selected row)
- ChoiceMode = ChoiceMode.Single
- };
-
- // Add the statistic definitions list to the dialog
- dialogView.AddView(_statDefListView);
-
- // Return the new view for display
- return dialogView;
- }
-
- // Handler for the RemoveStatisticDefinitionButton click event
- private void RemoveStatisticDefinition(object sender, EventArgs e)
- {
- // Check for a selected row in the list view
- int selectedPosition = _statDefListView.CheckedItemPosition;
- if (selectedPosition >= 0)
- {
- // Call a function in the custom list adapter that will remove the statistic definition at this position (and update the data in the list view)
- ((StatDefinitionListAdapter)_statDefListView.Adapter).RemoveStatisticDefinitionAt(selectedPosition);
- }
- }
-
- // Handler for the AddStatisticDefinitionButton click event
- private void AddStatisticDefinition(object sender, EventArgs e)
- {
- // Get the selected field name in the dialog
- string fieldName = _fieldSpinner.SelectedItem.ToString();
-
- // Get the selected statistic type name in the dialog and get the corresponding enum value
- string statTypeName = _statSpinner.SelectedItem.ToString();
- StatisticType statType = (StatisticType)Enum.Parse(typeof(StatisticType), statTypeName);
-
- // Build a field alias for the statistic results that use the field name and statistic type
- string alias = fieldName + "_" + statTypeName;
-
- // Create a new StatisticDefinition with the field name, statistic type, and output field alias
- StatisticDefinition statisticDefinition = new StatisticDefinition(fieldName, statType, alias);
-
- // Call a function in the custom list adapter that will add the new statistic definition (and update the data in the list view)
- ((StatDefinitionListAdapter)_statDefListView.Adapter).AddStatisticDefinition(statisticDefinition);
- }
- }
-
- // A class that defines a custom list adapter for displaying statistic definitions
- public class StatDefinitionListAdapter : BaseAdapter
- {
- // Store the current activity (passed into the constructor)
- private Activity _ctx;
-
- // List of statistic definitions to display
- private List _statisticDefinitions;
-
- // Constructor that takes the current activity and list of statistic definitions
- public StatDefinitionListAdapter(Activity context, List statDefs) : base()
- {
- _ctx = context;
- _statisticDefinitions = statDefs;
- }
-
- // Return the statistic definition at the specified position in the list
- public override StatisticDefinition this[int position]
- {
- get
- {
- return _statisticDefinitions[position];
- }
- }
-
- // Add a new statistic definition to the internal list
- public void AddStatisticDefinition(StatisticDefinition statDef)
- {
- // See if this definition already exists in the list (output alias name is unique)
- StatisticDefinition existingDef = _statisticDefinitions.Find((d) => d.OutputAlias == statDef.OutputAlias);
-
- // If the definition is not found in the list, add it
- if (existingDef == null)
- {
- _statisticDefinitions.Add(statDef);
-
- // Raise a notification that the data have changed
- NotifyDataSetChanged();
- }
- }
-
- // Remove the statistic definition at the specified position from the internal list
- public void RemoveStatisticDefinitionAt(int position)
- {
- // Verify that the position is within the correct range
- if (position >= 0 && position < _statisticDefinitions.Count)
- {
- // Remove the definition from the list
- _statisticDefinitions.RemoveAt(position);
-
- // Raise a notification that the data have changed
- NotifyDataSetChanged();
- }
- }
-
- // Return the count of statistic definitions in the list
- public override int Count
- {
- get
- {
- return _statisticDefinitions.Count;
- }
- }
-
- // Return an item ID (just use the position in the list)
- public override long GetItemId(int position)
- {
- return position;
- }
-
- // Return a view to display each item (statistic definition)
- public override View GetView(int position, View convertView, ViewGroup parent)
- {
- // Use a list item style with two text areas and the ability to be activated (selected)
- View cellView = _ctx.LayoutInflater.Inflate(Android.Resource.Layout.SimpleListItemActivated2, null);
-
- // Find the text view for the main text and use it to display the field name
- cellView.FindViewById(Android.Resource.Id.Text1).Text = _statisticDefinitions[position].OnFieldName;
-
- // Find the text view for the details text and use it to display the statistic type
- cellView.FindViewById(Android.Resource.Id.Text2).Text = _statisticDefinitions[position].StatisticType.ToString();
-
- // Return the view
- return cellView;
- }
- }
-
- // A class that defines a custom dialog for choosing fields to group results on
- public class GroupFieldsDialog : DialogFragment
- {
- // Dictionary of field names from the table and whether or not to use them to group results
- private Dictionary _potentialGroupByFields;
-
- // ListView to display the available group fields
- private ListView _groupFieldsListView;
-
- // Constructor that takes a dictionary of available group fields
- public GroupFieldsDialog(Dictionary groupByFields)
- {
- _potentialGroupByFields = groupByFields;
- }
-
- // Event that fires when the dialog closes (passes back the updated dictionary of group fields)
- public event EventHandler> GroupFieldDialogClosed;
-
- // Handle the dialog dismiss event to raise a custom event that passes back the updated fields dictionary
- public override void OnDismiss(IDialogInterface dialog)
- {
- base.OnDismiss(dialog);
-
- // If the event has listeners
- if (GroupFieldDialogClosed != null)
- {
- // Get an array of all checked row positions in the list
- SparseBooleanArray checkedItemsArray = _groupFieldsListView.CheckedItemPositions;
-
- // Loop through all fields in the dictionary
- for (int i = 0; i < _potentialGroupByFields.Count; i++)
- {
- // Set the corresponding value for the field to false (will not be used for grouping results)
- string key = _potentialGroupByFields.Keys.ElementAt(i);
- _potentialGroupByFields[key] = false;
-
- // If the corresponding row in the list view is checked, set the field's value in the dictionary to true
- if (checkedItemsArray.KeyAt(i) == i && checkedItemsArray.ValueAt(i))
- {
- _potentialGroupByFields[key] = true;
- }
- }
-
- // Raise the GroupFieldDialogClosed event to pass back the updated dictionary
- GroupFieldDialogClosed(this, _potentialGroupByFields);
- }
- }
-
- public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
- {
- // Dialog UI to display
- LinearLayout dialogView = null;
-
- // Get the context for creating the dialog controls
- Android.Content.Context ctx = this.Activity.ApplicationContext;
- ContextThemeWrapper ctxWrapper = new ContextThemeWrapper(ctx, Android.Resource.Style.ThemeMaterialLight);
-
- // Set a dialog title
- this.Dialog.SetTitle("Group Results By");
-
- // Call OnCreateView on the base
- base.OnCreateView(inflater, container, savedInstanceState);
-
- // The container for the dialog is a vertical linear layout
- dialogView = new LinearLayout(ctxWrapper)
- {
- Orientation = Orientation.Vertical
- };
-
- // Create an instance of a custom list adapter to show the available group fields
- GroupFieldListAdapter listAdapter = new GroupFieldListAdapter(this.Activity, _potentialGroupByFields);
-
- // Create a new list view that uses the adapter and allows for multiple row selection
- _groupFieldsListView = new ListView(ctxWrapper)
- {
- Adapter = listAdapter,
- ChoiceMode = ChoiceMode.Multiple
- };
-
- // Loop through all the available fields
- for (int i = 0; i < _potentialGroupByFields.Count; i++)
- {
- // See if this field have been selected for grouping results or not
- bool chosenForGroup = _potentialGroupByFields.ElementAt(i).Value;
-
- // Set the checked state in the list view to show the chosen fields
- _groupFieldsListView.SetItemChecked(i, chosenForGroup);
- }
-
- // Add the list view to the dialog UI
- dialogView.AddView(_groupFieldsListView);
-
- // Return the new view for display
- return dialogView;
- }
- }
-
- // A class that defines a custom list adapter to show fields for grouping results
- public class GroupFieldListAdapter : BaseAdapter>
- {
- // Store the current activity
- private Activity _ctx;
-
- // Dictionary of field names and a value to indicate whether they are used for grouping
- private Dictionary _groupFields;
-
- // Constructor that takes the current activity and a dictionary of fields
- public GroupFieldListAdapter(Activity context, Dictionary groupFields) : base()
- {
- _ctx = context;
- _groupFields = groupFields;
- }
-
- // Get the group field option at the specified position
- public override KeyValuePair this[int position]
- {
- get
- {
- return _groupFields.ElementAt(position);
- }
- }
-
- // Return the count of fields in the dictionary
- public override int Count
- {
- get
- {
- return _groupFields.Count;
- }
- }
-
- // Get an ID for the item at the specified position
- public override long GetItemId(int position)
- {
- return position;
- }
-
- // Create a view to display an item in the dictionary (key-value pair)
- public override View GetView(int position, View convertView, ViewGroup parent)
- {
- // Re-use an existing view, if one is supplied (otherwise create a new one)
- View cellView = convertView;
- if (cellView == null)
- {
- // Create a list item that shows one text view and a check
- cellView = _ctx.LayoutInflater.Inflate(Android.Resource.Layout.SimpleListItemChecked, null);
- }
-
- // Set the text with the field name (checked value is set in the dialog UI)
- cellView.FindViewById(Android.Resource.Id.Text1).Text = _groupFields.ElementAt(position).Key;
-
- return cellView;
- }
- }
-
- // Class that defines a dialog for choosing fields for ordering (sorting) results
- public class OrderByFieldsDialog : DialogFragment
- {
- // List of fields and whether or not to use them to order (sort) results
- private List _potentialOrderByFields;
-
- // List view to display available fields for ordering (only those fields chosen for grouping)
- private ListView _orderFieldsListView;
-
- // Constructor that takes a list of order fields
- public OrderByFieldsDialog(List orderByFields)
- {
- _potentialOrderByFields = orderByFields;
- }
-
- // Event that returns the updated list of order options when the dialog closes
- public event EventHandler> OrderFieldDialogClosed;
-
- // Handle the dismiss event on the dialog to raise a custom event that passes the updated order fields back
- public override void OnDismiss(IDialogInterface dialog)
- {
- base.OnDismiss(dialog);
-
- // Verify the event has listeners
- if (OrderFieldDialogClosed != null)
- {
- // Get an array of checked list item positions (indices)
- SparseBooleanArray checkedItemsArray = _orderFieldsListView.CheckedItemPositions;
-
- // Loop through all the available order fields
- for (int i = 0; i < _potentialOrderByFields.Count; i++)
- {
- // Initially set each order option to false
- OrderFieldOption orderOption = _potentialOrderByFields[i];
- orderOption.OrderWith = false;
-
- // If the item was checked in the list view, set the order option to true
- if (checkedItemsArray.KeyAt(i) == i && checkedItemsArray.ValueAt(i))
- {
- orderOption.OrderWith = true;
- }
- }
-
- // Raise the event and pass back the updated list of order field options
- OrderFieldDialogClosed(this, _potentialOrderByFields);
- }
- }
-
- // Create the dialog UI
- public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
- {
- // Dialog UI to display
- LinearLayout dialogView = null;
-
- // Get the context for creating the dialog controls
- Android.Content.Context ctx = this.Activity.ApplicationContext;
- ContextThemeWrapper ctxWrapper = new ContextThemeWrapper(ctx, Android.Resource.Style.ThemeMaterialLight);
-
- // Set a dialog title
- this.Dialog.SetTitle("Order Results");
-
- // Call OnCreateView on the base
- base.OnCreateView(inflater, container, savedInstanceState);
-
- // The container for the dialog is a vertical linear layout
- dialogView = new LinearLayout(ctxWrapper)
- {
- Orientation = Orientation.Vertical
- };
-
- // Create an instance of a custom list adapter for showing the order fields
- OrderFieldListAdapter listAdapter = new OrderFieldListAdapter(this.Activity, _potentialOrderByFields);
-
- // Create a new list view that uses the adapter
- _orderFieldsListView = new ListView(ctxWrapper)
- {
- Adapter = listAdapter,
-
- // Allow the user to select multiple fields in the list view
- ChoiceMode = ChoiceMode.Multiple
- };
-
- // Loop through all order fields in the list
- for (int i = 0; i < _potentialOrderByFields.Count; i++)
- {
- // If this field has been selected to order with, check it in the list view
- bool chosenForOrder = _potentialOrderByFields[i].OrderWith;
- _orderFieldsListView.SetItemChecked(i, chosenForOrder);
- }
-
- // Add the list view to the dialog
- dialogView.AddView(_orderFieldsListView);
-
- // Return the new view for display
- return dialogView;
- }
- }
-
- // Class to define a custom list adapter to show order field options
- public class OrderFieldListAdapter : BaseAdapter
- {
- // Store the current activity
- private Activity _ctx;
-
- // Store a list of the available order field options
- private List _orderFields;
-
- // Constructor that takes the current activity and list of order fields
- public OrderFieldListAdapter(Activity context, List orderFields) : base()
- {
- _ctx = context;
- _orderFields = orderFields;
- }
-
- // Return the order field option at the specified position
- public override OrderFieldOption this[int position]
- {
- get
- {
- return _orderFields[position];
- }
- }
-
- // Return the count of order field options in the list
- public override int Count
- {
- get
- {
- return _orderFields.Count;
- }
- }
-
- // Return the ID for the item at the specified position
- public override long GetItemId(int position)
- {
- return position;
- }
-
- // Create a view to display each order field option
- public override View GetView(int position, View convertView, ViewGroup parent)
- {
- // Create a list item view that shows a single text view and a check box
- View cellView = _ctx.LayoutInflater.Inflate(Android.Resource.Layout.SimpleListItemChecked, null);
-
- // Set the list item text with the field name (checked value will be set in the dialog UI)
- cellView.FindViewById(Android.Resource.Id.Text1).Text = _orderFields[position].OrderInfo.FieldName;
-
- return cellView;
- }
- }
-
- // Class that defines a custom list adapter for displaying an expandable list of grouped items
- public class ExpandableResultsListAdapter : BaseExpandableListAdapter
- {
- // Store the current context
- private Context _ctx;
-
- // Store a dictionary of results: group name, results dictionary
- private Dictionary> _resultsDictionary;
-
- // Store the group names
- private string[] _groupNames;
-
- // Constructor that takes the current context and a dictionary of group names and results
- public ExpandableResultsListAdapter(Context context, Dictionary> results)
- {
- // Store the context and results
- _ctx = context;
- _resultsDictionary = results;
-
- // Get the group names from the results dictionary
- _groupNames = new string[results.Count];
- results.Keys.CopyTo(_groupNames, 0);
- }
-
- // Return the count of groups in the results
- public override int GroupCount
- {
- get
- {
- return _groupNames.Length;
- }
- }
-
- // No IDs for the items
- public override bool HasStableIds
- {
- get
- {
- return false;
- }
- }
-
- // Return the result at the specified index
- public override Java.Lang.Object GetChild(int groupPosition, int childPosition)
- {
- // Get the result dictionary for the specified group
- IReadOnlyDictionary result = new Dictionary();
- _resultsDictionary.TryGetValue(_groupNames[groupPosition], out result);
-
- // Return a string concatenated from the field name and value at the specified position
- return result.ElementAt(childPosition).Key + " : " + result.ElementAt(childPosition).Value;
- }
-
- // Return the ID for the specified item
- public override long GetChildId(int groupPosition, int childPosition)
- {
- return childPosition;
- }
-
- // Return the count of items in the specified group
- public override int GetChildrenCount(int groupPosition)
- {
- return _resultsDictionary.ElementAt(groupPosition).Value.Count;
- }
-
- // Return a view to display a child item (key-value string within a group)
- public override View GetChildView(int groupPosition, int childPosition, bool isLastChild, View convertView, ViewGroup parent)
- {
- // Reuse the current view, if available
- if (convertView == null)
- {
- // Inflate a view from a resource that defines a result list item
- LayoutInflater inflator = (LayoutInflater)_ctx.GetSystemService(Context.LayoutInflaterService);
- convertView = inflator.Inflate(Resource.Layout.GroupedResultsList_DataItem, null);
- }
-
- // Get the text view from the data item layout
- TextView textViewItem = convertView.FindViewById(Resource.Id.item);
-
- // Get content for this item and add it to the text view
- string content = (string)GetChild(groupPosition, childPosition);
- textViewItem.Text = content;
-
- return convertView;
- }
-
- // Return the group name
- public override Java.Lang.Object GetGroup(int groupPosition)
- {
- // Find the group name in the array
- string groupName = _groupNames[groupPosition];
-
- // If the group name is empty (maybe results weren't grouped), return "Results" for the group name
- if (String.IsNullOrEmpty(groupName))
- {
- groupName = "Results";
- }
-
- return groupName;
- }
-
- // Return the ID for the specified group
- public override long GetGroupId(int groupPosition)
- {
- return groupPosition;
- }
-
- // Create a view to display the group heading
- public override View GetGroupView(int groupPosition, bool isExpanded, View convertView, ViewGroup parent)
- {
- // Reuse the view, if available
- if (convertView == null)
- {
- // Inflate a view from a resource that defines a result group item
- LayoutInflater inflator = (LayoutInflater)_ctx.GetSystemService(Context.LayoutInflaterService);
- convertView = inflator.Inflate(Resource.Layout.GroupedResultsList_GroupItem, null);
- }
-
- // Get the group name for this position
- string textGroup = (string)GetGroup(groupPosition);
-
- // Display the group in the text view
- TextView textViewGroup = convertView.FindViewById(Resource.Id.group);
- textViewGroup.Text = textGroup;
-
- return convertView;
- }
-
- // Return if the item at the specified position is selectable
- public override bool IsChildSelectable(int groupPosition, int childPosition)
- {
- return false;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/StatsQueryGroupAndSort/StatsQueryGroupAndSort.jpg b/src/Android/Xamarin.Android/Samples/Data/StatsQueryGroupAndSort/StatsQueryGroupAndSort.jpg
deleted file mode 100644
index ab66f68987..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/StatsQueryGroupAndSort/StatsQueryGroupAndSort.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/StatsQueryGroupAndSort/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/StatsQueryGroupAndSort/readme.metadata.json
deleted file mode 100644
index fe5f6a96de..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/StatsQueryGroupAndSort/readme.metadata.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "category": "Data",
- "description": "Query a feature table for statistics, grouping and sorting by different fields.",
- "formal_name": "StatsQueryGroupAndSort",
- "ignore": false,
- "images": [
- "StatsQueryGroupAndSort.jpg"
- ],
- "keywords": [
- "correlation",
- "data",
- "fields",
- "filter",
- "group",
- "sort",
- "statistics",
- "table"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/statsquerygroupandsort.htm"
- ],
- "relevant_apis": [
- "Field",
- "OrderBy",
- "QueryParameters",
- "ServiceFeatureTable",
- "StatisticDefinition",
- "StatisticRecord",
- "StatisticType",
- "StatisticsQueryParameters",
- "StatisticsQueryResult"
- ],
- "snippets": [
- "../../../Resources/layout/GroupedResultsList_DataItem.axml",
- "../../../Resources/layout/GroupedResultsList_GroupItem.axml",
- "StatsQueryGroupAndSort.cs"
- ],
- "title": "Statistical query group and sort"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/SymbolizeShapefile/SymbolizeShapefile.cs b/src/Android/Xamarin.Android/Samples/Data/SymbolizeShapefile/SymbolizeShapefile.cs
deleted file mode 100644
index a48dd7a86c..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/SymbolizeShapefile/SymbolizeShapefile.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright 2017 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using System;
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI.Controls;
-using ArcGISRuntime.Samples.Managers;
-
-namespace ArcGISRuntime.Samples.SymbolizeShapefile
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("d98b3e5293834c5f852f13c569930caa")]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Symbolize shapefile",
- category: "Data",
- description: "Display a shapefile with custom symbology.",
- instructions: "Tap the button to apply a new symbology renderer to the feature layer created from the shapefile. ",
- tags: new[] { "package", "shape file", "shapefile", "symbology", "visualization" })]
- public class SymbolizeShapefile : Activity
- {
- // Hold a reference to the map view
- private MapView _myMapView;
-
- // Hold a reference to the button
- private Button _myRendererButton;
-
- // Hold reference to the feature layer so that its renderer can be changed when button is pushed
- private FeatureLayer _shapefileFeatureLayer;
-
- // Hold reference to default renderer to enable switching back
- private Renderer _defaultRenderer;
-
- // Hold reference to alternate renderer to enable switching
- private SimpleRenderer _alternateRenderer;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Symbolize a shapefile";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private async void Initialize()
- {
- // Create the map with topographic basemap
- Map myMap = new Map(BasemapStyle.ArcGISTopographic);
-
- // Create the point for the map's initial viewpoint
- MapPoint point = new MapPoint(-11662054, 4818336, SpatialReference.Create(3857));
-
- // Create a viewpoint for the point
- Viewpoint viewpoint = new Viewpoint(point, 200000);
-
- // Set the initial viewpoint
- myMap.InitialViewpoint = viewpoint;
-
- // Create a shapefile feature table from the shapefile path
- ShapefileFeatureTable myFeatureTable = new ShapefileFeatureTable(GetShapefilePath());
-
- // Create a layer from the feature table
- _shapefileFeatureLayer = new FeatureLayer(myFeatureTable);
-
- // Add the layer to the map
- myMap.OperationalLayers.Add(_shapefileFeatureLayer);
-
- // Create the symbology for the alternate renderer
- SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.Red, 1.0);
- SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, System.Drawing.Color.Yellow, lineSymbol);
-
- // Create the alternate renderer
- _alternateRenderer = new SimpleRenderer(fillSymbol);
-
- try
- {
- // Wait for the layer to load so that it will be assigned a default renderer
- await _shapefileFeatureLayer.LoadAsync();
-
- // Hold a reference to the default renderer (to enable switching between the renderers)
- _defaultRenderer = _shapefileFeatureLayer.Renderer;
-
- // Add the map to the mapview
- _myMapView.Map = myMap;
-
- // Enable changing symbology now that sample is loaded
- _myRendererButton.Enabled = true;
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create the button
- _myRendererButton = new Button(this) { Enabled = false, Text = "Change renderer" };
-
- // Add the button to the layout
- layout.AddView(_myRendererButton);
-
- // Subscribe to button push events
- _myRendererButton.Click += _myRendererButton_Click;
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
-
- private void _myRendererButton_Click(object sender, System.EventArgs e)
- {
- // Toggle the renderer
- if (_shapefileFeatureLayer.Renderer == _defaultRenderer)
- {
- _shapefileFeatureLayer.Renderer = _alternateRenderer;
- }
- else
- {
- _shapefileFeatureLayer.Renderer = _defaultRenderer;
- }
- }
-
- private static string GetShapefilePath()
- {
- return DataManager.GetDataFolder("d98b3e5293834c5f852f13c569930caa", "Subdivisions.shp");
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/SymbolizeShapefile/SymbolizeShapefile.jpg b/src/Android/Xamarin.Android/Samples/Data/SymbolizeShapefile/SymbolizeShapefile.jpg
deleted file mode 100644
index 77faea6e63..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/SymbolizeShapefile/SymbolizeShapefile.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/SymbolizeShapefile/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/SymbolizeShapefile/readme.metadata.json
deleted file mode 100644
index 51ef1e3be7..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/SymbolizeShapefile/readme.metadata.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "category": "Data",
- "description": "Display a shapefile with custom symbology.",
- "formal_name": "SymbolizeShapefile",
- "ignore": false,
- "images": [
- "SymbolizeShapefile.jpg"
- ],
- "keywords": [
- "package",
- "shape file",
- "shapefile",
- "symbology",
- "visualization"
- ],
- "offline_data": [
- "d98b3e5293834c5f852f13c569930caa"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/symbolizeshapefile.htm"
- ],
- "relevant_apis": [
- "FeatureLayer",
- "ShapefileFeatureTable",
- "SimpleFillSymbol",
- "SimpleLineSymbol",
- "SimpleRenderer"
- ],
- "snippets": [
- "SymbolizeShapefile.cs"
- ],
- "title": "Symbolize shapefile"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/UpdateAttributes/UpdateAttributes.cs b/src/Android/Xamarin.Android/Samples/Data/UpdateAttributes/UpdateAttributes.cs
deleted file mode 100644
index dea5cfede1..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/UpdateAttributes/UpdateAttributes.cs
+++ /dev/null
@@ -1,232 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Linq;
-
-namespace ArcGISRuntimeXamarin.Samples.UpdateAttributes
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Update attributes (feature service)",
- category: "Data",
- description: "Update feature attributes in an online feature service.",
- instructions: "To change the feature's damage property, tap the feature to select it, and update the damage type using the drop down.",
- tags: new[] { "amend", "attribute", "details", "edit", "editing", "information", "value" })]
- public class UpdateAttributes : Activity
- {
- // Hold a reference to the MapView.
- private MapView _myMapView;
-
- // URL to the feature service.
- private const string FeatureServiceUrl = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0";
-
- // Name of the field that will be updated.
- private const string AttributeFieldName = "typdamage";
-
- // Hold a reference to the feature layer.
- private FeatureLayer _damageLayer;
-
- // Hold a reference to the selected feature.
- private ArcGISFeature _selectedFeature;
-
- // Hold a reference to the domain.
- private CodedValueDomain _domain;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Update attributes (feature service)";
-
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create the map with streets basemap.
- _myMapView.Map = new Map(BasemapStyle.ArcGISStreets);
-
- // Create the feature table, referring to the Damage Assessment feature service.
- ServiceFeatureTable damageTable = new ServiceFeatureTable(new Uri(FeatureServiceUrl));
-
- // When the table loads, use it to discover the domain of the typdamage field.
- damageTable.Loaded += DamageTable_Loaded;
-
- // Create a feature layer to visualize the features in the table.
- _damageLayer = new FeatureLayer(damageTable);
-
- // Add the layer to the map.
- _myMapView.Map.OperationalLayers.Add(_damageLayer);
-
- // Zoom to the United States.
- _myMapView.SetViewpointCenterAsync(new MapPoint(-10800000, 4500000, SpatialReferences.WebMercator), 3e7);
- }
-
- private void DamageTable_Loaded(object sender, EventArgs e)
- {
- // This code needs to work with the UI, so it needs to run on the UI thread.
- RunOnUiThread(() =>
- {
- // Get the relevant field from the table.
- ServiceFeatureTable table = (ServiceFeatureTable) sender;
- Field typeDamageField = table.Fields.First(field => field.Name == AttributeFieldName);
-
- // Get the domain for the field.
- _domain = (CodedValueDomain) typeDamageField.Domain;
-
- // Listen for user taps on the map - this will select the feature.
- _myMapView.GeoViewTapped += MapView_Tapped;
- });
- }
-
- private async void MapView_Tapped(object sender, GeoViewInputEventArgs e)
- {
- // Clear any existing selection.
- _damageLayer.ClearSelection();
-
- // Dismiss any existing callouts.
- _myMapView.DismissCallout();
-
- try
- {
- // Perform an identify to determine if a user tapped on a feature.
- IdentifyLayerResult identifyResult = await _myMapView.IdentifyLayerAsync(_damageLayer, e.Position, 8, false);
-
- // Do nothing if there are no results.
- if (!identifyResult.GeoElements.Any())
- {
- return;
- }
-
- // Get the tapped feature.
- _selectedFeature = (ArcGISFeature)identifyResult.GeoElements.First();
-
- // Select the feature.
- _damageLayer.SelectFeature(_selectedFeature);
-
- // Update the UI for the selection.
- ShowFeatureOptions();
- }
- catch (Exception ex)
- {
- ShowMessage("Error selecting feature.", ex.ToString());
- }
- }
-
- private void ShowFeatureOptions()
- {
- // Get the current value.
- string currentAttributeValue = _selectedFeature.Attributes[AttributeFieldName].ToString();
-
- // Set up the UI for the callout.
- Button changeValueButton = new Button(this);
- changeValueButton.Text = $"{currentAttributeValue} - Edit";
- changeValueButton.Click += ShowDamageTypeChoices;
-
- // Show the callout.
- _myMapView.ShowCalloutAt((MapPoint) _selectedFeature.Geometry, changeValueButton);
- }
-
- private void ShowDamageTypeChoices(object sender, EventArgs e)
- {
- // Create menu to show options.
- PopupMenu menu = new PopupMenu(this, (Button) sender);
- menu.MenuItemClick += (o, menuArgs) => { UpdateDamageType(menuArgs.Item.ToString()); };
-
- // Create menu options.
- foreach (CodedValue codeValue in _domain.CodedValues)
- {
- menu.Menu.Add(codeValue.Name);
- }
-
- // Show menu in the view.
- menu.Show();
- }
-
- private async void UpdateDamageType(string selectedAttributeValue)
- {
- try
- {
- // Load the feature.
- await _selectedFeature.LoadAsync();
-
- if (_selectedFeature.Attributes[AttributeFieldName].ToString() == selectedAttributeValue)
- {
- throw new Exception("Old and new attribute values are the same.");
- }
-
- // Update the attribute value.
- _selectedFeature.SetAttributeValue(AttributeFieldName, selectedAttributeValue);
-
- // Update the table.
- await _selectedFeature.FeatureTable.UpdateFeatureAsync(_selectedFeature);
-
- // Update the service.
- ServiceFeatureTable table = (ServiceFeatureTable) _selectedFeature.FeatureTable;
- await table.ApplyEditsAsync();
-
- ShowMessage("Success!", $"Edited feature {_selectedFeature.Attributes["objectid"]}");
- }
- catch (Exception ex)
- {
- ShowMessage("Failed to edit feature", ex.Message);
- }
- finally
- {
- // Clear the selection.
- _damageLayer.ClearSelection();
- _selectedFeature = null;
-
- // Dismiss any callout.
- _myMapView.DismissCallout();
- }
- }
-
- private void ShowMessage(string title, string message)
- {
- // Display the message to the user.
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.SetMessage(message).SetTitle(title).Show();
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- var layout = new LinearLayout(this) {Orientation = Orientation.Vertical};
-
- // Create the MapView.
- _myMapView = new MapView(this);
-
- // Create the help label.
- TextView helpLabel = new TextView(this);
- helpLabel.Text = "Tap to select a feature to edit.";
- helpLabel.TextAlignment = TextAlignment.Center;
- helpLabel.Gravity = GravityFlags.Center;
-
- // Add the help label to the layout.
- layout.AddView(helpLabel);
-
- // Add the map view to the layout.
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/UpdateAttributes/UpdateAttributes.jpg b/src/Android/Xamarin.Android/Samples/Data/UpdateAttributes/UpdateAttributes.jpg
deleted file mode 100644
index 553f2f1dfa..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/UpdateAttributes/UpdateAttributes.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/UpdateAttributes/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/UpdateAttributes/readme.metadata.json
deleted file mode 100644
index 9dbad48765..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/UpdateAttributes/readme.metadata.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "category": "Data",
- "description": "Update feature attributes in an online feature service.",
- "formal_name": "UpdateAttributes",
- "ignore": false,
- "images": [
- "UpdateAttributes.jpg"
- ],
- "keywords": [
- "amend",
- "attribute",
- "details",
- "edit",
- "editing",
- "information",
- "value"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/updateattributes.htm"
- ],
- "relevant_apis": [
- "ArcGISFeature",
- "FeatureLayer",
- "ServiceFeatureTable"
- ],
- "snippets": [
- "UpdateAttributes.cs"
- ],
- "title": "Update attributes (feature service)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/UpdateGeometries/UpdateGeometries.cs b/src/Android/Xamarin.Android/Samples/Data/UpdateGeometries/UpdateGeometries.cs
deleted file mode 100644
index e4674425c7..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/UpdateGeometries/UpdateGeometries.cs
+++ /dev/null
@@ -1,182 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Linq;
-using Android.Views;
-
-namespace ArcGISRuntimeXamarin.Samples.UpdateGeometries
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Update geometries (feature service)",
- category: "Data",
- description: "Update a feature's location in an online feature service.",
- instructions: "Tap a feature to select it. Tap again to set the updated location for that feature. An alert will be shown confirming success or failure.",
- tags: new[] { "editing", "feature layer", "feature table", "moving", "service", "updating" })]
- public class UpdateGeometries : Activity
- {
- // Hold a reference to the MapView.
- private MapView _myMapView;
-
- // URL to the feature service.
- private const string FeatureServiceUrl = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0";
-
- // Hold a reference to the feature layer.
- private FeatureLayer _damageLayer;
-
- // Hold a reference to the selected feature.
- private ArcGISFeature _selectedFeature;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Update geometries (feature service)";
-
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create the map with streets basemap.
- _myMapView.Map = new Map(BasemapStyle.ArcGISStreets);
-
- // Create the feature table, referring to the Damage Assessment feature service.
- ServiceFeatureTable damageTable = new ServiceFeatureTable(new Uri(FeatureServiceUrl));
-
- // Create a feature layer to visualize the features in the table.
- _damageLayer = new FeatureLayer(damageTable);
-
- // Add the layer to the map.
- _myMapView.Map.OperationalLayers.Add(_damageLayer);
-
- // Listen for user taps on the map - on tap, a feature will be selected.
- _myMapView.GeoViewTapped += MapView_Tapped;
-
- // Zoom to the United States.
- _myMapView.SetViewpointCenterAsync(new MapPoint(-10800000, 4500000, SpatialReferences.WebMercator), 3e7);
- }
-
- private void MapView_Tapped(object sender, GeoViewInputEventArgs e)
- {
- // Select the feature if none selected, move the feature otherwise.
- if (_selectedFeature == null)
- {
- // Select the feature.
- TrySelectFeature(e);
- }
- else
- {
- // Move the feature.
- MoveSelectedFeature(e);
- }
- }
-
- private async void MoveSelectedFeature(GeoViewInputEventArgs tapEventDetails)
- {
- try
- {
- // Get the MapPoint from the EventArgs for the tap.
- MapPoint destinationPoint = tapEventDetails.Location;
-
- // Normalize the point - needed when the tapped location is over the international date line.
- destinationPoint = (MapPoint) GeometryEngine.NormalizeCentralMeridian(destinationPoint);
-
- // Load the feature.
- await _selectedFeature.LoadAsync();
-
- // Update the geometry of the selected feature.
- _selectedFeature.Geometry = destinationPoint;
-
- // Apply the edit to the feature table.
- await _selectedFeature.FeatureTable.UpdateFeatureAsync(_selectedFeature);
-
- // Push the update to the service.
- ServiceFeatureTable serviceTable = (ServiceFeatureTable) _selectedFeature.FeatureTable;
- await serviceTable.ApplyEditsAsync();
- ShowMessage("Success!", $"Moved feature {_selectedFeature.Attributes["objectid"]}");
- }
- catch (Exception ex)
- {
- ShowMessage("Error when moving feature", ex.ToString());
- }
- finally
- {
- // Reset the selection.
- _damageLayer.ClearSelection();
- _selectedFeature = null;
- }
- }
-
- private async void TrySelectFeature(GeoViewInputEventArgs tapEventDetails)
- {
- try
- {
- // Perform an identify to determine if a user tapped on a feature.
- IdentifyLayerResult identifyResult = await _myMapView.IdentifyLayerAsync(_damageLayer, tapEventDetails.Position, 10, false);
-
- // Do nothing if there are no results.
- if (!identifyResult.GeoElements.Any())
- {
- return;
- }
-
- // Get the tapped feature.
- _selectedFeature = (ArcGISFeature)identifyResult.GeoElements.First();
-
- // Select the feature.
- _damageLayer.SelectFeature(_selectedFeature);
- }
- catch (Exception ex)
- {
- ShowMessage("Problem selecting feature", ex.ToString());
- }
- }
-
- private void ShowMessage(string title, string message)
- {
- // Display the message to the user.
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.SetMessage(message).SetTitle(title).Show();
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- var layout = new LinearLayout(this) {Orientation = Orientation.Vertical};
-
- // Create the help label.
- TextView helpLabel = new TextView(this);
- helpLabel.Text = "Tap to select a feature. Tap again to move it.";
- helpLabel.TextAlignment = TextAlignment.Center;
- helpLabel.Gravity = GravityFlags.Center;
-
- // Add the help label to the layout.
- layout.AddView(helpLabel);
-
- // Create the map view.
- _myMapView = new MapView(this);
-
- // Add the map view to the layout.
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/UpdateGeometries/UpdateGeometries.jpg b/src/Android/Xamarin.Android/Samples/Data/UpdateGeometries/UpdateGeometries.jpg
deleted file mode 100644
index 093ba9f522..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/UpdateGeometries/UpdateGeometries.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/UpdateGeometries/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/UpdateGeometries/readme.metadata.json
deleted file mode 100644
index b19ead01b1..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/UpdateGeometries/readme.metadata.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "category": "Data",
- "description": "Update a feature's location in an online feature service.",
- "formal_name": "UpdateGeometries",
- "ignore": false,
- "images": [
- "UpdateGeometries.jpg"
- ],
- "keywords": [
- "editing",
- "feature layer",
- "feature table",
- "moving",
- "service",
- "updating"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/updategeometries.htm"
- ],
- "relevant_apis": [
- "Feature",
- "FeatureLayer",
- "ServiceFeatureTable"
- ],
- "snippets": [
- "UpdateGeometries.cs"
- ],
- "title": "Update geometries (feature service)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/ViewPointCloudDataOffline/ViewPointCloudDataOffline.cs b/src/Android/Xamarin.Android/Samples/Data/ViewPointCloudDataOffline/ViewPointCloudDataOffline.cs
deleted file mode 100644
index 44296821ac..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/ViewPointCloudDataOffline/ViewPointCloudDataOffline.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using ArcGISRuntime.Samples.Managers;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using Surface = Esri.ArcGISRuntime.Mapping.Surface;
-
-namespace ArcGISRuntimeXamarin.Samples.ViewPointCloudDataOffline
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "View point cloud data offline",
- category: "Data",
- description: "Display local 3D point cloud data.",
- instructions: "The sample starts with a point cloud layer loaded and draped on top of a scene. Pan and zoom to explore the scene and see the detail of the point cloud layer.",
- tags: new[] { "3D", "lidar", "point cloud" })]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("34da965ca51d4c68aa9b3a38edb29e00")]
- public class ViewPointCloudDataOffline : Activity
- {
- // Hold a reference to the scene view.
- private SceneView _mySceneView;
-
- // Hold the URL to the elevation service.
- private const string ElevationServiceUrl = "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer";
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "View point cloud data offline";
-
- CreateLayout();
- Initialize();
- }
-
- private async void Initialize()
- {
- // Create the scene with basemap.
- _mySceneView.Scene = new Scene(BasemapStyle.ArcGISImageryStandard);
-
- // Create a surface and add the elevation service to it.
- Surface groundSurface = new Surface();
- groundSurface.ElevationSources.Add(new ArcGISTiledElevationSource(new Uri(ElevationServiceUrl)));
-
- // Add the surface to the scene.
- _mySceneView.Scene.BaseSurface = groundSurface;
-
- // Get the path to the local point cloud data.
- string pointCloudPath = DataManager.GetDataFolder("34da965ca51d4c68aa9b3a38edb29e00", "sandiego-north-balboa-pointcloud.slpk");
-
- // Create the point cloud layer.
- PointCloudLayer balboaPointCloud = new PointCloudLayer(new Uri(pointCloudPath));
-
- // Add the point cloud to the scene.
- _mySceneView.Scene.OperationalLayers.Add(balboaPointCloud);
-
- // Wait for the layer to load.
- await balboaPointCloud.LoadAsync();
-
- // Zoom to the extent of the point cloud.
- await _mySceneView.SetViewpointAsync(new Viewpoint(balboaPointCloud.FullExtent));
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- var layout = new LinearLayout(this) {Orientation = Orientation.Vertical};
-
- // Add the map view to the layout.
- _mySceneView = new SceneView(this);
- layout.AddView(_mySceneView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
-
- protected override void OnDestroy()
- {
- base.OnDestroy();
-
- // Remove the sceneview
- (_mySceneView.Parent as ViewGroup).RemoveView(_mySceneView);
- _mySceneView.Dispose();
- _mySceneView = null;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Data/ViewPointCloudDataOffline/ViewPointCloudDataOffline.jpg b/src/Android/Xamarin.Android/Samples/Data/ViewPointCloudDataOffline/ViewPointCloudDataOffline.jpg
deleted file mode 100644
index e4985be8f4..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Data/ViewPointCloudDataOffline/ViewPointCloudDataOffline.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Data/ViewPointCloudDataOffline/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Data/ViewPointCloudDataOffline/readme.metadata.json
deleted file mode 100644
index 4fac483d57..0000000000
--- a/src/Android/Xamarin.Android/Samples/Data/ViewPointCloudDataOffline/readme.metadata.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "category": "Data",
- "description": "Display local 3D point cloud data.",
- "formal_name": "ViewPointCloudDataOffline",
- "ignore": false,
- "images": [
- "ViewPointCloudDataOffline.jpg"
- ],
- "keywords": [
- "3D",
- "lidar",
- "point cloud"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/viewpointclouddataoffline.htm"
- ],
- "relevant_apis": [
- "PointCloudLayer"
- ],
- "snippets": [
- "ViewPointCloudDataOffline.cs"
- ],
- "title": "View point cloud data offline"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/Buffer/Buffer.cs b/src/Android/Xamarin.Android/Samples/Geometry/Buffer/Buffer.cs
deleted file mode 100644
index 21371fc704..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/Buffer/Buffer.cs
+++ /dev/null
@@ -1,191 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using Colors = System.Drawing.Color;
-
-namespace ArcGISRuntime.Samples.Buffer
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Buffer",
- category: "Geometry",
- description: "Create a buffer around a map point and display the results as a `Graphic`",
- instructions: "1. Tap on the map.",
- tags: new[] { "analysis", "buffer", "euclidean", "geodesic", "geometry", "planar" })]
- [ArcGISRuntime.Samples.Shared.Attributes.AndroidLayoutAttribute("Buffer.axml")]
- public class Buffer : Activity
- {
- // Hold a reference to the map view.
- private MapView _myMapView;
-
- // Create an EditText to enter a buffer value (in miles).
- private EditText _bufferDistanceMilesEditText;
-
- // Text view controls to show the buffer colors in the UI.
- private TextView _geodesicSwatch;
- private TextView _planarSwatch;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- Title = "Buffer";
-
- // Create the UI.
- CreateLayout();
-
- // Initialize the map and graphics overlays.
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a map with a topographic basemap and add it to the map view.
- _myMapView.Map = new Map(BasemapStyle.ArcGISTopographic);
-
- // Handle the MapView's GeoViewTapped event to create buffers.
- _myMapView.GeoViewTapped += MyMapView_GeoViewTapped;
-
- // Create a fill symbol for geodesic buffer polygons.
- Colors geodesicBufferColor = Colors.FromArgb(120, 255, 0, 0);
- SimpleLineSymbol geodesicOutlineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, geodesicBufferColor, 2);
- SimpleFillSymbol geodesicBufferFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, geodesicBufferColor, geodesicOutlineSymbol);
-
- // Create a fill symbol for planar buffer polygons.
- Colors planarBufferColor = Colors.FromArgb(120, 0, 0, 255);
- SimpleLineSymbol planarOutlineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, planarBufferColor, 2);
- SimpleFillSymbol planarBufferFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, planarBufferColor, planarOutlineSymbol);
-
- // Create a marker symbol for tap locations.
- SimpleMarkerSymbol tapSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Cross, System.Drawing.Color.White, 14);
-
- // Create a graphics overlay to display geodesic polygons, set its renderer and add it to the map view.
- GraphicsOverlay geodesicPolysOverlay = new GraphicsOverlay
- {
- Id = "GeodesicPolys",
- Renderer = new SimpleRenderer(geodesicBufferFillSymbol)
- };
- _myMapView.GraphicsOverlays.Add(geodesicPolysOverlay);
-
- // Create a graphics overlay to display planar polygons, set its renderer and add it to the map view.
- GraphicsOverlay planarPolysOverlay = new GraphicsOverlay
- {
- Id = "PlanarPolys",
- Renderer = new SimpleRenderer(planarBufferFillSymbol)
- };
- _myMapView.GraphicsOverlays.Add(planarPolysOverlay);
-
- // Create a graphics overlay to display tap locations for buffers, set its renderer and add it to the map view.
- GraphicsOverlay tapLocationsOverlay = new GraphicsOverlay
- {
- Id = "TapPoints",
- Renderer = new SimpleRenderer(tapSymbol)
- };
- _myMapView.GraphicsOverlays.Add(tapLocationsOverlay);
-
- // Show the colors for each type of buffer in the UI.
- ShowBufferSwatches(planarBufferColor, geodesicBufferColor);
- }
-
- private void MyMapView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
- {
- try
- {
- // Get the location tapped by the user (a map point in the WebMercator projected coordinate system).
- MapPoint userTapPoint = e.Location;
-
- // Get the buffer distance (miles) entered in the text box.
- double bufferInMiles = System.Convert.ToDouble(_bufferDistanceMilesEditText.Text);
-
- // Call a helper method to convert the input distance to meters.
- double bufferInMeters = LinearUnits.Miles.ToMeters(bufferInMiles);
-
- // Create a planar buffer graphic around the input location at the specified distance.
- Geometry bufferGeometryPlanar = GeometryEngine.Buffer(userTapPoint, bufferInMeters);
- Graphic planarBufferGraphic = new Graphic(bufferGeometryPlanar);
-
- // Create a geodesic buffer graphic using the same location and distance.
- Geometry bufferGeometryGeodesic = GeometryEngine.BufferGeodetic(userTapPoint, bufferInMeters, LinearUnits.Meters, double.NaN, GeodeticCurveType.Geodesic);
- Graphic geodesicBufferGraphic = new Graphic(bufferGeometryGeodesic);
-
- // Create a graphic for the user tap location.
- Graphic locationGraphic = new Graphic(userTapPoint);
-
- // Get the graphics overlays.
- GraphicsOverlay planarBufferGraphicsOverlay = _myMapView.GraphicsOverlays["PlanarPolys"];
- GraphicsOverlay geodesicBufferGraphicsOverlay = _myMapView.GraphicsOverlays["GeodesicPolys"];
- GraphicsOverlay tapPointGraphicsOverlay = _myMapView.GraphicsOverlays["TapPoints"];
-
- // Add the buffer polygons and tap location graphics to the appropriate graphic overlays.
- planarBufferGraphicsOverlay.Graphics.Add(planarBufferGraphic);
- geodesicBufferGraphicsOverlay.Graphics.Add(geodesicBufferGraphic);
- tapPointGraphicsOverlay.Graphics.Add(locationGraphic);
- }
- catch (System.Exception ex)
- {
- // Display an error message if there is a problem generating the buffer polygon.
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("There was a problem generating buffers.");
- alertBuilder.SetMessage(ex.ToString());
- alertBuilder.Show();
- }
- }
-
- private void ShowBufferSwatches(Colors planarBufferColor, Colors geodesicBufferColor)
- {
- // Create Android.Graphics.Colors to represent the System.Drawing.Colors used for the buffers.
- Android.Graphics.Color planarLabelColor = Android.Graphics.Color.Argb(planarBufferColor.A,
- planarBufferColor.R,
- planarBufferColor.G,
- planarBufferColor.B);
- Android.Graphics.Color geodesicLabelColor = Android.Graphics.Color.Argb(geodesicBufferColor.A,
- geodesicBufferColor.R,
- geodesicBufferColor.G,
- geodesicBufferColor.B);
-
- // Show buffer symbol colors in the UI by setting the appropriate text view fill color.
- _planarSwatch.SetBackgroundColor(planarLabelColor);
- _geodesicSwatch.SetBackgroundColor(geodesicLabelColor);
- }
-
- private void ClearBuffersButton_Click(object sender, System.EventArgs e)
- {
- // Clear the buffer and point graphics.
- foreach (GraphicsOverlay ov in _myMapView.GraphicsOverlays)
- {
- ov.Graphics.Clear();
- }
- }
-
- private void CreateLayout()
- {
- // Load the layout for the sample from the .axml file.
- SetContentView(Resource.Layout.Buffer);
-
- // Reference controls that will be needed to create the buffers.
- _myMapView = FindViewById(Resource.Id.buffer_mapView);
- _bufferDistanceMilesEditText = FindViewById(Resource.Id.buffer_distanceText);
-
- // Add a click event handler for the clear button.
- Button clearBuffersButton = FindViewById(Resource.Id.buffer_clearButton);
- clearBuffersButton.Click += ClearBuffersButton_Click;
-
- // Get the text views used to show the buffer colors.
- _geodesicSwatch = FindViewById(Resource.Id.buffer_geodesicSwatchLabel);
- _planarSwatch = FindViewById(Resource.Id.buffer_planarSwatchLabel);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/Buffer/Buffer.jpg b/src/Android/Xamarin.Android/Samples/Geometry/Buffer/Buffer.jpg
deleted file mode 100644
index e4efd7609d..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/Buffer/Buffer.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/Buffer/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/Buffer/readme.metadata.json
deleted file mode 100644
index 81ee37661c..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/Buffer/readme.metadata.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "category": "Geometry",
- "description": "Create a buffer around a map point and display the results as a `Graphic`",
- "formal_name": "Buffer",
- "ignore": false,
- "images": [
- "Buffer.jpg"
- ],
- "keywords": [
- "analysis",
- "buffer",
- "euclidean",
- "geodesic",
- "geometry",
- "planar"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/buffer.htm"
- ],
- "relevant_apis": [
- "GeometryEngine.Buffer",
- "GeometryEngine.BufferGeodetic",
- "GraphicsOverlay"
- ],
- "snippets": [
- "../../../Resources/layout/Buffer.axml",
- "Buffer.cs"
- ],
- "title": "Buffer"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/BufferList/BufferList.cs b/src/Android/Xamarin.Android/Samples/Geometry/BufferList/BufferList.cs
deleted file mode 100644
index b1f6aae61f..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/BufferList/BufferList.cs
+++ /dev/null
@@ -1,351 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-
-namespace ArcGISRuntime.Samples.BufferList
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Buffer list",
- category: "Geometry",
- description: "Generate multiple individual buffers or a single unioned buffer around multiple points.",
- instructions: "Click/tap on the map to add points. Tap the \"Create Buffer(s)\" button to draw buffer(s) around the points (the size of the buffer is determined by the value entered by the user). Check the check box if you want the result to union (combine) the buffers. Tap the \"Clear\" button to start over. The red dashed envelope shows the area where you can expect reasonable results for planar buffer operations with the North Central Texas State Plane spatial reference.",
- tags: new[] { "analysis", "buffer", "geometry", "planar" })]
- public class BufferList : Activity
- {
- // Hold references to the UI controls.
- private MapView _myMapView;
- private EditText _bufferDistanceMilesEditText;
- private Switch _unionBufferSwitch;
-
- // A polygon that defines the valid area of the spatial reference used.
- private Polygon _spatialReferenceArea;
-
- // A Random object to create RGB color values.
- private Random _random = new Random();
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- Title = "Buffer list";
-
- // Create the UI, setup the control references and execute initialization.
- CreateLayout();
- Initialize();
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create a TextView for instructions.
- TextView instructionsTextView = new TextView(this)
- {
- Text = "Tap on the map to add points. Each point will use the buffer distance entered when it was created. " +
- "The envelope shows the area where you can expect reasonable results for planar buffer operations with the North Central Texas State Plane spatial reference."
- };
- layout.AddView(instructionsTextView);
-
- // Create a horizontal sub layout for the text view and edit text controls.
- LinearLayout subLayout1 = new LinearLayout(this) { Orientation = Orientation.Horizontal };
-
- // Create a TextView for the buffer input label.
- TextView bufferDistanceTextView = new TextView(this)
- {
- Text = "Buffer distance (miles):"
- };
- subLayout1.AddView(bufferDistanceTextView);
-
- // Create a EditText for the buffer distance input.
- _bufferDistanceMilesEditText = new EditText(this)
- {
- Text = "10"
- };
- subLayout1.AddView(_bufferDistanceMilesEditText);
-
- // Add the first row of controls to the main layout.
- layout.AddView(subLayout1);
-
- // Create a horizontal sub layout for the text view and switch controls.
- LinearLayout subLayout2 = new LinearLayout(this) { Orientation = Orientation.Horizontal };
-
- // Create a TextView for the switch label.
- TextView switchLabelTextView = new TextView(this)
- {
- Text = "Union the buffer(s):"
- };
- subLayout2.AddView(switchLabelTextView);
-
- // Create a Switch for the union output option.
- _unionBufferSwitch = new Switch(this)
- {
- Checked = true
- };
- subLayout2.AddView(_unionBufferSwitch);
-
- // Add the second row of controls to the main layout.
- layout.AddView(subLayout2);
-
- // Create a horizontal sub layout for the buffer and clear buttons.
- LinearLayout subLayout3 = new LinearLayout(this) { Orientation = Orientation.Horizontal };
-
- // Create the button to create the buffers.
- Button bufferButton = new Button(this)
- {
- Text = "Make buffers"
- };
- bufferButton.Click += BufferButton_Click;
- subLayout3.AddView(bufferButton);
-
- // Create a button to clear the graphics from the display.
- Button resetButton = new Button(this)
- {
- Text = "Clear"
- };
- resetButton.Click += ClearButton_Click;
- subLayout3.AddView(resetButton);
-
- // Add the third row of controls to the main layout.
- layout.AddView(subLayout3);
-
- // Add the map view to the layout.
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
-
- private void Initialize()
- {
- // Create a spatial reference that's suitable for creating planar buffers in north central Texas (State Plane).
- SpatialReference statePlaneNorthCentralTexas = SpatialReference.Create(32038);
-
- // Define a polygon that represents the valid area of use for the spatial reference.
- // This information is available at https://developers.arcgis.com/net/latest/wpf/guide/pdf/projected_coordinate_systems_rt100_3_0.pdf
- List spatialReferenceExtentCoords = new List
- {
- new MapPoint(-103.070, 31.720, SpatialReferences.Wgs84),
- new MapPoint(-103.070, 34.580, SpatialReferences.Wgs84),
- new MapPoint(-94.000, 34.580, SpatialReferences.Wgs84),
- new MapPoint(-94.00, 31.720, SpatialReferences.Wgs84)
- };
- _spatialReferenceArea = new Polygon(spatialReferenceExtentCoords);
- _spatialReferenceArea = GeometryEngine.Project(_spatialReferenceArea, statePlaneNorthCentralTexas) as Polygon;
-
- // Create a map that uses the North Central Texas state plane spatial reference.
- Map bufferMap = new Map(statePlaneNorthCentralTexas);
-
- // Add some base layers (counties, cities, and highways).
- Uri usaLayerSource = new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer");
- ArcGISMapImageLayer usaLayer = new ArcGISMapImageLayer(usaLayerSource);
- bufferMap.Basemap.BaseLayers.Add(usaLayer);
-
- // Use a new EnvelopeBuilder to expand the spatial reference extent 120%.
- EnvelopeBuilder envBuilder = new EnvelopeBuilder(_spatialReferenceArea.Extent);
- envBuilder.Expand(1.2);
-
- // Set the map's initial extent to the expanded envelope.
- Envelope startingEnvelope = envBuilder.ToGeometry();
- bufferMap.InitialViewpoint = new Viewpoint(startingEnvelope);
-
- // Assign the map to the MapView.
- _myMapView.Map = bufferMap;
-
- // Create a graphics overlay to show the buffer polygon graphics.
- GraphicsOverlay bufferGraphicsOverlay = new GraphicsOverlay
- {
- // Give the overlay an ID so it can be found later.
- Id = "buffers"
- };
-
- // Create a graphic to show the spatial reference's valid extent (envelope) with a dashed red line.
- SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Dash, Color.Red, 5);
- Graphic spatialReferenceExtentGraphic = new Graphic(_spatialReferenceArea, lineSymbol);
-
- // Add the graphic to a new overlay.
- GraphicsOverlay spatialReferenceGraphicsOverlay = new GraphicsOverlay();
- spatialReferenceGraphicsOverlay.Graphics.Add(spatialReferenceExtentGraphic);
-
- // Add the graphics overlays to the MapView.
- _myMapView.GraphicsOverlays.Add(bufferGraphicsOverlay);
- _myMapView.GraphicsOverlays.Add(spatialReferenceGraphicsOverlay);
-
- // Wire up the MapView's GeoViewTapped event handler.
- _myMapView.GeoViewTapped += MyMapView_GeoViewTapped;
- }
-
- private void MyMapView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
- {
- try
- {
- // Get the input map point (in the map's coordinate system, State Plane for North Central Texas).
- MapPoint tapMapPoint = e.Location;
-
- // Check if the point coordinates are within the spatial reference envelope.
- bool withinValidExent = GeometryEngine.Contains(_spatialReferenceArea, tapMapPoint);
-
- // If the input point is not within the valid extent for the spatial reference, warn the user and return.
- if (!withinValidExent)
- {
- // Display a message to warn the user.
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Out of bounds");
- alertBuilder.SetMessage("Location is not valid to buffer using the defined spatial reference.");
- alertBuilder.Show();
-
- return;
- }
-
- // Get the buffer radius (in miles) from the text box.
- double bufferDistanceMiles = Convert.ToDouble(_bufferDistanceMilesEditText.Text);
-
- // Use a helper method to get the buffer distance in feet (unit that's used by the spatial reference).
- double bufferDistanceFeet = LinearUnits.Miles.ConvertTo(LinearUnits.Feet, bufferDistanceMiles);
-
- // Create a simple marker symbol (red circle) to display where the user tapped/clicked on the map.
- SimpleMarkerSymbol tapSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, Color.Red, 10);
-
- // Create a new graphic to show the tap location.
- Graphic tapGraphic = new Graphic(tapMapPoint, tapSymbol)
- {
- // Specify a z-index value on the point graphic to make sure it draws on top of the buffer polygons.
- ZIndex = 2
- };
-
- // Store the specified buffer distance as an attribute with the graphic.
- tapGraphic.Attributes["distance"] = bufferDistanceFeet;
-
- // Add the tap point graphic to the buffer graphics overlay.
- _myMapView.GraphicsOverlays["buffers"].Graphics.Add(tapGraphic);
- }
- catch (Exception ex)
- {
- // Display an error message.
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Error creating buffer point");
- alertBuilder.SetMessage(ex.Message);
- alertBuilder.Show();
- }
- }
-
- private void BufferButton_Click(object sender, EventArgs e)
- {
- try
- {
- // Call a function to delete any existing buffer polygons so they can be recreated.
- ClearBufferPolygons();
-
- // Check if the user wants to create a single unioned buffer or independent buffers around each map point.
- bool areBuffersUnioned = _unionBufferSwitch.Checked;
-
- // Iterate all point graphics and create a list of map points and buffer distances for each.
- List bufferMapPoints = new List();
- List bufferDistances = new List();
- foreach (Graphic bufferGraphic in _myMapView.GraphicsOverlays["buffers"].Graphics)
- {
- // Only use point graphics.
- if (bufferGraphic.Geometry.GeometryType == GeometryType.Point)
- {
- // Get the geometry (map point) from the graphic.
- MapPoint bufferLocation = bufferGraphic.Geometry as MapPoint;
-
- // Read the "distance" attribute to get the buffer distance entered when the point was tapped.
- double bufferDistanceFeet = (double)bufferGraphic.Attributes["distance"];
-
- // Add the point and the corresponding distance to the lists.
- bufferMapPoints.Add(bufferLocation);
- bufferDistances.Add(bufferDistanceFeet);
- }
- }
-
- // Call GeometryEngine.Buffer with a list of map points and a list of buffered distances.
- IEnumerable bufferPolygons = GeometryEngine.Buffer(bufferMapPoints, bufferDistances, areBuffersUnioned);
-
- // Create the outline for the buffered polygons.
- SimpleLineSymbol bufferPolygonOutlineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.DarkBlue, 3);
-
- // Loop through all the geometries in the buffer results. There will be one buffered polygon if
- // the result geometries were unioned. Otherwise, there will be one buffer per input geometry.
- foreach (Geometry poly in bufferPolygons)
- {
- // Create a random color to use for buffer polygon fill.
- Color bufferPolygonColor = GetRandomColor();
-
- // Create simple fill symbol for the buffered polygon using the fill color and outline.
- SimpleFillSymbol bufferPolygonFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, bufferPolygonColor, bufferPolygonOutlineSymbol);
-
- // Create a new graphic for the buffered polygon using the fill symbol.
- Graphic bufferPolygonGraphic = new Graphic(poly, bufferPolygonFillSymbol)
- {
- // Specify a z-index of 0 to ensure the polygons draw below the tap points.
- ZIndex = 0
- };
-
- // Add the buffered polygon graphic to the graphics overlay.
- _myMapView.GraphicsOverlays[0].Graphics.Add(bufferPolygonGraphic);
- }
- }
- catch (Exception ex)
- {
- // Display an error message if there is a problem generating the buffers.
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Unable to create buffer polygons");
- alertBuilder.SetMessage(ex.Message);
- alertBuilder.Show();
- }
- }
-
- private Color GetRandomColor()
- {
- // Get a byte array with three random values.
- var colorBytes = new byte[3];
- _random.NextBytes(colorBytes);
-
- // Use the random bytes to define red, green, and blue values for a new color.
- return Color.FromArgb(155, colorBytes[0], colorBytes[1], colorBytes[2]);
- }
-
- private void ClearButton_Click(object sender, EventArgs e)
- {
- // Clear all graphics (tap points and buffer polygons).
- _myMapView.GraphicsOverlays["buffers"].Graphics.Clear();
- }
-
-
- private void ClearBufferPolygons()
- {
- // Get the collection of graphics in the graphics overlay (points and buffer polygons).
- GraphicCollection bufferGraphics = _myMapView.GraphicsOverlays["buffers"].Graphics;
-
- // Loop (backwards) through all graphics.
- for (int i = bufferGraphics.Count - 1; i >= 0; i--)
- {
- // If the graphic is a polygon, remove it from the overlay.
- Graphic thisGraphic = bufferGraphics[i];
- if (thisGraphic.Geometry.GeometryType == GeometryType.Polygon)
- {
- bufferGraphics.RemoveAt(i);
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/BufferList/BufferList.jpg b/src/Android/Xamarin.Android/Samples/Geometry/BufferList/BufferList.jpg
deleted file mode 100644
index bf345a820f..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/BufferList/BufferList.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/BufferList/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/BufferList/readme.metadata.json
deleted file mode 100644
index 987acd6742..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/BufferList/readme.metadata.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "category": "Geometry",
- "description": "Generate multiple individual buffers or a single unioned buffer around multiple points.",
- "formal_name": "BufferList",
- "ignore": false,
- "images": [
- "BufferList.jpg"
- ],
- "keywords": [
- "analysis",
- "buffer",
- "geometry",
- "planar"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/bufferlist.htm"
- ],
- "relevant_apis": [
- "Geometry",
- "GeometryEngine.Buffer",
- "SpatialReference"
- ],
- "snippets": [
- "BufferList.cs"
- ],
- "title": "Buffer list"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ClipGeometry/ClipGeometry.cs b/src/Android/Xamarin.Android/Samples/Geometry/ClipGeometry/ClipGeometry.cs
deleted file mode 100644
index 772f7fbbd1..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/ClipGeometry/ClipGeometry.cs
+++ /dev/null
@@ -1,250 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-
-namespace ArcGISRuntime.Samples.ClipGeometry
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Clip geometry",
- category: "Geometry",
- description: "Clip a geometry with another geometry.",
- instructions: "Tap the \"Clip\" button to clip the blue graphic with the red dashed envelopes.",
- tags: new[] { "analysis", "clip", "geometry" })]
- public class ClipGeometry : Activity
- {
- // Hold a reference to the map view.
- private MapView _myMapView;
-
- // Graphics overlay to display input geometries for the clip operation.
- private GraphicsOverlay _inputGeometriesGraphicsOverlay;
-
- // Graphic that represents the 1st parameter of the GeometryEngine.Clip operation - it follows the boundary of Colorado.
- private Graphic _coloradoGraphic;
-
- // One of the graphics that represents the 2nd parameter of the GeometryEngine.Clip operation - it will be an envelope
- // that falls completely outside the boundary of Colorado.
- private Graphic _outsideGraphic;
-
- // One of the graphics that represents the 2nd parameter of the GeometryEngine.Clip operation - it will be an envelope
- // that is completely contained within the boundary of Colorado.
- private Graphic _containedGraphic;
-
- // One of the graphics that represents the 2nd parameter of the GeometryEngine.Clip operation - it will be an envelope
- // that is intersects the boundary of Colorado.
- private Graphic _intersectingGraphic;
-
- // Graphics overlay to display the resulting geometries from the three GeometryEngine.Clip operations.
- private GraphicsOverlay _clipAreasGraphicsOverlay;
-
- // Create a Button to clip polygons.
- private Button _clipButton;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- Title = "Clip geometry";
-
- // Create the UI, setup the control references and execute initialization.
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a new map using the WebMercator spatial reference.
- Map newMap = new Map(SpatialReferences.WebMercator)
- {
- // Set the basemap of the map to be a topographic layer.
- Basemap = new Basemap(BasemapStyle.ArcGISTopographic)
- };
-
- // Create a graphics overlay to hold the input geometries for the clip operation.
- _inputGeometriesGraphicsOverlay = new GraphicsOverlay();
-
- // Add the input geometries graphics overlay to the MapView.
- _myMapView.GraphicsOverlays.Add(_inputGeometriesGraphicsOverlay);
-
- // Create a graphics overlay to hold the resulting geometries from the three GeometryEngine.Clip operations.
- _clipAreasGraphicsOverlay = new GraphicsOverlay();
-
- // Add the resulting geometries graphics overlay to the MapView.
- _myMapView.GraphicsOverlays.Add(_clipAreasGraphicsOverlay);
-
- // Create a simple line symbol for the 1st parameter of the GeometryEngine.Clip operation - it follows the
- // boundary of Colorado.
- SimpleLineSymbol coloradoSimpleLineSymbol = new SimpleLineSymbol(
- SimpleLineSymbolStyle.Solid, System.Drawing.Color.Blue, 4);
-
- // Create the color that will be used as the fill for the Colorado graphic. It will be a semi-transparent, blue color.
- System.Drawing.Color coloradoFillColor = System.Drawing.Color.FromArgb(34, 0, 0, 255);
-
- // Create the simple fill symbol for the Colorado graphic - comprised of a fill style, fill color and outline.
- SimpleFillSymbol coloradoSimpleFillSymbol = new SimpleFillSymbol(
- SimpleFillSymbolStyle.Solid, coloradoFillColor, coloradoSimpleLineSymbol);
-
- // Create the geometry of the Colorado graphic.
- Envelope colorado = new Envelope(
- new MapPoint(-11362327.128340, 5012861.290274, SpatialReferences.WebMercator),
- new MapPoint(-12138232.018408, 4441198.773776, SpatialReferences.WebMercator));
-
- // Create the graphic for Colorado - comprised of a polygon shape and fill symbol.
- _coloradoGraphic = new Graphic(colorado, coloradoSimpleFillSymbol);
-
- // Add the Colorado graphic to the input geometries graphics overlay collection.
- _inputGeometriesGraphicsOverlay.Graphics.Add(_coloradoGraphic);
-
- // Create a simple line symbol for the three different clip geometries.
- SimpleLineSymbol clipGeomtriesSimpleLineSymbol = new SimpleLineSymbol(
- SimpleLineSymbolStyle.Dot, System.Drawing.Color.Red, 5);
-
- // Create an envelope outside Colorado.
- Envelope outsideEnvelope = new Envelope(
- new MapPoint(-11858344.321294, 5147942.225174, SpatialReferences.WebMercator),
- new MapPoint(-12201990.219681, 5297071.577304, SpatialReferences.WebMercator));
-
- // Create the graphic for an envelope outside Colorado - comprised of a polyline shape and line symbol.
- _outsideGraphic = new Graphic(outsideEnvelope, clipGeomtriesSimpleLineSymbol);
-
- // Add the envelope outside Colorado graphic to the graphics overlay collection.
- _inputGeometriesGraphicsOverlay.Graphics.Add(_outsideGraphic);
-
- // Create an envelope intersecting Colorado.
- Envelope intersectingEnvelope = new Envelope(
- new MapPoint(-11962086.479298, 4566553.881363, SpatialReferences.WebMercator),
- new MapPoint(-12260345.183558, 4332053.378376, SpatialReferences.WebMercator));
-
- // Create the graphic for an envelope intersecting Colorado - comprised of a polyline shape and line symbol.
- _intersectingGraphic = new Graphic(intersectingEnvelope, clipGeomtriesSimpleLineSymbol);
-
- // Add the envelope intersecting Colorado graphic to the graphics overlay collection.
- _inputGeometriesGraphicsOverlay.Graphics.Add(_intersectingGraphic);
-
- // Create a envelope inside Colorado.
- Envelope containedEnvelope = new Envelope(
- new MapPoint(-11655182.595204, 4741618.772994, SpatialReferences.WebMercator),
- new MapPoint(-11431488.567009, 4593570.068343, SpatialReferences.WebMercator));
-
- // Create the graphic for an envelope inside Colorado - comprised of a polyline shape and line symbol.
- _containedGraphic = new Graphic(containedEnvelope, clipGeomtriesSimpleLineSymbol);
-
- // Add the envelope inside Colorado graphic to the graphics overlay collection.
- _inputGeometriesGraphicsOverlay.Graphics.Add(_containedGraphic);
-
- // Get the extent of all of the graphics in the graphics overlay with a little padding to used as the initial zoom extent of the map.
- Geometry visibleExtent = GetExtentOfGraphicsOverlay(_inputGeometriesGraphicsOverlay, 1.3, SpatialReferences.WebMercator);
-
- // Set the initial visual extent of the map view to the extent of the graphics overlay.
- newMap.InitialViewpoint = new Viewpoint(visibleExtent);
-
- // Assign the map to the MapView.
- _myMapView.Map = newMap;
- }
-
- private Geometry GetExtentOfGraphicsOverlay(GraphicsOverlay inputGraphicsOverlay, double expansionFactor, SpatialReference spatialReferenceType)
- {
- // Get all of the graphics contained in the graphics overlay.
- GraphicCollection inputGraphicCollection = inputGraphicsOverlay.Graphics;
-
- // Create a new envelope builder using the same spatial reference as the graphics.
- EnvelopeBuilder unionEnvelopeBuilder = new EnvelopeBuilder(spatialReferenceType);
-
- // Loop through each graphic in the graphic collection.
- foreach (Graphic oneGraphic in inputGraphicCollection)
- {
- // Union the extent of each graphic in the envelope builder.
- unionEnvelopeBuilder.UnionOf(oneGraphic.Geometry.Extent);
- }
-
- // Expand the envelope builder by the expansion factor.
- unionEnvelopeBuilder.Expand(expansionFactor);
-
- // Return the unioned extent plus the expansion factor.
- return unionEnvelopeBuilder.Extent;
- }
-
- private void ClipButton_Click(object sender, EventArgs e)
- {
- try
- {
- // Remove the Colorado graphic from the input geometries graphics overlay collection. That way it will be easier
- // to see the clip versions of the GeometryEngine.Clip operation.
- _inputGeometriesGraphicsOverlay.Graphics.Remove(_coloradoGraphic);
-
- // Loop through each graphic in the input geometries for the clip operation.
- foreach (Graphic oneGraphic in _inputGeometriesGraphicsOverlay.Graphics)
- {
- // Perform the clip operation. The first parameter of the clip operation will always be the Colorado graphic.
- // The second parameter of the clip operation will be one of the 3 different clip geometries (_outsideGraphic,
- // _containedGraphic, or _intersectingGraphic).
- Geometry myGeometry = GeometryEngine.Clip(_coloradoGraphic.Geometry, (Envelope)oneGraphic.Geometry);
-
- // Only work on returned geometries that are not null.
- if (myGeometry != null)
- {
- // Create the graphic as a result of the clip operation using the same symbology that was defined for
- // the _coloradoGraphic defined in the Initialize() method previously.
- Graphic clippedGraphic = new Graphic(myGeometry, _coloradoGraphic.Symbol);
-
- // Add the clipped graphic to the clip areas graphics overlay collection.
- _clipAreasGraphicsOverlay.Graphics.Add(clippedGraphic);
- }
- }
-
- // Disable the button after has been used.
- _clipButton.Enabled = false;
- }
- catch (System.Exception ex)
- {
- // Display an error message if there is a problem generating clip operation.
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("There was a problem clipping the geometery.");
- alertBuilder.SetMessage(ex.ToString());
- alertBuilder.Show();
- }
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create a TextView for instructions.
- TextView sampleInstructionsTextView = new TextView(this)
- {
- Text = "Tap 'Clip' to clip the blue graphic with red envelopes."
- };
- layout.AddView(sampleInstructionsTextView);
-
- // Create button to clip the polygons.
- _clipButton = new Button(this)
- {
- Text = "Clip"
- };
- _clipButton.Click += ClipButton_Click;
- layout.AddView(_clipButton);
-
- // Add the map view to the layout.
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ClipGeometry/ClipGeometry.jpg b/src/Android/Xamarin.Android/Samples/Geometry/ClipGeometry/ClipGeometry.jpg
deleted file mode 100644
index 9bd5c968f7..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/ClipGeometry/ClipGeometry.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ClipGeometry/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/ClipGeometry/readme.metadata.json
deleted file mode 100644
index e9f4979825..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/ClipGeometry/readme.metadata.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "category": "Geometry",
- "description": "Clip a geometry with another geometry.",
- "formal_name": "ClipGeometry",
- "ignore": false,
- "images": [
- "ClipGeometry.jpg"
- ],
- "keywords": [
- "analysis",
- "clip",
- "geometry"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/clipgeometry.htm"
- ],
- "relevant_apis": [
- "Envelope",
- "Geometry",
- "GeometryEngine.Clip",
- "Graphic",
- "GraphicsOverlay"
- ],
- "snippets": [
- "ClipGeometry.cs"
- ],
- "title": "Clip geometry"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ConvexHull/ConvexHull.cs b/src/Android/Xamarin.Android/Samples/Geometry/ConvexHull/ConvexHull.cs
deleted file mode 100644
index 8991d64aad..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/ConvexHull/ConvexHull.cs
+++ /dev/null
@@ -1,207 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-
-namespace ArcGISRuntime.Samples.ConvexHull
-{
- [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Convex hull",
- category: "Geometry",
- description: "Create a convex hull for a given set of points. The convex hull is a polygon with shortest perimeter that encloses a set of points. As a visual analogy, consider a set of points as nails in a board. The convex hull of the points would be like a rubber band stretched around the outermost nails.",
- instructions: "Tap on the map to add points. Tap the \"Create Convex Hull\" button to generate the convex hull of those points. Tap the \"Reset\" button to start over.",
- tags: new[] { "convex hull", "geometry", "spatial analysis" })]
- public class ConvexHull : Activity
- {
- // Hold a reference to the map view.
- private MapView _myMapView;
-
- // Graphics overlay to display the hull.
- private GraphicsOverlay _graphicsOverlay;
-
- // List of geometry values (MapPoints in this case) that will be used by the GeometryEngine.ConvexHull operation.
- private PointCollection _inputPointCollection = new PointCollection(SpatialReferences.WebMercator);
-
- // Create a Button to create a convex hull.
- private Button _convexHullButton;
-
- // Create a Button to create a convex hull.
- private Button _resetButton;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- Title = "Convex hull";
-
- // Create the UI, setup the control references and execute initialization.
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a map with a topographic basemap.
- Map theMap = new Map(BasemapStyle.ArcGISTopographic);
-
- // Assign the map to the MapView.
- _myMapView.Map = theMap;
-
- // Create an overlay to hold the lines of the hull.
- _graphicsOverlay = new GraphicsOverlay();
-
- // Add the created graphics overlay to the MapView.
- _myMapView.GraphicsOverlays.Add(_graphicsOverlay);
-
- // Wire up the MapView's GeoViewTapped event handler.
- _myMapView.GeoViewTapped += MyMapView_GeoViewTapped;
- }
-
- private void MyMapView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
- {
- try
- {
- // Normalize the tapped point.
- var centralizedPoint = (MapPoint)GeometryEngine.NormalizeCentralMeridian(e.Location);
-
- // Add the map point to the list that will be used by the GeometryEngine.ConvexHull operation.
- _inputPointCollection.Add(centralizedPoint);
-
- // Check if there are at least three points.
- if (_inputPointCollection.Count > 2)
- {
- // Enable the button for creating hulls.
- _convexHullButton.Enabled = true;
- }
-
- // Create a simple marker symbol to display where the user tapped/clicked on the map. The marker symbol
- // will be a solid, red circle.
- SimpleMarkerSymbol userTappedSimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, System.Drawing.Color.Red, 10);
-
- // Create a new graphic for the spot where the user clicked on the map using the simple marker symbol.
- Graphic userTappedGraphic = new Graphic(e.Location, new Dictionary() { { "Type", "Point" } }, userTappedSimpleMarkerSymbol) { ZIndex = 0 };
-
- // Set the Z index for the user tapped graphic so that it appears above the convex hull graphic(s) added later.
- userTappedGraphic.ZIndex = 1;
-
- // Add the user tapped/clicked map point graphic to the graphic overlay.
- _graphicsOverlay.Graphics.Add(userTappedGraphic);
- }
- catch (System.Exception ex)
- {
- // Display an error message if there is a problem adding user tapped graphics.
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Can't add user tapped graphic");
- alertBuilder.SetMessage(ex.ToString());
- alertBuilder.Show();
- }
- }
-
- private void ConvexHullButton_Click(object sender, EventArgs e)
- {
- try
- {
- // Create a multi-point geometry from the user tapped input map points.
- Multipoint inputMultipoint = new Multipoint(_inputPointCollection);
-
- // Get the returned result from the convex hull operation.
- Geometry convexHullGeometry = GeometryEngine.ConvexHull(inputMultipoint);
-
- // Create a simple line symbol for the outline of the convex hull graphic(s).
- SimpleLineSymbol convexHullSimpleLineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.Blue, 4);
-
- // Create the simple fill symbol for the convex hull graphic(s) - comprised of a fill style, fill
- // color and outline. It will be a hollow (i.e.. see-through) polygon graphic with a thick red outline.
- SimpleFillSymbol convexHullSimpleFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Null, System.Drawing.Color.Red,
- convexHullSimpleLineSymbol);
-
- // Create the graphic for the convex hull - comprised of a polygon shape and fill symbol.
- Graphic convexHullGraphic = new Graphic(convexHullGeometry, new Dictionary() { { "Type", "Hull" } }, convexHullSimpleFillSymbol) { ZIndex = 1 };
-
- // Remove any existing convex hull graphics from the overlay.
- foreach (Graphic g in new List(_graphicsOverlay.Graphics))
- {
- if ((string)g.Attributes["Type"] == "Hull")
- {
- _graphicsOverlay.Graphics.Remove(g);
- }
- }
- // Add the convex hull graphic to the graphics overlay.
- _graphicsOverlay.Graphics.Add(convexHullGraphic);
-
- // Disable the button after has been used.
- _convexHullButton.Enabled = false;
- }
- catch (System.Exception ex)
- {
- // Display an error message if there is a problem generating convex hull operation.
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("There was a problem generating the convex hull.");
- alertBuilder.SetMessage(ex.ToString());
- alertBuilder.Show();
- }
- }
-
- private void ResetButton_Click(object sender, EventArgs e)
- {
- // Clear the existing points and graphics.
- _inputPointCollection.Clear();
- _graphicsOverlay.Graphics.Clear();
-
- // Disable the convex hull button.
- _convexHullButton.Enabled = false;
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create a TextView for instructions.
- TextView sampleInstructionsTextView = new TextView(this)
- {
- Text = "Tap on the map to create three or more points, then tap the 'Make Convex Hull' button."
- };
- layout.AddView(sampleInstructionsTextView);
-
- // Create a Button to create the convex hull.
- _convexHullButton = new Button(this)
- {
- Text = "Make Convex Hull"
- };
- _convexHullButton.Click += ConvexHullButton_Click;
- _convexHullButton.Enabled = false;
- layout.AddView(_convexHullButton);
-
- // Create a Button to reset the convex hull.
- _resetButton = new Button(this)
- {
- Text = "Reset"
- };
- _resetButton.Click += ResetButton_Click;
- layout.AddView(_resetButton);
-
- // Add the map view to the layout.
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ConvexHull/ConvexHull.jpg b/src/Android/Xamarin.Android/Samples/Geometry/ConvexHull/ConvexHull.jpg
deleted file mode 100644
index a251b519d0..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/ConvexHull/ConvexHull.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ConvexHull/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/ConvexHull/readme.metadata.json
deleted file mode 100644
index 2eca475d00..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/ConvexHull/readme.metadata.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "category": "Geometry",
- "description": "Create a convex hull for a given set of points. The convex hull is a polygon with shortest perimeter that encloses a set of points. As a visual analogy, consider a set of points as nails in a board. The convex hull of the points would be like a rubber band stretched around the outermost nails.",
- "formal_name": "ConvexHull",
- "ignore": false,
- "images": [
- "ConvexHull.jpg"
- ],
- "keywords": [
- "convex hull",
- "geometry",
- "spatial analysis"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/convexhull.htm"
- ],
- "relevant_apis": [
- "Geometry",
- "GeometryEngine"
- ],
- "snippets": [
- "ConvexHull.cs"
- ],
- "title": "Convex hull"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ConvexHullList/ConvexHullList.cs b/src/Android/Xamarin.Android/Samples/Geometry/ConvexHullList/ConvexHullList.cs
deleted file mode 100644
index 0b23b15e3a..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/ConvexHullList/ConvexHullList.cs
+++ /dev/null
@@ -1,286 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-
-namespace ArcGISRuntime.Samples.ConvexHullList
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Convex hull list",
- category: "Geometry",
- description: "Generate convex hull polygon(s) from multiple input geometries.",
- instructions: "Tap the 'Create Convex Hull' button to create convex hull(s) from the polygon graphics. If the 'Union' checkbox is checked, the resulting output will be one polygon being the convex hull for the two input polygons. If the 'Union' checkbox is un-checked, the resulting output will have two convex hull polygons - one for each of the two input polygons. Tap the 'Reset' button to start over.",
- tags: new[] { "analysis", "geometry", "outline", "perimeter", "union" })]
- public class ConvexHullList : Activity
- {
- // Hold a reference to the map view.
- private MapView _myMapView;
-
- // Graphics overlay to display the graphics.
- private GraphicsOverlay _graphicsOverlay;
-
- // Graphic that represents polygon1.
- private Graphic _polygonGraphic1;
-
- // Graphic that represents polygon2.
- private Graphic _polygonGraphic2;
-
- // Create a Switch to choose whether to union the resulting convex hull(s).
- private Switch _convexHullListSwitch;
-
- // Create a Button to create convex hull(s).
- private Button _convexHullListButton;
-
- // Create a Button to create convex hull(s).
- private Button _resetButton;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- Title = "Convex hull list";
-
- // Create the UI, setup the control references and execute initialization.
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a map with a topographic basemap.
- Map newMap = new Map(BasemapStyle.ArcGISTopographic);
-
- // Assign the map to the MapView.
- _myMapView.Map = newMap;
-
- // Create a graphics overlay to hold the various graphics.
- _graphicsOverlay = new GraphicsOverlay();
-
- // Add the created graphics overlay to the MapView.
- _myMapView.GraphicsOverlays.Add(_graphicsOverlay);
-
- // Create a simple line symbol for the outline for the two input polygon graphics.
- SimpleLineSymbol polygonsSimpleLineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid,
- System.Drawing.Color.Blue, 4);
-
- // Create the color that will be used for the fill of the two input polygon graphics. It will be a
- // semi -transparent, blue color.
- System.Drawing.Color polygonsFillColor = System.Drawing.Color.FromArgb(34, 0, 0, 255);
-
- // Create the simple fill symbol for the two input polygon graphics - comprised of a fill style, fill
- // color and outline.
- SimpleFillSymbol polygonsSimpleFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, polygonsFillColor,
- polygonsSimpleLineSymbol);
-
- // Create the graphic for polygon1 - comprised of a polygon shape and fill symbol.
- _polygonGraphic1 = new Graphic(CreatePolygon1(), polygonsSimpleFillSymbol)
- {
-
- // Set the Z index for the polygon1 graphic so that it appears above the convex hull graphic(s) added later.
- ZIndex = 1
- };
-
- // Add the polygon1 graphic to the graphics overlay collection.
- _graphicsOverlay.Graphics.Add(_polygonGraphic1);
-
- // Create the graphic for polygon2 - comprised of a polygon shape and fill symbol.
- _polygonGraphic2 = new Graphic(CreatePolygon2(), polygonsSimpleFillSymbol)
- {
-
- // Set the Z index for the polygon2 graphic so that it appears above the convex hull graphic(s) added later.
- ZIndex = 1
- };
-
- // Add the polygon2 graphic to the graphics overlay collection.
- _graphicsOverlay.Graphics.Add(_polygonGraphic2);
- }
-
- private Polygon CreatePolygon1()
- {
- // Create a point collection that represents polygon1. Use the same spatial reference as the underlying base map.
- PointCollection pointCollection1 = new PointCollection(SpatialReferences.WebMercator)
- {
- // Add all of the polygon1 boundary map points to the point collection.
- new MapPoint(-4983189.15470412, 8679428.55774286),
- new MapPoint(-5222621.66664186, 5147799.00666126),
- new MapPoint(-13483043.3284937, 4728792.11077023),
- new MapPoint(-13273539.8805482, 2244679.79941622),
- new MapPoint(-5372266.98660294, 2035176.3514707),
- new MapPoint(-5432125.11458738, -4100281.76693377),
- new MapPoint(-2469147.7793579, -4160139.89491821),
- new MapPoint(-1900495.56350578, 2035176.3514707),
- new MapPoint(2768438.41928007, 1975318.22348627),
- new MapPoint(2409289.65137346, 5477018.71057565),
- new MapPoint(-2409289.65137346, 5387231.518599),
- new MapPoint(-2469147.7793579, 8709357.62173508)
- };
- // Create a polyline geometry from the point collection.
- Polygon polygon1 = new Polygon(pointCollection1);
-
- // Return the polygon.
- return polygon1;
- }
-
- private Polygon CreatePolygon2()
- {
- // Create a point collection that represents polygon2. Use the same spatial reference as the underlying base map.
- PointCollection pointCollection2 = new PointCollection(SpatialReferences.WebMercator)
- {
- // Add all of the polygon2 boundary map points to the point collection.
- new MapPoint(5993520.19456882, -1063938.49607736),
- new MapPoint(3085421.63862418, -1383120.04490055),
- new MapPoint(3794713.96934239, -2979027.78901651),
- new MapPoint(6880135.60796657, -4078430.90162972),
- new MapPoint(7092923.30718203, -2837169.32287287),
- new MapPoint(8617901.81822617, -2092412.37561875),
- new MapPoint(6986529.4575743, 354646.16535905),
- new MapPoint(5319692.48038653, 1205796.96222089)
- };
- // Create a polyline geometry from the point collection.
- Polygon polygon2 = new Polygon(pointCollection2);
-
- // Return the polygon.
- return polygon2;
- }
-
- private void OnMakeUnionBufferClicked(object sender, EventArgs e)
- {
- try
- {
- // Get the boolean value whether to create a single convex hull (true) or independent convex hulls (false).
- bool unionBool = (bool)_convexHullListSwitch.Checked;
-
- // Add the geometries of the two polygon graphics to a list of geometries. It will be used as the 1st
- // input parameter of the GeometryEngine.ConvexHull function.
- List inputListOfGeomtries = new List
- {
- _polygonGraphic1.Geometry,
- _polygonGraphic2.Geometry
- };
-
- // Get the returned result from the convex hull operation. When unionBool = true there will be one returned
- // polygon, when unionBool = false there will be one convex hull returned per input geometry.
- IEnumerable convexHullGeometries = GeometryEngine.ConvexHull(inputListOfGeomtries, unionBool);
-
- // Loop through the returned geometries.
- foreach (Geometry oneGeometry in convexHullGeometries)
- {
- // Create a simple line symbol for the outline of the convex hull graphic(s).
- SimpleLineSymbol convexHullSimpleLineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid,
- System.Drawing.Color.Red, 10);
-
- // Create the simple fill symbol for the convex hull graphic(s) - comprised of a fill style, fill
- // color and outline. It will be a hollow (i.e.. see-through) polygon graphic with a thick red outline.
- SimpleFillSymbol convexHullSimpleFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Null,
- System.Drawing.Color.Red, convexHullSimpleLineSymbol);
-
- // Create the graphic for the convex hull(s) - comprised of a polygon shape and fill symbol.
- Graphic convexHullGraphic = new Graphic(oneGeometry, convexHullSimpleFillSymbol)
- {
-
- // Set the Z index for the convex hull graphic(s) so that they appear below the initial input graphics
- // added earlier (polygon1 and polygon2).
- ZIndex = 0
- };
-
- // Add the convex hull graphic to the graphics overlay collection.
- _graphicsOverlay.Graphics.Add(convexHullGraphic);
- }
-
- // Disable the button after has been used.
- _convexHullListButton.Enabled = false;
- }
- catch (System.Exception ex)
- {
- // Display an error message if there is a problem generating convex hull operation.
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("There was a problem generating the convex hull.");
- alertBuilder.SetMessage(ex.ToString());
- alertBuilder.Show();
- }
- }
-
- private void OnResetClicked(object sender, EventArgs e)
- {
- // Clear all existing graphics.
- _graphicsOverlay.Graphics.Clear();
-
- // Re-enable the button.
- _convexHullListButton.Enabled = true;
-
- // Add the polygons.
- _graphicsOverlay.Graphics.Add(_polygonGraphic1);
- _graphicsOverlay.Graphics.Add(_polygonGraphic2);
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create a TextView for the sample instructions.
- TextView sampleInstructionsTextView = new TextView(this)
- {
- Text = "Click the 'Convex Hull' button to create convex hull(s) from the polygon graphics."
- };
- layout.AddView(sampleInstructionsTextView);
-
- // Create a horizontal sub layout for the text view and switch controls.
- LinearLayout subLayout2 = new LinearLayout(this) { Orientation = Orientation.Horizontal };
-
- // Create a TextView for the union label.
- TextView unionInstructionsTextView = new TextView(this)
- {
- Text = "Union:"
- };
- subLayout2.AddView(unionInstructionsTextView);
-
- // Create a Switch for the union option.
- _convexHullListSwitch = new Switch(this)
- {
- Checked = true
- };
- subLayout2.AddView(_convexHullListSwitch);
-
- layout.AddView(subLayout2);
-
- // Create button to create the convex hull(s).
- _convexHullListButton = new Button(this)
- {
- Text = "Convex Hull"
- };
- _convexHullListButton.Click += OnMakeUnionBufferClicked;
- layout.AddView(_convexHullListButton);
-
- // Create button to reset the convex hull(s).
- _resetButton = new Button(this)
- {
- Text = "Reset"
- };
- _resetButton.Click += OnResetClicked;
- layout.AddView(_resetButton);
-
- // Add the map view to the layout.
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ConvexHullList/ConvexHullList.jpg b/src/Android/Xamarin.Android/Samples/Geometry/ConvexHullList/ConvexHullList.jpg
deleted file mode 100644
index 19be595a1d..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/ConvexHullList/ConvexHullList.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ConvexHullList/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/ConvexHullList/readme.metadata.json
deleted file mode 100644
index 87c4255436..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/ConvexHullList/readme.metadata.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "category": "Geometry",
- "description": "Generate convex hull polygon(s) from multiple input geometries.",
- "formal_name": "ConvexHullList",
- "ignore": false,
- "images": [
- "ConvexHullList.jpg"
- ],
- "keywords": [
- "analysis",
- "geometry",
- "outline",
- "perimeter",
- "union"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/convexhulllist.htm"
- ],
- "relevant_apis": [
- "GeometryEngine.ConvexHull",
- "Graphic.ZIndex",
- "GraphicsOverlay"
- ],
- "snippets": [
- "ConvexHullList.cs"
- ],
- "title": "Convex hull list"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/CreateGeometries/CreateGeometries.cs b/src/Android/Xamarin.Android/Samples/Geometry/CreateGeometries/CreateGeometries.cs
deleted file mode 100644
index c257cb6915..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/CreateGeometries/CreateGeometries.cs
+++ /dev/null
@@ -1,171 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-
-namespace ArcGISRuntime.Samples.CreateGeometries
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Create geometries",
- category: "Geometry",
- description: "Create simple geometry types.",
- instructions: "Pan and zoom freely to see the different types of geometries placed onto the map.",
- tags: new[] { "area", "boundary", "line", "marker", "path", "shape" })]
- public class CreateGeometries : Activity
- {
- // Hold a reference to the map view.
- private MapView _myMapView;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Create geometries";
-
- // Create the UI, setup the control references and execute initialization.
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a map with a topographic basemap.
- Map theMap = new Map(BasemapStyle.ArcGISTopographic);
-
- // Assign the map to the MapView.
- _myMapView.Map = theMap;
-
- // Create a simple fill symbol - used to render a polygon covering Colorado.
- SimpleFillSymbol theSimpleFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Cross, System.Drawing.Color.Blue, null);
-
- // Create a simple line symbol - used to render a polyline border between California and Nevada.
- SimpleLineSymbol theSimpleLineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.Blue, 3);
-
- // Create a simple marker symbol - used to render multi-points for various state capital locations in the Western United States.
- SimpleMarkerSymbol theSimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Triangle, System.Drawing.Color.Blue, 14);
-
- // Create a simple marker symbol - used to render a map point where the Esri headquarters is located.
- SimpleMarkerSymbol theSimpleMarkerSymbol2 = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Diamond, System.Drawing.Color.Red, 18);
-
- // Create a graphics overlay to hold the various graphics.
- GraphicsOverlay theGraphicsOverlays = new GraphicsOverlay();
-
- // Get the graphic collection from the graphics overlay.
- GraphicCollection theGraphicCollection = theGraphicsOverlays.Graphics;
-
- // Add a graphic to the graphic collection - polygon with a simple fill symbol.
- theGraphicCollection.Add(new Graphic(CreatePolygon(), theSimpleFillSymbol));
-
- // Add a graphic to the graphic collection - polyline with a simple line symbol.
- theGraphicCollection.Add(new Graphic(CreatePolyline(), theSimpleLineSymbol));
-
- // Add a graphic to the graphic collection - map point with a simple marker symbol.
- theGraphicCollection.Add(new Graphic(CreateMapPoint(), theSimpleMarkerSymbol2));
-
- // Add a graphic to the graphic collection - multi-point with a simple marker symbol.
- theGraphicCollection.Add(new Graphic(CreateMultipoint(), theSimpleMarkerSymbol));
-
- // Set the map views graphics overlay to the created graphics overlay.
- _myMapView.GraphicsOverlays.Add(theGraphicsOverlays);
-
- // Zoom to the extent of an envelope with some padding (10 pixels).
- _myMapView.SetViewpointGeometryAsync(CreateEnvelope(), 10);
- }
-
- private Envelope CreateEnvelope()
- {
- // Create an envelope that covers the extent of the western United States.
- Envelope theEnvelope = new Envelope(-123.0, 33.5, -101.0, 48.0, SpatialReferences.Wgs84);
-
- // Return the geometry.
- return theEnvelope;
- }
-
- private Polygon CreatePolygon()
- {
- // Create a point collection with coordinates that approximates the boundary of Colorado.
- PointCollection thePointCollection = new PointCollection(SpatialReferences.Wgs84);
- thePointCollection.Add(-109.048, 40.998);
- thePointCollection.Add(-102.047, 40.998);
- thePointCollection.Add(-102.037, 36.989);
- thePointCollection.Add(-109.048, 36.998);
-
- // Create a polygon from the point collection.
- Polygon thePolygon = new Polygon(thePointCollection);
-
- // Return the geometry.
- return thePolygon;
- }
-
- private Polyline CreatePolyline()
- {
- // Create a point collection with coordinates that approximates the border between California and Nevada.
- PointCollection thePointCollection = new PointCollection(SpatialReferences.Wgs84);
- thePointCollection.Add(-119.992, 41.989);
- thePointCollection.Add(-119.994, 38.994);
- thePointCollection.Add(-114.620, 35.0);
-
- // Create a polyline from the point collection.
- Polyline thePolyline = new Polyline(thePointCollection);
-
- // Return the geometry.
- return thePolyline;
- }
-
- private MapPoint CreateMapPoint()
- {
- // Create a map point where the Esri headquarters is located.
- MapPoint theMapPoint = new MapPoint(-117.195800, 34.056295, SpatialReferences.Wgs84);
-
- // Return the geometry.
- return theMapPoint;
- }
-
- private Multipoint CreateMultipoint()
- {
- // Create a point collection with coordinates representing various state capital locations in the Western United States.
- PointCollection thePointCollection = new PointCollection(SpatialReferences.Wgs84);
- // - Sacramento, CA
- thePointCollection.Add(-121.491014, 38.579065);
- // - Olympia, WA
- thePointCollection.Add(-122.891366, 47.039231);
- // - Salem, OR
- thePointCollection.Add(-123.043814, 44.93326);
- // - Carson City, NV
- thePointCollection.Add(-119.766999, 39.164885);
-
- // Create a multi-point from the point collection.
- Multipoint theMultipoint = new Multipoint(thePointCollection);
-
- // Return the geometry.
- return theMultipoint;
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add the map view to the layout.
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/CreateGeometries/CreateGeometries.jpg b/src/Android/Xamarin.Android/Samples/Geometry/CreateGeometries/CreateGeometries.jpg
deleted file mode 100644
index e5fd7dd184..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/CreateGeometries/CreateGeometries.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/CreateGeometries/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/CreateGeometries/readme.metadata.json
deleted file mode 100644
index e3c0a8be80..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/CreateGeometries/readme.metadata.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "category": "Geometry",
- "description": "Create simple geometry types.",
- "formal_name": "CreateGeometries",
- "ignore": false,
- "images": [
- "CreateGeometries.jpg"
- ],
- "keywords": [
- "area",
- "boundary",
- "line",
- "marker",
- "path",
- "shape"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/creategeometries.htm"
- ],
- "relevant_apis": [
- "Envelope",
- "Multipoint",
- "Point",
- "PointCollection",
- "Polygon",
- "Polyline"
- ],
- "snippets": [
- "CreateGeometries.cs"
- ],
- "title": "Create geometries"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/CutGeometry/CutGeometry.cs b/src/Android/Xamarin.Android/Samples/Geometry/CutGeometry/CutGeometry.cs
deleted file mode 100644
index bca9a9e570..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/CutGeometry/CutGeometry.cs
+++ /dev/null
@@ -1,237 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-
-namespace ArcGISRuntime.Samples.CutGeometry
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Cut geometry",
- category: "Geometry",
- description: "Cut a geometry along a polyline.",
- instructions: "Tap the \"Cut\" button to cut the polygon with the polyline and see the resulting parts (shaded in different colors).",
- tags: new[] { "cut", "geometry", "split" })]
- public class CutGeometry : Activity
- {
- // Hold a reference to the map view.
- private MapView _myMapView;
-
- // Graphics overlay to display the graphics.
- private GraphicsOverlay _graphicsOverlay;
-
- // Graphic that represents the polygon of Lake Superior.
- private Graphic _lakeSuperiorPolygonGraphic;
-
- // Graphic that represents the Canada and USA border (polyline) of Lake Superior.
- private Graphic _countryBorderPolylineGraphic;
-
- // Create a Button to cut polygons.
- private Button _cutButton;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- Title = "Cut geometry";
-
- // Create the UI, setup the control references and execute initialization.
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a map with a topographic basemap.
- Map newMap = new Map(BasemapStyle.ArcGISTopographic);
-
- // Assign the map to the MapView.
- _myMapView.Map = newMap;
-
- // Create a graphics overlay to hold the various graphics.
- _graphicsOverlay = new GraphicsOverlay();
-
- // Add the created graphics overlay to the MapView.
- _myMapView.GraphicsOverlays.Add(_graphicsOverlay);
-
- // Create a simple line symbol for the outline of the Lake Superior graphic.
- SimpleLineSymbol lakeSuperiorSimpleLineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.Blue, 4);
-
- // Create the color that will be used for the fill the Lake Superior graphic. It will be a semi-transparent, blue color.
- System.Drawing.Color lakeSuperiorFillColor = System.Drawing.Color.FromArgb(34, 0, 0, 255);
-
- // Create the simple fill symbol for the Lake Superior graphic - comprised of a fill style, fill color and outline.
- SimpleFillSymbol lakeSuperiorSimpleFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, lakeSuperiorFillColor, lakeSuperiorSimpleLineSymbol);
-
- // Create the graphic for Lake Superior - comprised of a polygon shape and fill symbol.
- _lakeSuperiorPolygonGraphic = new Graphic(CreateLakeSuperiorPolygon(), lakeSuperiorSimpleFillSymbol);
-
- // Add the Lake Superior graphic to the graphics overlay collection.
- _graphicsOverlay.Graphics.Add(_lakeSuperiorPolygonGraphic);
-
- // Create a simple line symbol for the Canada and USA border (polyline) of Lake Superior.
- SimpleLineSymbol countryBorderSimpleLineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Dot, System.Drawing.Color.Red, 5);
-
- // Create the graphic for Canada and USA border (polyline) of Lake Superior - comprised of a polyline shape and line symbol.
- _countryBorderPolylineGraphic = new Graphic(CreateBorder(), countryBorderSimpleLineSymbol);
-
- // Add the Canada and USA border graphic to the graphics overlay collection.
- _graphicsOverlay.Graphics.Add(_countryBorderPolylineGraphic);
-
- // Set the initial visual extent of the map view to that of Lake Superior.
- _myMapView.SetViewpointGeometryAsync(_lakeSuperiorPolygonGraphic.Geometry);
- }
-
- private void CutButton_Click(object sender, EventArgs e)
- {
- try
- {
- // Cut the polygon geometry with the polyline, expect two geometries.
- Geometry[] cutGeometries = GeometryEngine.Cut(_lakeSuperiorPolygonGraphic.Geometry, (Polyline)_countryBorderPolylineGraphic.Geometry);
-
- // Create a simple line symbol for the outline of the Canada side of Lake Superior.
- SimpleLineSymbol canadaSideSimpleLineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Null, System.Drawing.Color.Blue, 0);
-
- // Create the simple fill symbol for the Canada side of Lake Superior graphic - comprised of a fill style, fill color and outline.
- SimpleFillSymbol canadaSideSimpleFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.ForwardDiagonal, System.Drawing.Color.Green, canadaSideSimpleLineSymbol);
-
- // Create the graphic for the Canada side of Lake Superior - comprised of a polygon shape and fill symbol.
- Graphic canadaSideGraphic = new Graphic(cutGeometries[0], canadaSideSimpleFillSymbol);
-
- // Add the Canada side of the Lake Superior graphic to the graphics overlay collection.
- _graphicsOverlay.Graphics.Add(canadaSideGraphic);
-
- // Create a simple line symbol for the outline of the USA side of Lake Superior.
- SimpleLineSymbol usaSideSimpleLineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Null, System.Drawing.Color.Blue, 0);
-
- // Create the simple fill symbol for the USA side of Lake Superior graphic - comprised of a fill style, fill color and outline.
- SimpleFillSymbol usaSideSimpleFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.ForwardDiagonal, System.Drawing.Color.Yellow, usaSideSimpleLineSymbol);
-
- // Create the graphic for the USA side of Lake Superior - comprised of a polygon shape and fill symbol.
- Graphic usaSideGraphic = new Graphic(cutGeometries[1], usaSideSimpleFillSymbol);
-
- // Add the USA side of the Lake Superior graphic to the graphics overlay collection.
- _graphicsOverlay.Graphics.Add(usaSideGraphic);
-
- // Disable the button after has been used.
- _cutButton.Enabled = false;
- }
- catch (System.Exception ex)
- {
- // Display an error message if there is a problem generating cut operation.
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("There was a problem cutting the geometry.");
- alertBuilder.SetMessage(ex.ToString());
- alertBuilder.Show();
- }
- }
-
- private Polyline CreateBorder()
- {
- // Create a point collection that represents the Canada and USA border (polyline) of Lake Superior. Use the same spatial reference as the underlying base map.
- PointCollection borderCountryPointCollection = new PointCollection(SpatialReferences.WebMercator)
- {
- // Add all of the border map points to the point collection.
- new MapPoint(-9981328.687124, 6111053.281447),
- new MapPoint(-9946518.044066, 6102350.620682),
- new MapPoint(-9872545.427566, 6152390.920079),
- new MapPoint(-9838822.617103, 6157830.083057),
- new MapPoint(-9446115.050097, 5927209.572793),
- new MapPoint(-9430885.393759, 5876081.440801),
- new MapPoint(-9415655.737420, 5860851.784463)
- };
-
- // Create a polyline geometry from the point collection.
- Polyline borderCountryPolyline = new Polyline(borderCountryPointCollection);
-
- // Return the polyline.
- return borderCountryPolyline;
- }
-
- private Polygon CreateLakeSuperiorPolygon()
- {
- // Create a point collection that represents Lake Superior (polygon). Use the same spatial reference as the underlying base map.
- PointCollection lakeSuperiorPointCollection = new PointCollection(SpatialReferences.WebMercator)
- {
- // Add all of the lake Superior boundary map points to the point collection.
- new MapPoint(-10254374.668616, 5908345.076380),
- new MapPoint(-10178382.525314, 5971402.386779),
- new MapPoint(-10118558.923141, 6034459.697178),
- new MapPoint(-9993252.729399, 6093474.872295),
- new MapPoint(-9882498.222673, 6209888.368416),
- new MapPoint(-9821057.766387, 6274562.532928),
- new MapPoint(-9690092.583250, 6241417.023616),
- new MapPoint(-9605207.742329, 6206654.660191),
- new MapPoint(-9564786.389509, 6108834.986367),
- new MapPoint(-9449989.747500, 6095091.726408),
- new MapPoint(-9462116.153346, 6044160.821855),
- new MapPoint(-9417652.665244, 5985145.646738),
- new MapPoint(-9438671.768711, 5946341.148031),
- new MapPoint(-9398250.415891, 5922088.336339),
- new MapPoint(-9419269.519357, 5855797.317714),
- new MapPoint(-9467775.142741, 5858222.598884),
- new MapPoint(-9462924.580403, 5902686.086985),
- new MapPoint(-9598740.325877, 5884092.264688),
- new MapPoint(-9643203.813979, 5845287.765981),
- new MapPoint(-9739406.633691, 5879241.702350),
- new MapPoint(-9783061.694736, 5922896.763395),
- new MapPoint(-9844502.151022, 5936640.023354),
- new MapPoint(-9773360.570059, 6019099.583107),
- new MapPoint(-9883306.649729, 5968977.105610),
- new MapPoint(-9957681.938918, 5912387.211662),
- new MapPoint(-10055501.612742, 5871965.858842),
- new MapPoint(-10116942.069028, 5884092.264688),
- new MapPoint(-10111283.079633, 5933406.315128),
- new MapPoint(-10214761.742852, 5888134.399970),
- new MapPoint(-10254374.668616, 5901877.659929)
- };
-
- // Create a polyline geometry from the point collection.
- Polygon lakeSuperiorPolygon = new Polygon(lakeSuperiorPointCollection);
-
- // Return the polygon.
- return lakeSuperiorPolygon;
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create a TextView for instructions.
- TextView sampleInstructionsTextView = new TextView(this)
- {
- Text = "Click the 'Cut' button to cut the polygon with the polyline and see the resulting parts."
- };
- layout.AddView(sampleInstructionsTextView);
-
- // Create button to cut the polygons.
- _cutButton = new Button(this)
- {
- Text = "Cut"
- };
- _cutButton.Click += CutButton_Click;
- layout.AddView(_cutButton);
-
- // Add the map view to the layout.
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/CutGeometry/CutGeometry.jpg b/src/Android/Xamarin.Android/Samples/Geometry/CutGeometry/CutGeometry.jpg
deleted file mode 100644
index 980c8e1ff3..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/CutGeometry/CutGeometry.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/CutGeometry/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/CutGeometry/readme.metadata.json
deleted file mode 100644
index 161cc38ade..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/CutGeometry/readme.metadata.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "category": "Geometry",
- "description": "Cut a geometry along a polyline.",
- "formal_name": "CutGeometry",
- "ignore": false,
- "images": [
- "CutGeometry.jpg"
- ],
- "keywords": [
- "cut",
- "geometry",
- "split"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/cutgeometry.htm"
- ],
- "relevant_apis": [
- "GeometryEngine.Cut",
- "Polygon",
- "Polyline"
- ],
- "snippets": [
- "CutGeometry.cs"
- ],
- "title": "Cut geometry"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/DensifyAndGeneralize/DensifyAndGeneralize.cs b/src/Android/Xamarin.Android/Samples/Geometry/DensifyAndGeneralize/DensifyAndGeneralize.cs
deleted file mode 100644
index ff5fdc7dfd..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/DensifyAndGeneralize/DensifyAndGeneralize.cs
+++ /dev/null
@@ -1,176 +0,0 @@
-// Copyright 2020 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System.Drawing;
-using System.Linq;
-
-namespace ArcGISRuntime.Samples.DensifyAndGeneralize
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Densify and generalize",
- category: "Geometry",
- description: "A multipart geometry can be densified by adding interpolated points at regular intervals. Generalizing multipart geometry simplifies it while preserving its general shape. Densifying a multipart geometry adds more vertices at regular intervals.",
- instructions: "Use the sliders to control the parameters of the densify and generalize methods.",
- tags: new[] { "data", "densify", "generalize", "simplify" })]
- [ArcGISRuntime.Samples.Shared.Attributes.AndroidLayout("DensifyAndGeneralize.axml")]
- public class DensifyAndGeneralize : Activity
- {
- // UI controls.
- private TextView _resultLabel;
- private MapView _myMapView;
- private SeekBar _segmentLengthSlider;
- private SeekBar _deviationSlider;
-
- // Graphic used to refer to the original geometry.
- private Polyline _originalPolyline;
-
- // Graphics used to show the densify or generalize result.
- private Graphic _resultPolylineGraphic;
- private Graphic _resultPointGraphic;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- Title = "Densify and generalize";
-
- // Create the UI, setup the control references and execute initialization.
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create the map with a default basemap.
- _myMapView.Map = new Map(BasemapStyle.ArcGISLightGray);
-
- // Create and add a graphics overlay.
- GraphicsOverlay overlay = new GraphicsOverlay();
- _myMapView.GraphicsOverlays.Add(overlay);
-
- // Create the original geometry: some points along a river.
- PointCollection points = CreateShipPoints();
-
- // Show the original geometry as red dots on the map.
- Multipoint originalMultipoint = new Multipoint(points);
- Graphic originalPointsGraphic = new Graphic(originalMultipoint,
- new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, Color.Red, 7));
- overlay.Graphics.Add(originalPointsGraphic);
-
- // Show a dotted red line connecting the original points.
- _originalPolyline = new Polyline(points);
- Graphic originalPolylineGraphic = new Graphic(_originalPolyline,
- new SimpleLineSymbol(SimpleLineSymbolStyle.Dot, Color.Red, 3));
- overlay.Graphics.Add(originalPolylineGraphic);
-
- // Show the result (densified or generalized) points as magenta dots on the map.
- _resultPointGraphic = new Graphic
- {
- Symbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, Color.Magenta, 7),
- ZIndex = 999
- };
- overlay.Graphics.Add(_resultPointGraphic);
-
- // Connect the result points with a magenta polyline.
- _resultPolylineGraphic = new Graphic
- {
- Symbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Magenta, 3),
- ZIndex = 1000
- };
- overlay.Graphics.Add(_resultPolylineGraphic);
-
- // Listen for changes in state.
- _segmentLengthSlider.ProgressChanged += (o, e) =>
- UpdateGeometry("Densify", _segmentLengthSlider.Progress + 100, _deviationSlider.Progress + 1);
- _deviationSlider.ProgressChanged += (o, e) =>
- UpdateGeometry("Generalize", _segmentLengthSlider.Progress + 100, _deviationSlider.Progress + 1);
-
- // Center the map.
- _myMapView.SetViewpointGeometryAsync(_originalPolyline.Extent, 100);
- }
-
- private void CreateLayout()
- {
- // Load the layout for the sample from the .axml file.
- SetContentView(Resource.Layout.DensifyAndGeneralize);
-
- // Update control references to point to the controls defined in the layout.
- _myMapView = FindViewById(Resource.Id.densifyAndGeneralize_MyMapView);
- _resultLabel = FindViewById(Resource.Id.densifyAndGeneralize_ResultLabel);
- _deviationSlider = FindViewById(Resource.Id.densifyAndGeneralize_deviationSlider);
- _deviationSlider.Max = 249;
- _segmentLengthSlider = FindViewById(Resource.Id.densifyAndGeneralize_segmentLengthSlider);
- _segmentLengthSlider.Max = 400;
- }
-
- private void UpdateGeometry(string operation, double segmentLength, double deviation)
- {
- // Start with the original polyline.
- Polyline polyline = _originalPolyline;
-
- // Apply the selected operation.
- if (operation == "Generalize")
- {
- // Reset the other slider.
- _segmentLengthSlider.Progress = 0;
-
- polyline = (Polyline) GeometryEngine.Generalize(polyline, deviation, true);
-
- // Update the result label.
- _resultLabel.Text = $"Operation: Generalize, Deviation: {deviation:f}";
- }
- else
- {
- // Reset the other slider.
- _deviationSlider.Progress = 0;
-
- polyline = (Polyline) GeometryEngine.Densify(polyline, segmentLength);
-
- // Update the result label.
- _resultLabel.Text = $"Operation: Densify, Segment length: {segmentLength:f}";
- }
-
- // Update the graphic geometries to show the results.
- _resultPolylineGraphic.Geometry = polyline;
- _resultPointGraphic.Geometry = new Multipoint(polyline.Parts.SelectMany(m => m.Points));
- }
-
- private static PointCollection CreateShipPoints()
- {
- return new PointCollection(SpatialReference.Create(32126))
- {
- new MapPoint(2330611.130549, 202360.002957, 0.000000),
- new MapPoint(2330583.834672, 202525.984012, 0.000000),
- new MapPoint(2330574.164902, 202691.488009, 0.000000),
- new MapPoint(2330689.292623, 203170.045888, 0.000000),
- new MapPoint(2330696.773344, 203317.495798, 0.000000),
- new MapPoint(2330691.419723, 203380.917080, 0.000000),
- new MapPoint(2330435.065296, 203816.662457, 0.000000),
- new MapPoint(2330369.500800, 204329.861789, 0.000000),
- new MapPoint(2330400.929891, 204712.129673, 0.000000),
- new MapPoint(2330484.300447, 204927.797132, 0.000000),
- new MapPoint(2330514.469919, 205000.792463, 0.000000),
- new MapPoint(2330638.099138, 205271.601116, 0.000000),
- new MapPoint(2330725.315888, 205631.231308, 0.000000),
- new MapPoint(2330755.640702, 206433.354860, 0.000000),
- new MapPoint(2330680.644719, 206660.240923, 0.000000),
- new MapPoint(2330386.957926, 207340.947204, 0.000000),
- new MapPoint(2330485.861737, 207742.298501, 0.000000)
- };
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/DensifyAndGeneralize/DensifyAndGeneralize.jpg b/src/Android/Xamarin.Android/Samples/Geometry/DensifyAndGeneralize/DensifyAndGeneralize.jpg
deleted file mode 100644
index f821075722..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/DensifyAndGeneralize/DensifyAndGeneralize.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/DensifyAndGeneralize/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/DensifyAndGeneralize/readme.metadata.json
deleted file mode 100644
index 0b34b84e48..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/DensifyAndGeneralize/readme.metadata.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "category": "Geometry",
- "description": "A multipart geometry can be densified by adding interpolated points at regular intervals. Generalizing multipart geometry simplifies it while preserving its general shape. Densifying a multipart geometry adds more vertices at regular intervals.",
- "formal_name": "DensifyAndGeneralize",
- "ignore": false,
- "images": [
- "DensifyAndGeneralize.jpg"
- ],
- "keywords": [
- "data",
- "densify",
- "generalize",
- "simplify"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/densifyandgeneralize.htm"
- ],
- "relevant_apis": [
- "GeometryEngine",
- "Multipoint",
- "Point",
- "PointCollection",
- "Polyline",
- "SimpleLineSymbol",
- "SpatialReference"
- ],
- "snippets": [
- "../../../Resources/layout/DensifyAndGeneralize.axml",
- "DensifyAndGeneralize.cs"
- ],
- "title": "Densify and generalize"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/FormatCoordinates/FormatCoordinates.cs b/src/Android/Xamarin.Android/Samples/Geometry/FormatCoordinates/FormatCoordinates.cs
deleted file mode 100644
index 41a90d67cb..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/FormatCoordinates/FormatCoordinates.cs
+++ /dev/null
@@ -1,238 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Drawing;
-
-namespace ArcGISRuntime.Samples.FormatCoordinates
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Format coordinates",
- category: "Geometry",
- description: "Format coordinates in a variety of common notations.",
- instructions: "Tap on the map to see a callout with the clicked location's coordinate formatted in 4 different ways. You can also put a coordinate string in any of these formats in the text field. Hit Enter and the coordinate string will be parsed to a map location which the callout will move to.",
- tags: new[] { "USNG", "UTM", "convert", "coordinate", "decimal degrees", "degree minutes seconds", "format", "latitude", "longitude" })]
- public class FormatCoordinates : Activity
- {
- // Hold a reference to the map view
- private MapView _myMapView;
-
- private EditText _DecimalDegreesEditText;
- private EditText _DmsEditText;
- private EditText _UtmEditText;
- private EditText _UsngEditText;
-
- // Hold last edited field
- private EditText _lastEdited;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Format coordinates";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create the map
- _myMapView.Map = new Map(BasemapStyle.ArcGISStreets);
-
- // Add the graphics overlay to the map
- _myMapView.GraphicsOverlays.Add(new GraphicsOverlay());
-
- // Create the starting point
- MapPoint startingPoint = new MapPoint(0, 0, SpatialReferences.WebMercator);
-
- // Update the UI with the initial point
- UpdateUIFromMapPoint(startingPoint);
-
- // Subscribe to map tap events to enable tapping on map to update coordinates
- _myMapView.GeoViewTapped += (sender, args) => { UpdateUIFromMapPoint(args.Location); };
- }
-
- private void InputTextChanged(object sender, EventArgs e)
- {
- // Keep track of the last edited field
- _lastEdited = (EditText)sender;
- }
-
- private void RecalculateFields(object sender, EventArgs e)
- {
- // Hold the entered point
- MapPoint enteredPoint = null;
-
- // Set a default last edited field to prevent NullReferenceException
- if (_lastEdited == null)
- {
- _lastEdited = _DecimalDegreesEditText;
- }
-
- // Update the point based on which text sent the event
- try
- {
- switch (_lastEdited.Hint)
- {
- case "Decimal Degrees":
- case "Degrees, Minutes, Seconds":
- enteredPoint =
- CoordinateFormatter.FromLatitudeLongitude(_lastEdited.Text, _myMapView.SpatialReference);
- break;
-
- case "UTM":
- enteredPoint =
- CoordinateFormatter.FromUtm(_lastEdited.Text, _myMapView.SpatialReference, UtmConversionMode.NorthSouthIndicators);
- break;
-
- case "USNG":
- enteredPoint =
- CoordinateFormatter.FromUsng(_lastEdited.Text, _myMapView.SpatialReference);
- break;
- }
- }
- catch (Exception ex)
- {
- // The coordinate is malformed, warn and return
- // Display the message to the user
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.SetMessage(ex.Message).SetTitle("Invalid Format").Show();
- return;
- }
-
- // Update the UI from the MapPoint
- UpdateUIFromMapPoint(enteredPoint);
- }
-
- private void UpdateUIFromMapPoint(MapPoint selectedPoint)
- {
- // Clear event subscriptions - prevents an infinite loop
- _UtmEditText.TextChanged -= InputTextChanged;
- _DmsEditText.TextChanged -= InputTextChanged;
- _DecimalDegreesEditText.TextChanged -= InputTextChanged;
- _UsngEditText.TextChanged -= InputTextChanged;
-
- try
- {
- // Check if the selected point can be formatted into coordinates.
- CoordinateFormatter.ToLatitudeLongitude(selectedPoint, LatitudeLongitudeFormat.DecimalDegrees, 0);
- }
- catch (Exception e)
- {
- // Check if the excpetion is because the coordinates are out of range.
- if (e.Message == "Invalid argument: coordinates are out of range")
- {
- // Set all of the text fields to contain the error message.
- _DecimalDegreesEditText.Text = "Coordinates are out of range";
- _DmsEditText.Text = "Coordinates are out of range";
- _UtmEditText.Text = "Coordinates are out of range";
- _UsngEditText.Text = "Coordinates are out of range";
-
- // Clear the selectionss symbol.
- _myMapView.GraphicsOverlays[0].Graphics.Clear();
- }
- // Restore event subscriptions.
- _UtmEditText.TextChanged += InputTextChanged;
- _DmsEditText.TextChanged += InputTextChanged;
- _DecimalDegreesEditText.TextChanged += InputTextChanged;
- _UsngEditText.TextChanged += InputTextChanged;
- return;
- }
-
- // Update the decimal degrees text
- _DecimalDegreesEditText.Text =
- CoordinateFormatter.ToLatitudeLongitude(selectedPoint, LatitudeLongitudeFormat.DecimalDegrees, 4);
-
- // Update the degrees, minutes, seconds text
- _DmsEditText.Text = CoordinateFormatter.ToLatitudeLongitude(selectedPoint,
- LatitudeLongitudeFormat.DegreesMinutesSeconds, 1);
-
- // Update the UTM text
- _UtmEditText.Text = CoordinateFormatter.ToUtm(selectedPoint, UtmConversionMode.NorthSouthIndicators, true);
-
- // Update the USNG text
- _UsngEditText.Text = CoordinateFormatter.ToUsng(selectedPoint, 4, true);
-
- // Clear existing graphics overlays
- _myMapView.GraphicsOverlays[0].Graphics.Clear();
-
- // Create a symbol to symbolize the point
- SimpleMarkerSymbol symbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.X, Color.Yellow, 20);
-
- // Create the graphic
- Graphic symbolGraphic = new Graphic(selectedPoint, symbol);
-
- // Add the graphic to the graphics overlay
- _myMapView.GraphicsOverlays[0].Graphics.Add(symbolGraphic);
-
- // Restore event subscriptions
- _UtmEditText.TextChanged += InputTextChanged;
- _DmsEditText.TextChanged += InputTextChanged;
- _DecimalDegreesEditText.TextChanged += InputTextChanged;
- _UsngEditText.TextChanged += InputTextChanged;
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Help Label
- TextView helpLabel = new TextView(this) { Text = "Edit the coordinates or tap the map to see conversions.\n\n" };
- layout.AddView(helpLabel);
-
- // Decimal Degrees
- _DecimalDegreesEditText = new EditText(this) { Hint = "Decimal Degrees" };
- TextView ddTextLabel = new TextView(this) { Text = "Decimal Degrees:" };
- layout.AddView(ddTextLabel);
- layout.AddView(_DecimalDegreesEditText);
-
- // Degrees, Minutes, Seconds
- _DmsEditText = new EditText(this) { Hint = "Degrees, Minutes, Seconds" };
- TextView dmsTextLabel = new TextView(this) { Text = "Degrees, Minutes, Seconds: " };
- layout.AddView(dmsTextLabel);
- layout.AddView(_DmsEditText);
-
- // UTM
- _UtmEditText = new EditText(this) { Hint = "UTM" };
- TextView utmTextLabel = new TextView(this) { Text = "UTM:" };
- layout.AddView(utmTextLabel);
- layout.AddView(_UtmEditText);
-
- // USNG
- _UsngEditText = new EditText(this) { Hint = "USNG" };
- TextView usngTextLabel = new TextView(this) { Text = "USNG" };
- layout.AddView(usngTextLabel);
- layout.AddView(_UsngEditText);
-
- // Button to allow for recalculating
- Button recalculateButton = new Button(this) { Text = "Recalculate" };
- recalculateButton.Click += RecalculateFields;
- layout.AddView(recalculateButton);
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/FormatCoordinates/FormatCoordinates.jpg b/src/Android/Xamarin.Android/Samples/Geometry/FormatCoordinates/FormatCoordinates.jpg
deleted file mode 100644
index 0ef3437bf9..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/FormatCoordinates/FormatCoordinates.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/FormatCoordinates/readme.md b/src/Android/Xamarin.Android/Samples/Geometry/FormatCoordinates/readme.md
deleted file mode 100644
index d589542680..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/FormatCoordinates/readme.md
+++ /dev/null
@@ -1,29 +0,0 @@
-# Format coordinates
-
-Format coordinates in a variety of common notations.
-
-![Images of format coordinates](FormatCoordinates.jpg)
-
-## Use case
-
-The coordinate formatter can format a map location in WGS84 in a number of common coordinate notations. Parsing one of these formats to a location is also supported. Formats include decimal degrees; degrees, minutes, seconds; Universal Transverse Mercator (UTM), and United States National Grid (USNG).
-
-## How to use the sample
-
-Tap on the map to see a callout with the clicked location's coordinate formatted in 4 different ways. You can also put a coordinate string in any of these formats in the text field. Hit Enter and the coordinate string will be parsed to a map location which the callout will move to.
-
-## How it works
-
-1. Get or create a `MapPoint` with a spatial reference.
-2. Use one of the static "to" methods on `CoordinateFormatter` such as `CoordinateFormatter.ToLatitudeLongitude(point, CoordinateFormatter.LatitudeLongitudeFormat.DecimalDegrees, 4)` to get the formatted string.
-3. To go from a formatted string to a `Point`, use one of the "from" static methods like `CoordinateFormatter.FromUtm(coordinateString, map.SpatialReference, CoordinateFormatter.UtmConversionMode.NorthSouthIndicators)`.
-
-## Relevant API
-
-* CoordinateFormatter
-* CoordinateFormatter.LatitudeLongitudeFormat
-* CoordinateFormatter.UtmConversionMode
-
-## Tags
-
-convert, coordinate, decimal degrees, degree minutes seconds, format, latitude, longitude, USNG, UTM
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/FormatCoordinates/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/FormatCoordinates/readme.metadata.json
deleted file mode 100644
index 17c56e38d1..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/FormatCoordinates/readme.metadata.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "category": "Geometry",
- "description": "Format coordinates in a variety of common notations.",
- "formal_name": "FormatCoordinates",
- "ignore": false,
- "images": [
- "FormatCoordinates.jpg"
- ],
- "keywords": [
- "USNG",
- "UTM",
- "convert",
- "coordinate",
- "decimal degrees",
- "degree minutes seconds",
- "format",
- "latitude",
- "longitude"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/formatcoordinates.htm"
- ],
- "relevant_apis": [
- "CoordinateFormatter",
- "CoordinateFormatter.LatitudeLongitudeFormat",
- "CoordinateFormatter.UtmConversionMode"
- ],
- "snippets": [
- "FormatCoordinates.cs"
- ],
- "title": "Format coordinates"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/GeodesicOperations/GeodesicOperations.cs b/src/Android/Xamarin.Android/Samples/Geometry/GeodesicOperations/GeodesicOperations.cs
deleted file mode 100644
index 63701ed90e..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/GeodesicOperations/GeodesicOperations.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-
-namespace ArcGISRuntime.Samples.GeodesicOperations
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Geodesic operations",
- category: "Geometry",
- description: "Calculate a geodesic path between two points and measure its distance.",
- instructions: "Tap anywhere on the map. A line graphic will display the geodesic line between the two points. In addition, text that indicates the geodesic distance between the two points will be updated. Tap elsewhere and a new line will be created.",
- tags: new[] { "densify", "distance", "geodesic", "geodetic" })]
- public class GeodesicOperations : Activity
- {
- // Map view control to display a map in the app.
- private MapView _myMapView;
-
- // Label to show the geodesic distance.
- private TextView _resultTextView;
-
- // Hold references to the graphics.
- private Graphic _startLocationGraphic;
- private Graphic _endLocationGraphic;
- private Graphic _pathGraphic;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Geodesic operations";
-
- // Create the UI.
- CreateLayout();
-
- // Create a new map, add a point graphic, and fill the datum transformations list.
- Initialize();
- }
-
- private void Initialize()
- {
- _myMapView.Map = new Map(BasemapStyle.ArcGISImageryStandard);
-
- // Create the graphics overlay and add it to the map view.
- GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
- _myMapView.GraphicsOverlays.Add(graphicsOverlay);
-
- // Add a graphic at JFK to serve as the origin.
- MapPoint start = new MapPoint(-73.7781, 40.6413, SpatialReferences.Wgs84);
- SimpleMarkerSymbol startMarker = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, System.Drawing.Color.Blue, 10);
- _startLocationGraphic = new Graphic(start, startMarker);
-
- // Create the graphic for the destination.
- _endLocationGraphic = new Graphic
- {
- Symbol = startMarker
- };
-
- // Create the graphic for the path.
- _pathGraphic = new Graphic
- {
- Symbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Dash, System.Drawing.Color.Blue, 5)
- };
-
- // Add the graphics to the overlay.
- graphicsOverlay.Graphics.Add(_startLocationGraphic);
- graphicsOverlay.Graphics.Add(_endLocationGraphic);
- graphicsOverlay.Graphics.Add(_pathGraphic);
-
- // Update end location when the user taps.
- _myMapView.GeoViewTapped += MyMapViewOnGeoViewTapped;
- }
-
- private void MyMapViewOnGeoViewTapped(object sender, GeoViewInputEventArgs geoViewInputEventArgs)
- {
- // Get the tapped point, projected to WGS84.
- MapPoint destination = (MapPoint)GeometryEngine.Project(geoViewInputEventArgs.Location, SpatialReferences.Wgs84);
-
- // Update the destination graphic.
- _endLocationGraphic.Geometry = destination;
-
- // Get the points that define the route polyline.
- PointCollection polylinePoints = new PointCollection(SpatialReferences.Wgs84)
- {
- (MapPoint)_startLocationGraphic.Geometry,
- destination
- };
-
- // Create the polyline for the two points.
- Polyline routeLine = new Polyline(polylinePoints);
-
- // Densify the polyline to show the geodesic curve.
- Geometry pathGeometry = GeometryEngine.DensifyGeodetic(routeLine, 1, LinearUnits.Kilometers, GeodeticCurveType.Geodesic);
-
- // Apply the curved line to the path graphic.
- _pathGraphic.Geometry = pathGeometry;
-
- // Calculate and show the distance.
- double distance = GeometryEngine.LengthGeodetic(pathGeometry, LinearUnits.Kilometers, GeodeticCurveType.Geodesic);
- _resultTextView.Text = $"{(int)distance} kilometers";
- }
-
- private void CreateLayout()
- {
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create the result label.
- _resultTextView = new TextView(this) { Text = "Tap to set an end point." };
-
- // Add the label and map to the view.
- layout.AddView(_resultTextView);
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/GeodesicOperations/GeodesicOperations.jpg b/src/Android/Xamarin.Android/Samples/Geometry/GeodesicOperations/GeodesicOperations.jpg
deleted file mode 100644
index 2cc66f6573..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/GeodesicOperations/GeodesicOperations.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/GeodesicOperations/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/GeodesicOperations/readme.metadata.json
deleted file mode 100644
index adbf5bd2d9..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/GeodesicOperations/readme.metadata.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "category": "Geometry",
- "description": "Calculate a geodesic path between two points and measure its distance.",
- "formal_name": "GeodesicOperations",
- "ignore": false,
- "images": [
- "GeodesicOperations.jpg"
- ],
- "keywords": [
- "densify",
- "distance",
- "geodesic",
- "geodetic"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/geodesicoperations.htm"
- ],
- "relevant_apis": [
- "GeometryEngine.DensifyGeodetic",
- "GeometryEngine.LengthGeodetic"
- ],
- "snippets": [
- "GeodesicOperations.cs"
- ],
- "title": "Geodesic operations"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/ListTransformations.cs b/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/ListTransformations.cs
deleted file mode 100644
index 1188aacbb8..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/ListTransformations.cs
+++ /dev/null
@@ -1,365 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-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 System;
-using System.Collections.Generic;
-using System.Drawing;
-
-namespace ArcGISRuntime.Samples.ListTransformations
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData()]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "List transformations by suitability",
- category: "Geometry",
- description: "Get a list of suitable transformations for projecting a geometry between two spatial references with different horizontal datums.",
- instructions: "Select a transformation from the list to see the result of projecting the point from EPSG:27700 to EPSG:3857 using that transformation. The result is shown as a red cross; you can visually compare the original blue point with the projected red cross.",
- tags: new[] { "datum", "geodesy", "projection", "spatial reference", "transformation" })]
- public class ListTransformations : Activity
- {
- // Hold a reference to the map view.
- private MapView _myMapView;
-
- // Point whose coordinates will be projected using a selected transform.
- private MapPoint _originalPoint;
-
- // Graphic representing the projected point.
- private Graphic _projectedPointGraphic;
-
- // GraphicsOverlay to hold the point graphics.
- private GraphicsOverlay _pointsOverlay;
-
- // Text view to display messages to the user (exceptions, etc.).
- private TextView _messagesTextView;
-
- // Labels to display the input/output spatial references (WKID).
- private TextView _inWkidLabel;
- private TextView _outWkidLabel;
-
- // Spinner to display the datum transformations suitable for the input/output spatial references.
- private Spinner _transformationsPicker;
-
- // Switch to toggle suitable transformations for the current extent.
- private Switch _useExtentSwitch;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "List transformations by suitability";
-
- // Create the UI.
- CreateLayout();
-
- // Create a new map, add a point graphic, and fill the datum transformations list.
- Initialize();
- }
-
- private void Initialize()
- {
- // Create the map and add it to the map view control.
- Map myMap = new Map(BasemapStyle.ArcGISImagery);
-
- // Create a point in the Greenwich observatory courtyard in London, UK, the location of the prime meridian.
- _originalPoint = new MapPoint(538985.355, 177329.516, SpatialReference.Create(27700));
-
- // Set the initial extent to an extent centered on the point.
- Viewpoint initialViewpoint = new Viewpoint(_originalPoint, 5000);
- myMap.InitialViewpoint = initialViewpoint;
-
- // Handle the map loading to fill the UI controls.
- myMap.Loaded += MyMap_Loaded;
-
- // Add the map to the map view.
- _myMapView.Map = myMap;
-
- // Create a graphics overlay to hold the original and projected points.
- _pointsOverlay = new GraphicsOverlay();
- _myMapView.GraphicsOverlays.Add(_pointsOverlay);
-
- // Add the point as a graphic with a blue square.
- SimpleMarkerSymbol markerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Square, Color.Blue, 15);
- Graphic originalGraphic = new Graphic(_originalPoint, markerSymbol);
- _pointsOverlay.Graphics.Add(originalGraphic);
-
- // Get the path to the projection engine data (if it exists).
- string peFolderPath = GetProjectionDataPath();
- if (!String.IsNullOrEmpty(peFolderPath))
- {
- TransformationCatalog.ProjectionEngineDirectory = peFolderPath;
- _messagesTextView.Text = "Using projection data found at '" + peFolderPath + "'";
- }
- else
- {
- _messagesTextView.Text = "Projection engine data not found.";
- }
- }
-
- private void MyMap_Loaded(object sender, EventArgs e)
- {
- // Get the map's spatial reference.
- SpatialReference mapSpatialReference = ((Map)sender).SpatialReference;
-
- // Run on the UI thread.
- RunOnUiThread(() =>
- {
- // Show the input and output spatial reference (WKID) in the labels.
- _inWkidLabel.Text = "In WKID = " + _originalPoint.SpatialReference.Wkid;
- _outWkidLabel.Text = "Out WKID = " + mapSpatialReference.Wkid;
-
- // Call a function to create a list of transformations to fill the picker.
- GetSuitableTransformations(_originalPoint.SpatialReference, mapSpatialReference, _useExtentSwitch.Checked);
- });
- }
-
- private void CreateLayout()
- {
- // View for the input/output wkid labels.
- LinearLayout wkidLabelsStackView = new LinearLayout(this) { Orientation = Orientation.Horizontal };
- wkidLabelsStackView.SetPadding(10, 10, 0, 10);
-
- // Create a label for the input spatial reference.
- _inWkidLabel = new TextView(this)
- {
- Text = "In WKID = ",
- TextAlignment = TextAlignment.ViewStart
- };
-
- // Create a label for the output spatial reference.
- _outWkidLabel = new TextView(this)
- {
- Text = "Out WKID = ",
- TextAlignment = TextAlignment.ViewStart
- };
-
- // Create some horizontal space between the labels.
- Space space = new Space(this);
- space.SetMinimumWidth(30);
-
- // Add the Wkid labels to the stack view.
- wkidLabelsStackView.AddView(_inWkidLabel);
- wkidLabelsStackView.AddView(space);
- wkidLabelsStackView.AddView(_outWkidLabel);
-
- // Create the 'use extent' switch.
- _useExtentSwitch = new Switch(this)
- {
- Checked = false,
- Text = "Use extent"
- };
-
- // Handle the checked change event for the switch.
- _useExtentSwitch.CheckedChange += UseExtentSwitch_CheckedChange;
-
- // Create a picker (Spinner) for datum transformations.
- _transformationsPicker = new Spinner(this);
- _transformationsPicker.SetPadding(5, 10, 0, 10);
-
- // Handle the selection event to work with the selected transformation.
- _transformationsPicker.ItemSelected += TransformationsPicker_ItemSelected;
-
- // Create a text view to show messages.
- _messagesTextView = new TextView(this);
-
- // Create a new vertical layout for the app UI.
- LinearLayout mainLayout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create a layout for the app tools.
- LinearLayout toolsLayout = new LinearLayout(this) { Orientation = Orientation.Vertical };
- toolsLayout.SetPadding(10, 0, 0, 0);
- toolsLayout.SetMinimumHeight(320);
-
- // Add the transformation UI controls to the tools layout.
- toolsLayout.AddView(wkidLabelsStackView);
- toolsLayout.AddView(_useExtentSwitch);
- toolsLayout.AddView(_transformationsPicker);
- toolsLayout.AddView(_messagesTextView);
-
- // Add the tools layout and map view to the main layout.
- mainLayout.AddView(toolsLayout);
- _myMapView = new MapView(this);
- mainLayout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(mainLayout);
- }
-
- // Function to get suitable datum transformations for the specified input and output spatial references.
- private void GetSuitableTransformations(SpatialReference inSpatialRef, SpatialReference outSpatialRef, bool considerExtent)
- {
- // Get suitable transformations. Use the current extent to evaluate suitability, if requested.
- IReadOnlyList transformations;
- if (considerExtent)
- {
- Envelope currentExtent = _myMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry as Envelope;
- transformations = TransformationCatalog.GetTransformationsBySuitability(inSpatialRef, outSpatialRef, currentExtent);
- }
- else
- {
- transformations = TransformationCatalog.GetTransformationsBySuitability(inSpatialRef, outSpatialRef);
- }
-
- // Get the default transformation for the specified input and output spatial reference.
- DatumTransformation defaultTransform = TransformationCatalog.GetTransformation(inSpatialRef, outSpatialRef);
-
- // Create a list of transformations.
- List transformsList = new List();
- foreach(DatumTransformation transformation in transformations)
- {
- transformsList.Add(transformation);
- }
-
- // Create an adapter for showing the spinner list.
- TransformationsAdapter transformationsAdapter = new TransformationsAdapter(this, transformsList)
- {
- DefaultTransformation = defaultTransform
- };
-
- // Apply the adapter to the spinner.
- _transformationsPicker.Adapter = transformationsAdapter;
- }
-
- private void TransformationsPicker_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
- {
- // Get the selected transform from the spinner. Return if none is selected.
- TransformationsAdapter adapter = (TransformationsAdapter)_transformationsPicker.Adapter;
- DatumTransformation selectedTransform = adapter[e.Position];
- if (selectedTransform == null) { return; }
-
- try
- {
- // Project the original point using the selected transform.
- MapPoint projectedPoint = (MapPoint)GeometryEngine.Project(_originalPoint, _myMapView.SpatialReference, selectedTransform);
-
- // Update the projected graphic (if it already exists), create it otherwise.
- if (_projectedPointGraphic != null)
- {
- _projectedPointGraphic.Geometry = projectedPoint;
- }
- else
- {
- // Create a symbol to represent the projected point (a cross to ensure both markers are visible).
- SimpleMarkerSymbol projectedPointMarker = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Cross, Color.Red, 15);
-
- // Create the point graphic and add it to the overlay.
- _projectedPointGraphic = new Graphic(projectedPoint, projectedPointMarker);
- _pointsOverlay.Graphics.Add(_projectedPointGraphic);
- }
-
- _messagesTextView.Text = "Projected point using transform: " + selectedTransform.Name;
- }
- catch (ArcGISRuntimeException ex)
- {
- // Exception if a transformation is missing grid files.
- _messagesTextView.Text = "Error using selected transformation: " + ex.Message;
-
- // Remove the projected point graphic (if it exists).
- if (_projectedPointGraphic != null && _pointsOverlay.Graphics.Contains(_projectedPointGraphic))
- {
- _pointsOverlay.Graphics.Remove(_projectedPointGraphic);
- _projectedPointGraphic = null;
- }
- }
- }
-
- private void UseExtentSwitch_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e)
- {
- // Call a function to create a list of transformations to fill the picker.
- GetSuitableTransformations(_originalPoint.SpatialReference, _myMapView.Map.SpatialReference, _useExtentSwitch.Checked);
- }
-
- private string GetProjectionDataPath()
- {
- // Return the projection data path; note that this is not valid by default.
- // You must manually download the projection engine data and update the path returned here.
- return "";
- }
- }
-
- // An Adapter class to provide a list of datum transformations for display in a Spinner control.
- public class TransformationsAdapter : BaseAdapter
- {
- // Property to expose the default datum transformation (will be displayed with different text color).
- public DatumTransformation DefaultTransformation { get; set; }
-
- // Fields to store the list of transformations and the current context.
- private List _transformations;
- private Activity _context;
-
- // Constructor for the adapter. Store the context and the list of transformations to display.
- public TransformationsAdapter(Activity context, List items) : base()
- {
- _transformations = items;
- _context = context;
- }
-
- // Provide an ID for an item at a given position (just return the position).
- public override long GetItemId(int position)
- {
- return position;
- }
-
- // Provide the datum transformation at this position in the list.
- public override DatumTransformation this[int position]
- {
- get { return _transformations[position]; }
- }
-
- // Provide the number of items (datum transformations) in the list.
- public override int Count
- {
- get
- {
- return _transformations.Count;
- }
- }
-
- // Override the GetView method to provide a custom (formatted) text view for each transformation in the list.
- public override View GetView(int position, View convertView, ViewGroup parent)
- {
- // Create a new text view to display the transformation name with the proper formatting.
- TextView transformTextView = new TextView(_context);
-
- // Get the datum transformation being displayed.
- DatumTransformation thisTransform = _transformations[position];
-
- // Set the text with the transformation name.
- transformTextView.SetText(thisTransform.Name, TextView.BufferType.Normal);
-
- // Use white as the default text color (available transforms).
- transformTextView.SetTextColor(Android.Graphics.Color.White);
- transformTextView.SetBackgroundColor(Android.Graphics.Color.DarkGray);
-
- // See if the transform is missing required projection engine files. If so, display the text in gray.
- if (thisTransform.IsMissingProjectionEngineFiles)
- {
- transformTextView.SetTextColor(Android.Graphics.Color.Gray);
- }
-
- // If this is the default transformation, show it in blue.
- if(thisTransform.Name == DefaultTransformation.Name)
- {
- transformTextView.SetTextColor(Android.Graphics.Color.Blue);
- }
-
- // Pass back the text view.
- return transformTextView;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/ListTransformations.jpg b/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/ListTransformations.jpg
deleted file mode 100644
index 3ab8ece01d..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/ListTransformations.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/readme.md b/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/readme.md
deleted file mode 100644
index ed4787d5f1..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/readme.md
+++ /dev/null
@@ -1,54 +0,0 @@
-# List transformations by suitability
-
-Get a list of suitable transformations for projecting a geometry between two spatial references with different horizontal datums.
-
-![Image of list transformations by suitability](ListTransformations.jpg)
-
-## Use case
-
-Transformations (sometimes known as datum or geographic transformations) are used when projecting data from one spatial reference to another when there is a difference in the underlying datum of the spatial references. Transformations can be mathematically defined by specific equations (equation-based transformations), or may rely on external supporting files (grid-based transformations). Choosing the most appropriate transformation for a situation can ensure the best possible accuracy for this operation. Some users familiar with transformations may wish to control which transformation is used in an operation.
-
-## How to use the sample
-
-Select a transformation from the list to see the result of projecting the point from EPSG:27700 to EPSG:3857 using that transformation. The result is shown as a red cross; you can visually compare the original blue point with the projected red cross.
-
-Select 'Consider current extent' to limit the transformations that are appropriate for the current extent.
-
-If the selected transformation is not usable (has missing grid files) then an error is displayed.
-
-## How it works
-
-1. Pass the input and output spatial references to `TransformationCatalog.GetTransformationsBySuitability` for transformations based on the map's spatial reference OR additionally provide an extent argument to only return transformations suitable to the extent. This returns a list of ranked transformations.
-2. Use one of the `DatumTransformation` objects returned to project the input geometry to the output spatial reference.
-
-## Relevant API
-
-* DatumTransformation
-* GeographicTransformation
-* GeographicTransformationStep
-* GeometryEngine
-* GeometryEngine.Project
-* TransformationCatalog
-
-## Additional information
-
-Some transformations aren't available until transformation data is provided.
-
-This sample uses a `GeographicTransformation`, which extends the `DatumTransformation` class. As of 100.9, ArcGIS Runtime also includes a `HorizontalVerticalTransformation`, which also extends `DatumTransformation`. The `HorizontalVerticalTransformation` class is used to transform coordinates of z-aware geometries between spatial references that have different geographic and/or vertical coordinate systems.
-
-This sample can be used with or without provisioning projection engine data to your device. If you do not provision data, a limited number of transformations will be available.
-
-To download projection engine data to your device:
-1. Log in to the [ArcGIS for Developers site](https://developers.arcgis.com/sign-in/) using your Developer account.
-2. In the Dashboard page, tap '[Download APIs and SDKs](https://developers.arcgis.com/downloads/#pedata)'.
-3. Tap the download button next to `Projection Engine Data` to download projection engine data to your computer.
-4. Unzip the downloaded data on your computer.
-5. Create an `~/ArcGIS/Runtime/Data/PEDataRuntime` directory on your device and copy the files to this directory.
-
-## About the data
-
-The map starts out zoomed into the grounds of the Royal Observatory, Greenwich. The initial point is in the [British National Grid](https://epsg.io/27700) spatial reference, which was created by the United Kingdom Ordnance Survey. The spatial reference after projection is in [web mercator](https://epsg.io/3857).
-
-## Tags
-
-datum, geodesy, projection, spatial reference, transformation
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/readme.metadata.json
deleted file mode 100644
index cd675d7c57..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/readme.metadata.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "category": "Geometry",
- "description": "Get a list of suitable transformations for projecting a geometry between two spatial references with different horizontal datums.",
- "formal_name": "ListTransformations",
- "ignore": false,
- "images": [
- "ListTransformations.jpg"
- ],
- "keywords": [
- "datum",
- "geodesy",
- "projection",
- "spatial reference",
- "transformation"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/listtransformations.htm"
- ],
- "relevant_apis": [
- "DatumTransformation",
- "GeographicTransformation",
- "GeographicTransformationStep",
- "GeometryEngine",
- "GeometryEngine.Project",
- "TransformationCatalog"
- ],
- "snippets": [
- "ListTransformations.cs"
- ],
- "title": "List transformations by suitability"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/NearestVertex/NearestVertex.cs b/src/Android/Xamarin.Android/Samples/Geometry/NearestVertex/NearestVertex.cs
deleted file mode 100644
index 378453bc99..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/NearestVertex/NearestVertex.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright 2020 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System.Drawing;
-
-namespace ArcGISRuntime.Samples.NearestVertex
-{
- [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Nearest vertex",
- category: "Geometry",
- description: "Find the closest vertex and coordinate of a geometry to a point.",
- instructions: "Tap anywhere on the map. An orange cross will show at that location. A blue circle will show the polygon's nearest vertex to the point that was clicked. A red diamond will appear at the coordinate on the geometry that is nearest to the point that was clicked. If clicked inside the geometry, the red and orange markers will overlap. The information box showing distance between the clicked point and the nearest vertex/coordinate will be updated with every new location clicked.",
- tags: new[] { "analysis", "coordinate", "geometry", "nearest", "proximity", "vertex" })]
- public class NearestVertex : Activity
- {
- // Map view control to display a map in the app.
- private MapView _myMapView;
-
- // Label to show the geodesic distance
- private TextView _resultTextView;
-
- // Hold references to the graphics overlay and the polygon graphic
- private GraphicsOverlay _graphicsOverlay;
- private Graphic _polygonGraphic;
-
- // Hold references to the graphics for the user and results points
- private Graphic _tappedLocationGraphic;
- private Graphic _nearestVertexGraphic;
- private Graphic _nearestCoordinateGraphic;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Nearest vertex";
-
- // Create the UI.
- CreateLayout();
-
- // Create a new map, add a point graphic, and fill the datum transformations list.
- Initialize();
- }
-
- private void Initialize()
- {
- // Configure the basemap
- _myMapView.Map = new Map(BasemapStyle.ArcGISTopographic);
-
- // Create the graphics overlay and set the selection color
- _graphicsOverlay = new GraphicsOverlay();
-
- // Add the overlay to the MapView
- _myMapView.GraphicsOverlays.Add(_graphicsOverlay);
-
- // Create the point collection that defines the polygon
- PointCollection polygonPoints = new PointCollection(SpatialReferences.WebMercator)
- {
- new MapPoint(-5991501.677830, 5599295.131468),
- new MapPoint(-6928550.398185, 2087936.739807),
- new MapPoint(-3149463.800709, 1840803.011362),
- new MapPoint(-1563689.043184, 3714900.452072),
- new MapPoint(-3180355.516764, 5619889.608838)
- };
-
- // Create the polygon
- Polygon polygonGeometry = new Polygon(polygonPoints);
-
- // Define and apply the symbology
- SimpleLineSymbol polygonOutlineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Green, 2);
- SimpleFillSymbol polygonFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.ForwardDiagonal, Color.Green, polygonOutlineSymbol);
-
- // Create the graphic and add it to the graphics overlay
- _polygonGraphic = new Graphic(polygonGeometry, polygonFillSymbol);
- _graphicsOverlay.Graphics.Add(_polygonGraphic);
-
- // Create the graphics and symbology for the tapped point, the nearest vertex, and the nearest coordinate
- SimpleMarkerSymbol tappedLocationSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.X, Color.Orange, 15);
- SimpleMarkerSymbol nearestCoordinateSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Diamond, Color.Red, 10);
- SimpleMarkerSymbol nearestVertexSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, Color.Blue, 15);
- _nearestCoordinateGraphic = new Graphic { Symbol = nearestCoordinateSymbol };
- _tappedLocationGraphic = new Graphic { Symbol = tappedLocationSymbol };
- _nearestVertexGraphic = new Graphic { Symbol = nearestVertexSymbol };
-
- _graphicsOverlay.Graphics.Add(_tappedLocationGraphic);
- _graphicsOverlay.Graphics.Add(_nearestVertexGraphic);
- _graphicsOverlay.Graphics.Add(_nearestCoordinateGraphic);
-
- // Listen for taps; the spatial relationships will be updated in the handler
- _myMapView.GeoViewTapped += MapViewTapped;
-
- // Center the map on the polygon
- _myMapView.SetViewpointCenterAsync(polygonGeometry.Extent.GetCenter(), 200000000);
- }
-
- private void MapViewTapped(object sender, GeoViewInputEventArgs geoViewInputEventArgs)
- {
- // Get the tapped location
- MapPoint tappedLocation = (MapPoint)GeometryEngine.NormalizeCentralMeridian(geoViewInputEventArgs.Location);
-
- // Show the tapped location
- _tappedLocationGraphic.Geometry = tappedLocation;
-
- // Get the nearest vertex in the polygon
- ProximityResult nearestVertexResult = GeometryEngine.NearestVertex(_polygonGraphic.Geometry, tappedLocation);
-
- // Get the nearest coordinate in the polygon
- ProximityResult nearestCoordinateResult =
- GeometryEngine.NearestCoordinate(_polygonGraphic.Geometry, tappedLocation);
-
- // Get the distance to the nearest vertex in the polygon
- int distanceVertex = (int)(nearestVertexResult.Distance / 1000);
-
- // Get the distance to the nearest coordinate in the polygon
- int distanceCoordinate = (int)(nearestCoordinateResult.Distance / 1000);
-
- // Show the nearest vertex in blue
- _nearestVertexGraphic.Geometry = nearestVertexResult.Coordinate;
-
- // Show the nearest coordinate in red
- _nearestCoordinateGraphic.Geometry = nearestCoordinateResult.Coordinate;
-
- // Show the distances in the UI
- _resultTextView.Text = $"Vertex dist: {distanceVertex} km, Point dist: {distanceCoordinate} km";
- }
-
- private void CreateLayout()
- {
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create the result label
- _resultTextView = new TextView(this) { Text = "Tap to see the nearest vertex and point." };
-
- // Add the label and map to the view
- layout.AddView(_resultTextView);
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/NearestVertex/NearestVertex.jpg b/src/Android/Xamarin.Android/Samples/Geometry/NearestVertex/NearestVertex.jpg
deleted file mode 100644
index b6f5a7b163..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/NearestVertex/NearestVertex.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/NearestVertex/readme.md b/src/Android/Xamarin.Android/Samples/Geometry/NearestVertex/readme.md
deleted file mode 100644
index 3df801da41..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/NearestVertex/readme.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# Nearest vertex
-
-Find the closest vertex and coordinate of a geometry to a point.
-
-![Image of nearest vertex](NearestVertex.jpg)
-
-## Use case
-
-Determine the shortest distance between a location and the boundary of an area. For example, developers can snap imprecise user clicks to a geometry if the tap is within a certain distance of the geometry.
-
-## How to use the sample
-
-Tap anywhere on the map. An orange cross will show at that location. A blue circle will show the polygon's nearest vertex to the point that was clicked. A red diamond will appear at the coordinate on the geometry that is nearest to the point that was clicked. If clicked inside the geometry, the red and orange markers will overlap. The information box showing distance between the clicked point and the nearest vertex/coordinate will be updated with every new location clicked.
-
-## How it works
-
-1. Get a `Geometry` and a `Point` to check the nearest vertex against.
-2. Call `GeometryEngine.NearestVertex(inputGeometry, point)`.
-3. Use the returned `ProximityResult` to get the `Point` representing the polygon vertex, and to determine the distance between that vertex and the clicked point.
-4. Call `GeometryEngine.NearestCoordinate(inputGeometry, point)`.
-5. Use the returned `ProximityResult` to get the `Point` representing the coordinate on the polygon, and to determine the distance between that coordinate and the clicked point.
-
-## Relevant API
-
-* GeometryEngine
-* ProximityResult
-
-## Tags
-
-analysis, coordinate, geometry, nearest, proximity, vertex
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/NearestVertex/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/NearestVertex/readme.metadata.json
deleted file mode 100644
index ab6577f9a6..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/NearestVertex/readme.metadata.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "category": "Geometry",
- "description": "Find the closest vertex and coordinate of a geometry to a point.",
- "formal_name": "NearestVertex",
- "ignore": false,
- "images": [
- "NearestVertex.jpg"
- ],
- "keywords": [
- "analysis",
- "coordinate",
- "geometry",
- "nearest",
- "proximity",
- "vertex"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/nearestvertex.htm"
- ],
- "relevant_apis": [
- "GeometryEngine",
- "ProximityResult"
- ],
- "snippets": [
- "NearestVertex.cs"
- ],
- "title": "Nearest vertex"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/Project/Project.cs b/src/Android/Xamarin.Android/Samples/Geometry/Project/Project.cs
deleted file mode 100644
index f4a5913773..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/Project/Project.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System.Drawing;
-
-namespace ArcGISRuntimeXamarin.Samples.Project
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Project",
- category: "Geometry",
- description: "Project a point from one spatial reference to another.",
- instructions: "Tap anywhere on the map. A callout will display the clicked location's coordinate in the original (basemap's) spatial reference and in the projected spatial reference.",
- tags: new[] { "WGS 84", "Web Mercator", "coordinate system", "coordinates", "latitude", "longitude", "projected", "projection", "spatial reference" })]
- public class Project : Activity
- {
- // Create and hold reference to the used MapView.
- private MapView _myMapView;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Project";
-
- CreateLayout();
- Initialize();
- }
-
- private async void Initialize()
- {
- // Show a map in the default WebMercator spatial reference.
- _myMapView.Map = new Map(BasemapStyle.ArcGISTopographic);
-
- // Add a graphics overlay for showing the tapped point.
- GraphicsOverlay overlay = new GraphicsOverlay();
- SimpleMarkerSymbol markerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, Color.Red, 5);
- overlay.Renderer = new SimpleRenderer(markerSymbol);
- _myMapView.GraphicsOverlays.Add(overlay);
-
- // Respond to user taps.
- _myMapView.GeoViewTapped += MapView_Tapped;
-
- // Zoom to Minneapolis.
- Envelope startingEnvelope = new Envelope(-10995912.335747, 5267868.874421, -9880363.974046, 5960699.183877,
- SpatialReferences.WebMercator);
- await _myMapView.SetViewpointGeometryAsync(startingEnvelope);
- }
-
- private void MapView_Tapped(object sender, GeoViewInputEventArgs e)
- {
- // Get the tapped point - this is in the map's spatial reference,
- // which in this case is WebMercator because that is the SR used by the included basemaps.
- MapPoint tappedPoint = e.Location;
-
- // Update the graphics.
- _myMapView.GraphicsOverlays[0].Graphics.Clear();
- _myMapView.GraphicsOverlays[0].Graphics.Add(new Graphic(tappedPoint));
-
- // Project the point to WGS84
- MapPoint projectedPoint = (MapPoint) GeometryEngine.Project(tappedPoint, SpatialReferences.Wgs84);
-
- // Format the results in strings.
- string originalCoords = $"Original: {tappedPoint.X:F4}, {tappedPoint.Y:F4}";
- string projectedCoords = $"Projected: {projectedPoint.X:F4}, {projectedPoint.Y:F4}";
- string formattedString = $"{originalCoords}\n{projectedCoords}";
-
- // Define a callout and show it in the map view.
- CalloutDefinition calloutDef = new CalloutDefinition("Coordinates:", formattedString);
- _myMapView.ShowCalloutAt(tappedPoint, calloutDef);
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- var layout = new LinearLayout(this) {Orientation = Orientation.Vertical};
-
- // Add the map view to the layout.
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/Project/Project.jpg b/src/Android/Xamarin.Android/Samples/Geometry/Project/Project.jpg
deleted file mode 100644
index 71658b0534..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/Project/Project.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/Project/readme.md b/src/Android/Xamarin.Android/Samples/Geometry/Project/readme.md
deleted file mode 100644
index 0ee3a8f1eb..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/Project/readme.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# Project
-
-Project a point from one spatial reference to another.
-
-![Image of project](Project.jpg)
-
-## Use case
-
-Being able to project between spatial references is fundamental to a GIS. An example of when you would need to re-project data is if you had data in two different spatial references, but wanted to perform an intersect analysis with the `GeometryEngine.intersect` function. This function takes two geometries as parameters, and both geometries must be in the same spatial reference. If they are not, you could first use `GeometryEngine.project` to convert the geometries so they match.
-
-## How to use the sample
-
-Tap anywhere on the map. A callout will display the clicked location's coordinate in the original (basemap's) spatial reference and in the projected spatial reference.
-
-## How it works
-
-1. Call the static method, `GeometryEngine.Project`, passing in the original `Geometry` and a `SpatialReference` to which it should be projected.
-
-## Relevant API
-
-* GeometryEngine
-* Point
-* SpatialReference
-
-## Additional information
-
-In cases where the the output spatial reference uses a different geographic coordinate system than that of the input spatial reference, see the GeometryEngine.project method that additionally takes in a DatumTransformation parameter.
-
-## Tags
-
-coordinate system, coordinates, latitude, longitude, projected, projection, spatial reference, Web Mercator, WGS 84
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/Project/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/Project/readme.metadata.json
deleted file mode 100644
index e245844f5d..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/Project/readme.metadata.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "category": "Geometry",
- "description": "Project a point from one spatial reference to another.",
- "formal_name": "Project",
- "ignore": false,
- "images": [
- "Project.jpg"
- ],
- "keywords": [
- "WGS 84",
- "Web Mercator",
- "coordinate system",
- "coordinates",
- "latitude",
- "longitude",
- "projected",
- "projection",
- "spatial reference"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/project.htm"
- ],
- "relevant_apis": [
- "GeometryEngine",
- "Point",
- "SpatialReference"
- ],
- "snippets": [
- "Project.cs"
- ],
- "title": "Project"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ProjectWithSpecificTransformation/ProjectWithSpecificTransformation.cs b/src/Android/Xamarin.Android/Samples/Geometry/ProjectWithSpecificTransformation/ProjectWithSpecificTransformation.cs
deleted file mode 100644
index d7e8ce524a..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/ProjectWithSpecificTransformation/ProjectWithSpecificTransformation.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-
-namespace ArcGISRuntime.Samples.ProjectWithSpecificTransformation
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Project with specific transformation",
- category: "Geometry",
- description: "Project a point from one coordinate system to another using a specific transformation step.",
- instructions: "View the values for: unprojected point, projected with the GeometryEngine default, and projected with a specific transformation step.",
- tags: new[] { "coordinate system", "geographic", "project", "projection", "transform", "transformation", "transformation step" })]
- public class ProjectWithSpecificTransformation : Activity
- {
- // Label for showing the coordinates before projection
- private TextView _beforeLabel;
-
- // Label for showing the coordinates after projection with specific transformation
- private TextView _afterLabel;
-
- // Label for showing the coordinates after projection without specific transformation
- private TextView _nonSpecificLabel;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Project with specific transformation";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a point geometry in NYC in WGS84
- MapPoint startingPoint = new MapPoint(-73.984513, 40.748469, SpatialReferences.Wgs84);
-
- // Update the UI with the initial coordinates
- _beforeLabel.Text = $"x: {startingPoint.X}, y: {startingPoint.Y}";
-
- // Create a geographic transformation step for transform WKID 108055, WGS_1984_To_MSK_1942
- GeographicTransformationStep geoStep = new GeographicTransformationStep(108055);
-
- // Create the transformation
- GeographicTransformation geoTransform = new GeographicTransformation(geoStep);
-
- // Project to a coordinate system used in New York, NAD_1983_HARN_StatePlane_New_York_Central_FIPS_3102
- MapPoint afterPoint = (MapPoint)GeometryEngine.Project(startingPoint, SpatialReference.Create(2829), geoTransform);
-
- // Update the UI with the projected coordinates
- _afterLabel.Text = $"x: {afterPoint.X}, y: {afterPoint.Y}";
-
- // Perform the same projection without specified transformation
- MapPoint unspecifiedTransformPoint = (MapPoint)GeometryEngine.Project(startingPoint, SpatialReference.Create(2829));
-
- // Update the UI with the projection done without specific transform for comparison purposes
- _nonSpecificLabel.Text = $"x: {unspecifiedTransformPoint.X}, y: {unspecifiedTransformPoint.Y}";
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
- layout.SetPadding(10, 10, 10, 10);
-
- // Create the labels
- _beforeLabel = new TextView(this);
- _afterLabel = new TextView(this);
- _nonSpecificLabel = new TextView(this);
-
- // Create three more labels to label the output
- TextView beforeLabelTitle = new TextView(this)
- {
- Text = "Geometry before (WGS 84):"
- };
- TextView afterLabelTitle = new TextView(this)
- {
- Text = "\nGeometry to NAD_1983_HARN_StatePlane_New_York_Central_FIPS_3102 after WGS_1984_To_MSK_1942:"
- };
- TextView nonSpecificLabelTitle = new TextView(this)
- {
- Text = "\nGeometry to NAD_1983_HARN_StatePlane_New_York_Central_FIPS_3102 after (without specific transform):"
- };
-
- // Set layout background color.
- layout.SetBackgroundColor(Android.Graphics.Color.White);
-
- // Set the text color for all of the labels.
- beforeLabelTitle.SetTextColor(Android.Graphics.Color.Black);
- afterLabelTitle.SetTextColor(Android.Graphics.Color.Black);
- nonSpecificLabelTitle.SetTextColor(Android.Graphics.Color.Black);
-
- _beforeLabel.SetTextColor(Android.Graphics.Color.Black);
- _afterLabel.SetTextColor(Android.Graphics.Color.Black);
- _nonSpecificLabel.SetTextColor(Android.Graphics.Color.Black);
-
- // Add all labels to the layout
- layout.AddView(beforeLabelTitle);
- layout.AddView(_beforeLabel);
- layout.AddView(afterLabelTitle);
- layout.AddView(_afterLabel);
- layout.AddView(nonSpecificLabelTitle);
- layout.AddView(_nonSpecificLabel);
-
- // Show the layout in the app
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ProjectWithSpecificTransformation/ProjectWithSpecificTransformation.jpg b/src/Android/Xamarin.Android/Samples/Geometry/ProjectWithSpecificTransformation/ProjectWithSpecificTransformation.jpg
deleted file mode 100644
index 0a70393556..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/ProjectWithSpecificTransformation/ProjectWithSpecificTransformation.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ProjectWithSpecificTransformation/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/ProjectWithSpecificTransformation/readme.metadata.json
deleted file mode 100644
index 262f580802..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/ProjectWithSpecificTransformation/readme.metadata.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "category": "Geometry",
- "description": "Project a point from one coordinate system to another using a specific transformation step.",
- "formal_name": "ProjectWithSpecificTransformation",
- "ignore": false,
- "images": [
- "ProjectWithSpecificTransformation.jpg"
- ],
- "keywords": [
- "coordinate system",
- "geographic",
- "project",
- "projection",
- "transform",
- "transformation",
- "transformation step"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/projectwithspecifictransformation.htm"
- ],
- "relevant_apis": [
- "GeographicTransformation",
- "GeographicTransformationStep"
- ],
- "snippets": [
- "ProjectWithSpecificTransformation.cs"
- ],
- "title": "Project with specific transformation"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/SpatialOperations/SpatialOperations.cs b/src/Android/Xamarin.Android/Samples/Geometry/SpatialOperations/SpatialOperations.cs
deleted file mode 100644
index 8cff3f7d87..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/SpatialOperations/SpatialOperations.cs
+++ /dev/null
@@ -1,238 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System.Collections.Generic;
-using System.Drawing;
-
-namespace ArcGISRuntimeXamarin.Samples.SpatialOperations
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Perform spatial operations",
- category: "Geometry",
- description: "Find the union, intersection, or difference of two geometries.",
- instructions: "The sample provides an option to select a spatial operation. When an operation is selected, the resulting geometry is shown in red. The 'reset operation' button undoes the action and allow selecting a different operation.",
- tags: new[] { "analysis", "combine", "difference", "geometry", "intersection", "merge", "polygon", "union" })]
- public class SpatialOperations : Activity
- {
- // Hold a reference to the map view.
- private MapView _myMapView;
-
- // GraphicsOverlay to hold the polygon graphics.
- private GraphicsOverlay _polygonsOverlay;
-
- // Polygon graphics to run spatial operations on.
- private Graphic _graphicOne;
- private Graphic _graphicTwo;
-
- // Graphic to display the spatial operation result polygon.
- private Graphic _resultGraphic;
-
- // Picker control to choose a spatial operation.
- private Spinner _operationPicker;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Spatial operations";
-
- // Create the UI.
- CreateLayout();
-
- // Create a new map, add polygon graphics, and fill the spatial operations list.
- Initialize();
- }
-
- private void Initialize()
- {
- // Create the map with a gray canvas basemap and an initial location centered on London, UK.
- Map myMap = new Map(BasemapStyle.ArcGISLightGray);
- myMap.InitialViewpoint = new Viewpoint(51.5017, -0.12714, 20000);
-
- // Add the map to the map view.
- _myMapView.Map = myMap;
-
- // Create and add two overlapping polygon graphics to operate on.
- CreatePolygonsOverlay();
- }
-
- private void CreateLayout()
- {
- // Create a label to prompt for the spatial operation.
- TextView operationLabel = new TextView(this)
- {
- Text = "Choose a spatial operation:",
- TextAlignment = TextAlignment.ViewStart
- };
-
- // Create a list of spatial operations and use it to create an array adapter.
- List operationsList = new List { "", "Difference", "Intersection", "Symmetric difference", "Union" };
- ArrayAdapter operationsAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, operationsList);
-
- // Create a picker (Spinner) to show the list of operations.
- _operationPicker = new Spinner(this)
- {
- Adapter = operationsAdapter
- };
- _operationPicker.SetPadding(5, 10, 0, 10);
-
- // Handle the selection event to apply the selected operation.
- _operationPicker.ItemSelected += OperationsPicker_ItemSelected;
-
- // Create a button to clear the spatial operation result.
- Button resetOperationButton = new Button(this)
- {
- Text = "Reset"
- };
- resetOperationButton.Click += ResetOperationButton_Click;
-
- // Create a layout for the app tools.
- LinearLayout toolsLayout = new LinearLayout(this) { Orientation = Orientation.Vertical };
- toolsLayout.SetPadding(10, 0, 0, 0);
- toolsLayout.SetMinimumHeight(250);
-
- // Add the controls to the tools layout (label, picker, button).
- toolsLayout.AddView(operationLabel);
- toolsLayout.AddView(_operationPicker);
- toolsLayout.AddView(resetOperationButton);
-
- // Create a new vertical layout for the app UI.
- LinearLayout mainLayout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add the tools layout and map view to the main layout.
- mainLayout.AddView(toolsLayout);
- _myMapView = new MapView(this);
- mainLayout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(mainLayout);
- }
-
- private void ResetOperationButton_Click(object sender, System.EventArgs e)
- {
- // Remove any currently displayed result.
- _polygonsOverlay.Graphics.Remove(_resultGraphic);
-
- // Clear the selected spatial operation.
- _operationPicker.SetSelection(0);
- }
-
- private void OperationsPicker_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
- {
- // If an operation hasn't been selected, return.
- if (_operationPicker.SelectedItem.ToString() == "") { return; }
-
- // Remove any currently displayed result.
- _polygonsOverlay.Graphics.Remove(_resultGraphic);
-
- // Polygon geometry from the input graphics.
- Geometry polygonOne = _graphicOne.Geometry;
- Geometry polygonTwo = _graphicTwo.Geometry;
-
- // Result polygon for spatial operations.
- Geometry resultPolygon = null;
-
- // Run the selected spatial operation on the polygon graphics and get the result geometry.
- string selectedOperation = _operationPicker.SelectedItem.ToString();
- switch (selectedOperation)
- {
- case "Union":
- resultPolygon = GeometryEngine.Union(polygonOne, polygonTwo);
- break;
- case "Difference":
- resultPolygon = GeometryEngine.Difference(polygonOne, polygonTwo);
- break;
- case "Symmetric difference":
- resultPolygon = GeometryEngine.SymmetricDifference(polygonOne, polygonTwo);
- break;
- case "Intersection":
- resultPolygon = GeometryEngine.Intersection(polygonOne, polygonTwo);
- break;
- }
-
- // Create a black outline symbol to use for the result polygon.
- SimpleLineSymbol outlineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Black, 1);
-
- // Create a solid red fill symbol for the result polygon graphic.
- SimpleFillSymbol resultSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, Color.Red, outlineSymbol);
-
- // Create the result polygon graphic and add it to the graphics overlay.
- _resultGraphic = new Graphic(resultPolygon, resultSymbol);
- _polygonsOverlay.Graphics.Add(_resultGraphic);
- }
-
- private void CreatePolygonsOverlay()
- {
- // Create a black outline symbol to use for the polygons.
- SimpleLineSymbol outlineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Black, 1);
-
- // Create a point collection to define polygon vertices.
- PointCollection polygonVertices = new PointCollection(SpatialReferences.WebMercator)
- {
- new MapPoint(-13960, 6709400),
- new MapPoint(-14660, 6710000),
- new MapPoint(-13760, 6710730),
- new MapPoint(-13300, 6710500),
- new MapPoint(-13160, 6710100)
- };
-
- // Create a polygon graphic with a blue fill.
- SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Vertical, Color.Blue, outlineSymbol);
- Polygon polygonOne = new Polygon(polygonVertices);
- _graphicOne = new Graphic(polygonOne, fillSymbol);
-
- // Create a point collection to define outer polygon ring vertices.
- PointCollection outerRingVerticesCollection = new PointCollection(SpatialReferences.WebMercator)
- {
- new MapPoint(-13060, 6711030),
- new MapPoint(-12160, 6710730),
- new MapPoint(-13160, 6709700),
- new MapPoint(-14560, 6710730)
- };
-
- // Create a point collection to define inner polygon ring vertices ("donut hole").
- PointCollection innerRingVerticesCollection = new PointCollection(SpatialReferences.WebMercator)
- {
- new MapPoint(-13060, 6710910),
- new MapPoint(-14160, 6710630),
- new MapPoint(-13160, 6709900),
- new MapPoint(-12450, 6710660)
- };
-
- // Create a list to contain the inner and outer ring point collections.
- List polygonParts = new List
- {
- outerRingVerticesCollection,
- innerRingVerticesCollection
- };
-
- // Create a polygon graphic with a green fill.
- fillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Horizontal, Color.Green, outlineSymbol);
- _graphicTwo = new Graphic(new Polygon(polygonParts), fillSymbol);
-
- // Create a graphics overlay in the map view to hold the polygons.
- _polygonsOverlay = new GraphicsOverlay();
- _myMapView.GraphicsOverlays.Add(_polygonsOverlay);
-
- // Add the polygons to the graphics overlay.
- _polygonsOverlay.Graphics.Add(_graphicOne);
- _polygonsOverlay.Graphics.Add(_graphicTwo);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/SpatialOperations/SpatialOperations.jpg b/src/Android/Xamarin.Android/Samples/Geometry/SpatialOperations/SpatialOperations.jpg
deleted file mode 100644
index 514682d5db..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/SpatialOperations/SpatialOperations.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/SpatialOperations/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/SpatialOperations/readme.metadata.json
deleted file mode 100644
index 3edd911dd4..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/SpatialOperations/readme.metadata.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "category": "Geometry",
- "description": "Find the union, intersection, or difference of two geometries.",
- "formal_name": "SpatialOperations",
- "ignore": false,
- "images": [
- "SpatialOperations.jpg"
- ],
- "keywords": [
- "analysis",
- "combine",
- "difference",
- "geometry",
- "intersection",
- "merge",
- "polygon",
- "union"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/spatialoperations.htm"
- ],
- "relevant_apis": [
- "Geometry",
- "GeometryEngine",
- "GeometryEngine.Difference",
- "GeometryEngine.Intersection",
- "GeometryEngine.SymmetricDifference",
- "GeometryEngine.Union",
- "Graphic",
- "GraphicsOverlay"
- ],
- "snippets": [
- "SpatialOperations.cs"
- ],
- "title": "Perform spatial operations"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/SpatialRelationships/SpatialRelationships.cs b/src/Android/Xamarin.Android/Samples/Geometry/SpatialRelationships/SpatialRelationships.cs
deleted file mode 100644
index b966625fac..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/SpatialRelationships/SpatialRelationships.cs
+++ /dev/null
@@ -1,240 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using System;
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Linq;
-
-namespace ArcGISRuntime.Samples.SpatialRelationships
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Spatial relationships",
- category: "Geometry",
- description: "Determine spatial relationships between two geometries.",
- instructions: "Select one of the three graphics. The tree view will list the relationships the selected graphic has to the other graphic geometries.",
- tags: new[] { "geometries", "relationship", "spatial analysis" })]
- public class SpatialRelationships : Activity
- {
- private TextView _resultTextView;
- private MapView _myMapView;
-
- // References to the graphics and graphics overlay
- private GraphicsOverlay _graphicsOverlay;
-
- private Graphic _polygonGraphic;
- private Graphic _polylineGraphic;
- private Graphic _pointGraphic;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Spatial relationships";
-
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Configure the basemap
- _myMapView.Map = new Map(BasemapStyle.ArcGISTopographic);
-
- // Create the graphics overlay
- _graphicsOverlay = new GraphicsOverlay();
-
- // Add the overlay to the MapView
- _myMapView.GraphicsOverlays.Add(_graphicsOverlay);
-
- // Update the selection color
- _myMapView.SelectionProperties.Color = Color.Yellow;
-
- // Create the point collection that defines the polygon
- PointCollection polygonPoints = new PointCollection(SpatialReferences.WebMercator)
- {
- new MapPoint(-5991501.677830, 5599295.131468),
- new MapPoint(-6928550.398185, 2087936.739807),
- new MapPoint(-3149463.800709, 1840803.011362),
- new MapPoint(-1563689.043184, 3714900.452072),
- new MapPoint(-3180355.516764, 5619889.608838)
- };
-
- // Create the polygon
- Polygon polygonGeometry = new Polygon(polygonPoints);
-
- // Define the symbology of the polygon
- SimpleLineSymbol polygonOutlineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.Green, 2);
- SimpleFillSymbol polygonFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.ForwardDiagonal, System.Drawing.Color.Green, polygonOutlineSymbol);
-
- // Create the polygon graphic and add it to the graphics overlay
- _polygonGraphic = new Graphic(polygonGeometry, polygonFillSymbol);
- _graphicsOverlay.Graphics.Add(_polygonGraphic);
-
- // Create the point collection that defines the polyline
- PointCollection polylinePoints = new PointCollection(SpatialReferences.WebMercator)
- {
- new MapPoint(-4354240.726880, -609939.795721),
- new MapPoint(-3427489.245210, 2139422.933233),
- new MapPoint(-2109442.693501, 4301843.057130),
- new MapPoint(-1810822.771630, 7205664.366363)
- };
-
- // Create the polyline
- Polyline polylineGeometry = new Polyline(polylinePoints);
-
- // Create the polyline graphic and add it to the graphics overlay
- _polylineGraphic = new Graphic(polylineGeometry, new SimpleLineSymbol(SimpleLineSymbolStyle.Dash, System.Drawing.Color.Red, 4));
- _graphicsOverlay.Graphics.Add(_polylineGraphic);
-
- // Create the point geometry that defines the point graphic
- MapPoint pointGeometry = new MapPoint(-4487263.495911, 3699176.480377, SpatialReferences.WebMercator);
-
- // Define the symbology for the point
- SimpleMarkerSymbol locationMarker = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, System.Drawing.Color.Blue, 10);
-
- // Create the point graphic and add it to the graphics overlay
- _pointGraphic = new Graphic(pointGeometry, locationMarker);
- _graphicsOverlay.Graphics.Add(_pointGraphic);
-
- // Listen for taps; the spatial relationships will be updated in the handler
- _myMapView.GeoViewTapped += myMapView_GeoViewTapped;
-
- // Set the viewpoint to center on the point
- _myMapView.SetViewpointGeometryAsync(GeometryEngine.Union(polygonGeometry, polylineGeometry), 50);
- }
-
- private async void myMapView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
- {
- // Identify the tapped graphics
- IdentifyGraphicsOverlayResult result = null;
-
- try
- {
- result = await _myMapView.IdentifyGraphicsOverlayAsync(_graphicsOverlay, e.Position, 1, false);
- }
- catch (Exception ex)
- {
- new AlertDialog.Builder(this).SetMessage(ex.ToString()).SetTitle("Error").Show();
- }
-
- // Return if there are no results
- if (result == null || result.Graphics.Count < 1)
- {
- return;
- }
-
- // Get the first identified graphic
- Graphic identifiedGraphic = result.Graphics.First();
-
- // Clear any existing selection, then select the tapped graphic
- _graphicsOverlay.ClearSelection();
- identifiedGraphic.IsSelected = true;
-
- // Get the selected graphic's geometry
- Geometry selectedGeometry = identifiedGraphic.Geometry;
-
- // Perform the calculation and show the results
- _resultTextView.Text = GetOutputText(selectedGeometry);
- }
-
- private string GetOutputText(Geometry selectedGeometry)
- {
- string output = $"Selected: {selectedGeometry.GeometryType}\n";
-
- // Get the relationships
- List polygonRelationships = GetSpatialRelationships(selectedGeometry, _polygonGraphic.Geometry);
- List polylineRelationships = GetSpatialRelationships(selectedGeometry, _polylineGraphic.Geometry);
- List pointRelationships = GetSpatialRelationships(selectedGeometry, _pointGraphic.Geometry);
-
- // Add the point relationships to the output
- if (selectedGeometry.GeometryType != GeometryType.Point)
- {
- output += " Relationship(s) with Point:\n";
- foreach (SpatialRelationship relationship in pointRelationships)
- {
- output += $" {relationship}\n";
- }
- }
- // Add the polygon relationships to the output
- if (selectedGeometry.GeometryType != GeometryType.Polygon)
- {
- output += " Relationship(s) with Polygon:\n";
- foreach (SpatialRelationship relationship in polygonRelationships)
- {
- output += $" {relationship}\n";
- }
- }
- // Add the polyline relationships to the output
- if (selectedGeometry.GeometryType != GeometryType.Polyline)
- {
- output += " Relationship(s) with Polyline:\n";
- foreach (SpatialRelationship relationship in polylineRelationships)
- {
- output += $" {relationship}\n";
- }
- }
-
- return output.TrimEnd('\n');
- }
-
- ///
- /// Returns a list of spatial relationships between two geometries
- ///
- /// The 'a' in "a contains b"
- /// The 'b' in "a contains b"
- /// A list of spatial relationships that are true for a and b.
- private static List GetSpatialRelationships(Geometry a, Geometry b)
- {
- List relationships = new List();
- if (GeometryEngine.Crosses(a, b)) { relationships.Add(SpatialRelationship.Crosses); }
- if (GeometryEngine.Contains(a, b)) { relationships.Add(SpatialRelationship.Contains); }
- if (GeometryEngine.Disjoint(a, b)) { relationships.Add(SpatialRelationship.Disjoint); }
- if (GeometryEngine.Intersects(a, b)) { relationships.Add(SpatialRelationship.Intersects); }
- if (GeometryEngine.Overlaps(a, b)) { relationships.Add(SpatialRelationship.Overlaps); }
- if (GeometryEngine.Touches(a, b)) { relationships.Add(SpatialRelationship.Touches); }
- if (GeometryEngine.Within(a, b)) { relationships.Add(SpatialRelationship.Within); }
- return relationships;
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create a help label for the sample.
- TextView helpLabel = new TextView(this) { Gravity = GravityFlags.Center };
- helpLabel.Text = "Tap a graphic to select it. The display will update to show the relationships with the other graphics.";
-
- // Create a Textview for the results.
- _resultTextView = new TextView(this);
- _resultTextView.SetMinLines(7);
-
- //Add the labels to the layout.
- layout.AddView(helpLabel);
- layout.AddView(_resultTextView);
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/SpatialRelationships/SpatialRelationships.jpg b/src/Android/Xamarin.Android/Samples/Geometry/SpatialRelationships/SpatialRelationships.jpg
deleted file mode 100644
index d7764d4bc7..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geometry/SpatialRelationships/SpatialRelationships.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geometry/SpatialRelationships/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geometry/SpatialRelationships/readme.metadata.json
deleted file mode 100644
index c6f744a935..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geometry/SpatialRelationships/readme.metadata.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "category": "Geometry",
- "description": "Determine spatial relationships between two geometries.",
- "formal_name": "SpatialRelationships",
- "ignore": false,
- "images": [
- "SpatialRelationships.jpg"
- ],
- "keywords": [
- "geometries",
- "relationship",
- "spatial analysis"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/spatialrelationships.htm"
- ],
- "relevant_apis": [
- "Geometry",
- "GeometryEngine",
- "GeometryEngine.Contains",
- "GeometryEngine.Crosses",
- "GeometryEngine.Disjoint",
- "GeometryEngine.Intersects",
- "GeometryEngine.Overlaps",
- "GeometryEngine.Touches",
- "GeometryEngine.Within",
- "GeometryType",
- "Graphic",
- "Point",
- "Polygon",
- "Polyline"
- ],
- "snippets": [
- "SpatialRelationships.cs"
- ],
- "title": "Spatial relationships"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeHotspots/AnalyzeHotspots.cs b/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeHotspots/AnalyzeHotspots.cs
deleted file mode 100644
index 4459546689..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeHotspots/AnalyzeHotspots.cs
+++ /dev/null
@@ -1,316 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Tasks;
-using Esri.ArcGISRuntime.Tasks.Geoprocessing;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Threading.Tasks;
-
-namespace ArcGISRuntime.Samples.AnalyzeHotspots
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Analyze hotspots",
- category: "Geoprocessing",
- description: "Use a geoprocessing service and a set of features to identify statistically significant hot spots and cold spots.",
- instructions: "Select a date range (between 1998-01-01 and 1998-05-31) from the dialog and tap on Analyze. The results will be shown on the map upon successful completion of the `GeoprocessingJob`.",
- tags: new[] { "Geoprocessing", "GeoprocessingJob", "GeoprocessingParameters", "GeoprocessingResult" })]
- public class AnalyzeHotspots : Activity
- {
- // Hold a reference to the map view.
- private MapView _myMapView;
-
- // Button to define the start date for the date range.
- private Button _startDateButton;
-
- // Button to define the end date for the date range.
- private Button _endDateButton;
-
- // Alert dialog to show when the geoprocessing task is working.
- private AlertDialog _alert;
-
- // Url for the geoprocessing service.
- private const string _hotspotUrl = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/911CallsHotspot/GPServer/911%20Calls%20Hotspot";
-
- // The geoprocessing task for hot spot analysis.
- private GeoprocessingTask _hotspotTask;
-
- // The job that handles the communication between the application and the geoprocessing task.
- private GeoprocessingJob _hotspotJob;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Analyze Hotspots";
-
- // Create the UI, setup the control references and execute initialization .
- CreateLayout();
- Initialize();
- }
-
- private async void Initialize()
- {
- // Create a map with a topographic basemap.
- _myMapView.Map = new Map(BasemapStyle.ArcGISTopographic);
-
- try
- {
- // Create a new geoprocessing task.
- _hotspotTask = await GeoprocessingTask.CreateAsync(new Uri(_hotspotUrl));
-
- // Zoom into Portland, Oregon.
- await _myMapView.SetViewpointCenterAsync(new MapPoint(-122.66, 45.52, SpatialReferences.Wgs84), 1000000);
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private async void OnRunAnalysisClicked(object sender, EventArgs e)
- {
- // Get the 'from' and 'to' dates from the date edit text's for the geoprocessing analysis.
- DateTime myFromDate;
- DateTime myToDate;
-
- try
- {
- myFromDate = Convert.ToDateTime(_startDateButton.Text);
- myToDate = Convert.ToDateTime(_endDateButton.Text);
- }
- catch (Exception exception)
- {
- // Show error message and quit.
- new AlertDialog.Builder(this).SetMessage(exception.Message).Show();
- return;
- }
-
- // Clear any existing results.
- _myMapView.Map.OperationalLayers.Clear();
-
- // Show busy activity indication.
- _alert.Show();
-
- // The end date must be at least one day after the start date.
- if (myToDate <= myFromDate.AddDays(1))
- {
- _alert.Cancel();
-
- // Show error message.
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Invalid date range");
- alertBuilder.SetMessage("Please select valid time range.There has to be at least one day in between To and From dates.");
- alertBuilder.Show();
- return;
- }
-
- // Create the parameters that are passed to the used geoprocessing task.
- GeoprocessingParameters myHotspotParameters = new GeoprocessingParameters(GeoprocessingExecutionType.AsynchronousSubmit);
-
- // Construct the date query.
- string myQueryString = $"(\"DATE\" > date '{myFromDate:yyyy-MM-dd} 00:00:00' AND \"DATE\" < date '{myToDate:yyyy-MM-dd} 00:00:00')";
-
- // Add the query that contains the date range used in the analysis.
- myHotspotParameters.Inputs.Add("Query", new GeoprocessingString(myQueryString));
-
- // Create job that handles the communication between the application and the geoprocessing task.
- _hotspotJob = _hotspotTask.CreateJob(myHotspotParameters);
- try
- {
- // Execute the geoprocessing analysis and wait for the results.
- GeoprocessingResult myAnalysisResult = await _hotspotJob.GetResultAsync();
-
- // Add results to a map using map server from a geoprocessing task.
- // Load to get access to full extent.
- await myAnalysisResult.MapImageLayer.LoadAsync();
-
- // Add the analysis layer to the map view.
- _myMapView.Map.OperationalLayers.Add(myAnalysisResult.MapImageLayer);
-
- // Zoom to the results.
- await _myMapView.SetViewpointAsync(new Viewpoint(myAnalysisResult.MapImageLayer.FullExtent));
-
- // Remove the loading alert dialog.
- _alert.Cancel();
- }
- catch (TaskCanceledException)
- {
- // This is thrown if the task is canceled. Ignore.
- }
- catch (Exception ex)
- {
- // Remove the loading alert dialog.
- _alert.Cancel();
-
- // Display error messages if the geoprocessing task fails.
- if (_hotspotJob.Status == JobStatus.Failed && _hotspotJob.Error != null)
- {
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Geoprocessing error");
- alertBuilder.SetMessage("Executing geoprocessing failed. " + _hotspotJob.Error.Message);
- alertBuilder.Show();
- }
- else
- {
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Sample error");
- alertBuilder.SetMessage("An error occurred. " + ex.ToString());
- alertBuilder.Show();
- }
- }
- }
-
- private void OnDateClicked(object sender, EventArgs a)
- {
- // Get the date from the button text.
- DateTime buttonDate = Convert.ToDateTime(((Button)sender).Text);
-
- // Create a new DatePickerDialog using the date from the button.
- DatePickerDialog dialog = new DatePickerDialog(this, (EventHandler)null, buttonDate.Year, buttonDate.Month - 1, buttonDate.Day);
-
- // Add an event handler that changes the button text when a date is picked.
- dialog.DateSet += (s, e) => { ((Button)sender).Text = e.Date.ToShortDateString(); };
-
- // Display the dialog to the user.
- dialog.Show();
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- LinearLayout.LayoutParams buttonParam = new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.MatchParent,
- ViewGroup.LayoutParams.MatchParent,
- 1.0f
- );
- LinearLayout.LayoutParams labelParam = new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.MatchParent,
- ViewGroup.LayoutParams.MatchParent,
- 3.0f
- );
-
- // Create a horizontal sub layout for the start date.
- LinearLayout startDateSubLayout = new LinearLayout(this) { Orientation = Orientation.Horizontal };
-
- // Label for the start date.
- TextView startDateLabel = new TextView(this)
- {
- Text = "Start Date:",
- LayoutParameters = labelParam,
- Gravity = GravityFlags.Center
- };
- startDateSubLayout.AddView(startDateLabel);
-
- // Button for the start date.
- _startDateButton = new Button(this)
- {
- Text = "1/01/1998",
- LayoutParameters = buttonParam
- };
- _startDateButton.Click += OnDateClicked;
- startDateSubLayout.AddView(_startDateButton);
-
- // Add the start date information to the general layout.
- layout.AddView(startDateSubLayout);
-
- // Create a horizontal sub layout for the end date.
- LinearLayout endDateSubLayout = new LinearLayout(this) { Orientation = Orientation.Horizontal };
-
- // Label for the end date.
- TextView endDateLabel = new TextView(this)
- {
- Text = "End Date:",
- LayoutParameters = labelParam,
- Gravity = GravityFlags.Center
- };
-
- endDateSubLayout.AddView(endDateLabel);
-
- // Button for the end date.
- _endDateButton = new Button(this)
- {
- Text = "1/31/1998",
- LayoutParameters = buttonParam
- };
- _endDateButton.Click += OnDateClicked;
- endDateSubLayout.AddView(_endDateButton);
-
- // Add the start date information to the general layout.
- layout.AddView(endDateSubLayout);
-
- // Add a button to the run the hot spot analysis; wire up the click event as well
- Button mapsButton = new Button(this)
- {
- Text = "Run Analysis"
- };
- mapsButton.Click += OnRunAnalysisClicked;
- layout.AddView(mapsButton);
-
- // Create a layout to be used to alert the user when processing is happening.
- LinearLayout alertLayout = new LinearLayout(this)
- {
- Orientation = Orientation.Vertical
- };
-
- // Create paramaters for the items in the alert layout.
- LinearLayout.LayoutParams alertParam = new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.MatchParent,
- ViewGroup.LayoutParams.MatchParent,
- 1.0f
- );
- alertParam.SetMargins(0, 10, 0, 10);
-
- // Text for the processing alert.
- TextView processingText = new TextView(this)
- {
- Text = "Processing...",
- LayoutParameters = alertParam,
- Gravity = GravityFlags.Center,
- };
-
- // Add the progress bar to indicate the geoprocessing task is running.
- ProgressBar progressBar = new ProgressBar(this)
- {
- Indeterminate = true,
- LayoutParameters = alertParam,
- TextAlignment = TextAlignment.Center
- };
-
- // Add the text and progress bar to the Linear Layout.
- alertLayout.AddView(processingText);
- alertLayout.AddView(progressBar);
-
- // Create the alert dialog.
- _alert = new AlertDialog.Builder(this).Create();
- _alert.SetCanceledOnTouchOutside(false);
- _alert.Show();
- _alert.Cancel();
-
- // Add the layout to the alert.
- _alert.AddContentView(alertLayout, buttonParam);
-
- // Add the map view to the layout.
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeHotspots/AnalyzeHotspots.jpg b/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeHotspots/AnalyzeHotspots.jpg
deleted file mode 100644
index 5c8788e707..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeHotspots/AnalyzeHotspots.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeHotspots/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeHotspots/readme.metadata.json
deleted file mode 100644
index 17b29e0115..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeHotspots/readme.metadata.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "category": "Geoprocessing",
- "description": "Use a geoprocessing service and a set of features to identify statistically significant hot spots and cold spots.",
- "formal_name": "AnalyzeHotspots",
- "ignore": false,
- "images": [
- "AnalyzeHotspots.jpg"
- ],
- "keywords": [
- "Geoprocessing",
- "GeoprocessingJob",
- "GeoprocessingParameters",
- "GeoprocessingResult"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/analyzehotspots.htm"
- ],
- "relevant_apis": [
- "GeoprocessingJob",
- "GeoprocessingParameters",
- "GeoprocessingResult",
- "GeoprocessingTask"
- ],
- "snippets": [
- "AnalyzeHotspots.cs"
- ],
- "title": "Analyze hotspots"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeViewshed/AnalyzeViewshed.cs b/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeViewshed/AnalyzeViewshed.cs
deleted file mode 100644
index b140b7e1f8..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeViewshed/AnalyzeViewshed.cs
+++ /dev/null
@@ -1,309 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.Tasks;
-using Esri.ArcGISRuntime.Tasks.Geoprocessing;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace ArcGISRuntime.Samples.AnalyzeViewshed
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Analyze viewshed (geoprocessing)",
- category: "Geoprocessing",
- description: "Calculate a viewshed using a geoprocessing service, in this case showing what parts of a landscape are visible from points on mountainous terrain.",
- instructions: "Tap the map to see all areas visible from that point within a 15km radius. Clicking on an elevated area will highlight a larger part of the surrounding landscape. It may take a few seconds for the task to run and send back the results.",
- tags: new[] { "geoprocessing", "heat map", "heatmap", "viewshed" })]
- public class AnalyzeViewshed : Activity
- {
- // Hold a reference to the map view.
- private MapView _myMapView;
-
- // Url for the geoprocessing service
- private const string _viewshedUrl = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Elevation/ESRI_Elevation_World/GPServer/Viewshed";
-
- // The graphics overlay to show where the user clicked in the map.
- private GraphicsOverlay _inputOverlay;
-
- // The graphics overlay to display the result of the viewshed analysis.
- private GraphicsOverlay _resultOverlay;
-
- // Alert dialog to show when the geoprocessing task is working.
- private AlertDialog _alert;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Viewshed (Geoprocessing)";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a map with topographic basemap and an initial location
- Map myMap = new Map(BasemapStyle.ArcGISTopographic);
- myMap.InitialViewpoint = new Viewpoint(45.3790902612337, 6.84905317262762, 70000);
-
- // Hook into the MapView tapped event
- _myMapView.GeoViewTapped += MyMapView_GeoViewTapped;
-
- // Create empty overlays for the user clicked location and the results of the viewshed analysis
- CreateOverlays();
-
- // Assign the map to the MapView
- _myMapView.Map = myMap;
- }
-
- private async void MyMapView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
- {
- // Indicate that the geoprocessing is running
- SetBusy();
-
- // Clear previous user click location and the viewshed geoprocessing task results
- _inputOverlay.Graphics.Clear();
- _resultOverlay.Graphics.Clear();
-
- // Get the tapped point
- MapPoint geometry = e.Location;
-
- // Create a marker graphic where the user clicked on the map and add it to the existing graphics overlay
- Graphic myInputGraphic = new Graphic(geometry);
- _inputOverlay.Graphics.Add(myInputGraphic);
-
- // Normalize the geometry if wrap-around is enabled
- // This is necessary because of how wrapped-around map coordinates are handled by Runtime
- // Without this step, the task may fail because wrapped-around coordinates are out of bounds.
- if (_myMapView.IsWrapAroundEnabled) { geometry = (MapPoint)GeometryEngine.NormalizeCentralMeridian(geometry); }
-
- try
- {
- // Execute the geoprocessing task using the user click location
- await CalculateViewshed(geometry);
- }
- catch (Exception ex)
- {
- new AlertDialog.Builder(this).SetMessage(ex.ToString()).SetTitle("Error").Show();
- }
- }
-
- private async Task CalculateViewshed(MapPoint location)
- {
- // This function will define a new geoprocessing task that performs a custom viewshed analysis based upon a
- // user click on the map and then display the results back as a polygon fill graphics overlay. If there
- // is a problem with the execution of the geoprocessing task an error message will be displayed
-
- // Create new geoprocessing task using the url defined in the member variables section
- GeoprocessingTask myViewshedTask = await GeoprocessingTask.CreateAsync(new Uri(_viewshedUrl));
-
- // Create a new feature collection table based upon point geometries using the current map view spatial reference
- FeatureCollectionTable myInputFeatures = new FeatureCollectionTable(new List(), GeometryType.Point, _myMapView.SpatialReference);
-
- // Create a new feature from the feature collection table. It will not have a coordinate location (x,y) yet
- Feature myInputFeature = myInputFeatures.CreateFeature();
-
- // Assign a physical location to the new point feature based upon where the user clicked in the map view
- myInputFeature.Geometry = location;
-
- // Add the new feature with (x,y) location to the feature collection table
- await myInputFeatures.AddFeatureAsync(myInputFeature);
-
- // Create the parameters that are passed to the used geoprocessing task
- GeoprocessingParameters myViewshedParameters =
- new GeoprocessingParameters(GeoprocessingExecutionType.AsynchronousSubmit)
- {
- // Request the output features to use the same SpatialReference as the map view
- OutputSpatialReference = _myMapView.SpatialReference
- };
-
- // Add an input location to the geoprocessing parameters
- myViewshedParameters.Inputs.Add("Input_Observation_Point", new GeoprocessingFeatures(myInputFeatures));
-
- // Create the job that handles the communication between the application and the geoprocessing task
- GeoprocessingJob myViewshedJob = myViewshedTask.CreateJob(myViewshedParameters);
-
- try
- {
- // Execute analysis and wait for the results
- GeoprocessingResult myAnalysisResult = await myViewshedJob.GetResultAsync();
-
- // Get the results from the outputs
- GeoprocessingFeatures myViewshedResultFeatures = (GeoprocessingFeatures)myAnalysisResult.Outputs["Viewshed_Result"];
-
- // Add all the results as a graphics to the map
- IFeatureSet myViewshedAreas = myViewshedResultFeatures.Features;
- foreach (Feature myFeature in myViewshedAreas)
- {
- _resultOverlay.Graphics.Add(new Graphic(myFeature.Geometry));
- }
- }
- catch (Exception ex)
- {
- // Display an error message if there is a problem
- if (myViewshedJob.Status == JobStatus.Failed && myViewshedJob.Error != null)
- {
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Geoprocessing error");
- alertBuilder.SetMessage("Executing geoprocessing failed. " + myViewshedJob.Error.Message);
- alertBuilder.Show();
- }
- else
- {
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Sample error");
- alertBuilder.SetMessage("An error occurred. " + ex);
- alertBuilder.Show();
- }
- }
- finally
- {
- // Indicate that the geoprocessing is not running
- SetBusy(false);
- }
- }
-
- private void CreateOverlays()
- {
- // This function will create the overlays that show the user clicked location and the results of the
- // viewshed analysis. Note: the overlays will not be populated with any graphics at this point
-
- // Create renderer for input graphic. Set the size and color properties for the simple renderer
- SimpleRenderer myInputRenderer = new SimpleRenderer()
- {
- Symbol = new SimpleMarkerSymbol()
- {
- Size = 15,
-
- // Account for the Color differences supported by the various platforms
- Color = System.Drawing.Color.Red
- }
- };
-
- // Create overlay to where input graphic is shown
- _inputOverlay = new GraphicsOverlay()
- {
- Renderer = myInputRenderer
- };
-
- // Create fill renderer for output of the viewshed analysis. Set the color property of the simple renderer
- SimpleRenderer myResultRenderer = new SimpleRenderer()
- {
- Symbol = new SimpleFillSymbol()
- {
- Color = System.Drawing.Color.FromArgb(100, 226, 119, 40)
- }
- };
-
- // Create overlay to where viewshed analysis graphic is shown
- _resultOverlay = new GraphicsOverlay()
- {
- Renderer = myResultRenderer
- };
-
- // Add the created overlays to the MapView
- _myMapView.GraphicsOverlays.Add(_inputOverlay);
- _myMapView.GraphicsOverlays.Add(_resultOverlay);
- }
-
- private void SetBusy(bool isBusy = true)
- {
- // This function toggles running of the 'progress' control feedback status to denote if
- // the viewshed analysis is executing as a result of the user click on the map.
- if (isBusy)
- {
- // Show the busy alert dialog.
- _alert.Show();
- }
- else
- {
- // Remove the busy alert dialog.
- _alert.Hide();
- }
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Label for the user instructions
- TextView textview_Label1 = new TextView(this)
- {
- Text = "Click a location on the map to perform the viewshed analysis."
- };
- layout.AddView(textview_Label1);
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
-
- // Create a layout to be used to alert the user when processing is happening.
- LinearLayout alertLayout = new LinearLayout(this)
- {
- Orientation = Orientation.Vertical
- };
-
- // Create paramaters for the items in the alert layout.
- LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.MatchParent,
- ViewGroup.LayoutParams.MatchParent,
- 1.0f
- );
- param.SetMargins(0, 10, 0, 10);
-
- // Text for the alert.
- TextView processingText = new TextView(this)
- {
- Text = "Processing...",
- LayoutParameters = param,
- Gravity = GravityFlags.Center,
- };
-
- // Add the progress bar to indicate the geoprocessing task is running; make invisible by default
- ProgressBar progressBar = new ProgressBar(this)
- {
- Indeterminate = true,
- //Visibility = ViewStates.Invisible,
- LayoutParameters = param,
- TextAlignment = TextAlignment.Center
- };
-
- // Add the text and progress bar to the Linear Layout.
- alertLayout.AddView(processingText);
- alertLayout.AddView(progressBar);
-
- // Create the alert dialog.
- _alert = new AlertDialog.Builder(this).Create();
- _alert.SetCanceledOnTouchOutside(false);
- _alert.Show();
- _alert.Cancel();
-
- // Add the layout to the alert
- _alert.AddContentView(alertLayout, param);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeViewshed/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeViewshed/readme.metadata.json
deleted file mode 100644
index db1511c675..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geoprocessing/AnalyzeViewshed/readme.metadata.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "category": "Geoprocessing",
- "description": "Calculate a viewshed using a geoprocessing service, in this case showing what parts of a landscape are visible from points on mountainous terrain.",
- "formal_name": "AnalyzeViewshed",
- "ignore": false,
- "images": [
- "AnalyzeViewshed.jpg"
- ],
- "keywords": [
- "geoprocessing",
- "heat map",
- "heatmap",
- "viewshed"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/analyzeviewshed.htm"
- ],
- "relevant_apis": [
- "FeatureCollectionTable",
- "GeoprocessingFeatures",
- "GeoprocessingJob",
- "GeoprocessingParameters",
- "GeoprocessingResult",
- "GeoprocessingTask"
- ],
- "snippets": [
- "AnalyzeViewshed.cs"
- ],
- "title": "Analyze viewshed (geoprocessing)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geoprocessing/ListGeodatabaseVersions/ListGeodatabaseVersions.cs b/src/Android/Xamarin.Android/Samples/Geoprocessing/ListGeodatabaseVersions/ListGeodatabaseVersions.cs
deleted file mode 100644
index 66abdf6212..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geoprocessing/ListGeodatabaseVersions/ListGeodatabaseVersions.cs
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright 2020 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Tasks;
-using Esri.ArcGISRuntime.Tasks.Geoprocessing;
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ArcGISRuntime.Samples.ListGeodatabaseVersions
-{
- [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "List geodatabase versions",
- category: "Geoprocessing",
- description: "Connect to a service and list versions of the geodatabase.",
- instructions: "When the sample loads, a list of geodatabase versions and their properties will be displayed.",
- tags: new[] { "conflict resolution", "data management", "database", "multi-user", "sync", "version" })]
- [Shared.Attributes.AndroidLayout("ListGeodatabaseVersions.axml")]
- public class ListGeodatabaseVersions : Activity
- {
- // Progress bar to show when the geoprocessing task is working
- private ProgressBar _myProgressBar;
-
- // Edit text to display the list of geodatabases
- private TextView _geoDatabaseText;
-
- // Url to used geoprocessing service
- private const string ListVersionsUrl =
- "https://sampleserver6.arcgisonline.com/arcgis/rest/services/GDBVersions/GPServer/ListVersions";
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "List geodatabase versions";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private async void Initialize()
- {
- // Set the UI to indicate that the geoprocessing is running
- SetBusy(true);
-
- try
- {
- // Get versions from a geodatabase
- IFeatureSet versionsFeatureSet = await GetGeodatabaseVersionsAsync();
-
- // Continue if we got a valid geoprocessing result
- if (versionsFeatureSet != null)
- {
- // Create a string builder to hold all of the information from the geoprocessing
- // task to display in the UI
- StringBuilder myStringBuilder = new StringBuilder();
-
- // Loop through each Feature in the FeatureSet
- foreach (Feature version in versionsFeatureSet)
- {
- // Get the attributes (a dictionary of pairs) from the Feature
- IDictionary myDictionary = version.Attributes;
-
- // Loop through each attribute (a pair)
- foreach (KeyValuePair attribute in myDictionary)
- {
- // Add the key and value strings to the string builder
- myStringBuilder.AppendLine(attribute.Key + ": " + attribute.Value);
- }
-
- // Add a blank line after each Feature (the listing of geodatabase versions)
- myStringBuilder.AppendLine();
- }
-
- // Display the results to the user
- _geoDatabaseText.Text = myStringBuilder.ToString();
- }
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
-
- // Set the UI to indicate that the geoprocessing is not running
- SetBusy(false);
- }
-
- private async Task GetGeodatabaseVersionsAsync()
- {
- // Results will be returned as a feature set
- IFeatureSet results = null;
-
- // Create new geoprocessing task
- GeoprocessingTask listVersionsTask = await GeoprocessingTask.CreateAsync(new Uri(ListVersionsUrl));
-
- // Create default parameters that are passed to the geoprocessing task
- GeoprocessingParameters listVersionsParameters = await listVersionsTask.CreateDefaultParametersAsync();
-
- // Create job that handles the communication between the application and the geoprocessing task
- GeoprocessingJob listVersionsJob = listVersionsTask.CreateJob(listVersionsParameters);
- try
- {
- // Execute analysis and wait for the results
- GeoprocessingResult analysisResult = await listVersionsJob.GetResultAsync();
-
- // Get results from the outputs
- GeoprocessingFeatures listVersionsResults = (GeoprocessingFeatures)analysisResult.Outputs["Versions"];
-
- // Set results
- results = listVersionsResults.Features;
- }
- catch (Exception ex)
- {
- // Error handling if something goes wrong
- if (listVersionsJob.Status == JobStatus.Failed && listVersionsJob.Error != null)
- {
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Geoprocessing error");
- alertBuilder.SetMessage("Executing geoprocessing failed. " + listVersionsJob.Error.Message);
- alertBuilder.Show();
- }
- else
- {
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Sample error");
- alertBuilder.SetMessage("An error occurred. " + ex.ToString());
- alertBuilder.Show();
- }
- }
- finally
- {
- // Set the UI to indicate that the geoprocessing is not running
- SetBusy(false);
- }
-
- return results;
- }
-
- private void SetBusy(bool isBusy = true)
- {
- // This function toggles running of the 'progress' control feedback status to denote if
- // the viewshed analysis is executing as a result of the user click on the map
-
- if (isBusy)
- {
- // Show busy activity indication
- _myProgressBar.Visibility = ViewStates.Visible;
- }
- else
- {
- // Remove the busy activity indication
- _myProgressBar.Visibility = ViewStates.Invisible;
- }
- }
-
- private void CreateLayout()
- {
- // Load the layout from the axml resource.
- SetContentView(Resource.Layout.ListGeodatabaseVersions);
-
- _myProgressBar = FindViewById(Resource.Id.progressBar);
- _geoDatabaseText = FindViewById(Resource.Id.geoDatabaseText);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Geoprocessing/ListGeodatabaseVersions/ListGeodatabaseVersions.jpg b/src/Android/Xamarin.Android/Samples/Geoprocessing/ListGeodatabaseVersions/ListGeodatabaseVersions.jpg
deleted file mode 100644
index 6f1082cdce..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Geoprocessing/ListGeodatabaseVersions/ListGeodatabaseVersions.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Geoprocessing/ListGeodatabaseVersions/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Geoprocessing/ListGeodatabaseVersions/readme.metadata.json
deleted file mode 100644
index 888c66a932..0000000000
--- a/src/Android/Xamarin.Android/Samples/Geoprocessing/ListGeodatabaseVersions/readme.metadata.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "category": "Geoprocessing",
- "description": "Connect to a service and list versions of the geodatabase.",
- "formal_name": "ListGeodatabaseVersions",
- "ignore": false,
- "images": [
- "ListGeodatabaseVersions.jpg"
- ],
- "keywords": [
- "conflict resolution",
- "data management",
- "database",
- "multi-user",
- "sync",
- "version"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/listgeodatabaseversions.htm"
- ],
- "relevant_apis": [
- "GeoprocessingFeatures",
- "GeoprocessingFeatures.Features",
- "GeoprocessingJob",
- "GeoprocessingJob.GetResultAsync",
- "GeoprocessingParameters",
- "GeoprocessingResult",
- "GeoprocessingResult.Outputs",
- "GeoprocessingTask",
- "GeoprocessingTask.CreateDefaultParametersAsync",
- "GeoprocessingTask.CreateJob"
- ],
- "snippets": [
- "../../../Resources/layout/ListGeodatabaseVersions.axml",
- "ListGeodatabaseVersions.cs"
- ],
- "title": "List geodatabase versions"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsRenderer/AddGraphicsRenderer.cs b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsRenderer/AddGraphicsRenderer.cs
deleted file mode 100644
index 0d278a04ff..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsRenderer/AddGraphicsRenderer.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-// Copyright 2021 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Drawing;
-
-namespace ArcGISRuntime.Samples.AddGraphicsRenderer
-{
- [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Add graphics with renderer",
- category: "GraphicsOverlay",
- description: "A renderer allows you to change the style of all graphics in a graphics overlay by referencing a single symbol style. A renderer will only affect graphics that do not specify their own symbol style.",
- instructions: "Pan and zoom on the map to view graphics for points, lines, and polygons (including polygons with curve segments) which are stylized using renderers.",
- tags: new[] { "arc", "bezier", "curve", "display", "graphics", "marker", "overlay", "renderer", "segment", "symbol", "true curve" })]
- public class AddGraphicsRenderer : Activity
- {
- // Hold a reference to the map view.
- private MapView _myMapView;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Add graphics wih renderer";
-
- // Create the UI, setup the control references and execute initialization.
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a map for the map view.
- _myMapView.Map = new Map(BasemapStyle.ArcGISTopographic);
-
- // Add graphics overlays to the map view.
- _myMapView.GraphicsOverlays.AddRange(new[]
- {
- MakePointGraphicsOverlay(),
- MakeLineGraphicsOverlay(),
- MakeSquareGraphicsOverlay(),
- MakeCurvedGraphicsOverlay(),
- });
- }
-
- private GraphicsOverlay MakePointGraphicsOverlay()
- {
- // Create a simple marker symbol.
- SimpleMarkerSymbol pointSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Diamond, Color.Green, 10);
-
- // Create a graphics overlay for the points.
- GraphicsOverlay pointGraphicsOverlay = new GraphicsOverlay();
-
- // Create and assign a simple renderer to the graphics overlay.
- pointGraphicsOverlay.Renderer = new SimpleRenderer(pointSymbol);
-
- // Create a graphic with the map point geometry.
- MapPoint pointGeometry = new MapPoint(x: 40e5, y: 40e5, SpatialReferences.WebMercator);
- Graphic pointGraphic = new Graphic(pointGeometry);
-
- // Add the graphic to the overlay.
- pointGraphicsOverlay.Graphics.Add(pointGraphic);
- return pointGraphicsOverlay;
- }
-
- private GraphicsOverlay MakeLineGraphicsOverlay()
- {
- // Create a simple line symbol.
- SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Blue, 5);
-
- // Create a graphics overlay for the polylines.
- GraphicsOverlay lineGraphicsOverlay = new GraphicsOverlay();
-
- // Create and assign a simple renderer to the graphics overlay.
- lineGraphicsOverlay.Renderer = new SimpleRenderer(lineSymbol);
-
- // Create a line graphic with new Polyline geometry.
- PolylineBuilder lineBuilder = new PolylineBuilder(SpatialReferences.WebMercator);
- lineBuilder.AddPoint(x: -10e5, y: 40e5);
- lineBuilder.AddPoint(x: 20e5, y: 50e5);
- Graphic lineGraphic = new Graphic(lineBuilder.ToGeometry());
-
- // Add the graphic to the overlay.
- lineGraphicsOverlay.Graphics.Add(lineGraphic);
- return lineGraphicsOverlay;
- }
-
- private GraphicsOverlay MakeSquareGraphicsOverlay()
- {
- // Create a simple fill symbol.
- SimpleFillSymbol squareSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, Color.Yellow, null);
-
- // Create a graphics overlay for the square polygons.
- GraphicsOverlay squareGraphicsOverlay = new GraphicsOverlay();
-
- // Create and assign a simple renderer to the graphics overlay.
- squareGraphicsOverlay.Renderer = new SimpleRenderer(squareSymbol);
-
- // Create a polygon graphic with `new Polygon` geometry.
- PolygonBuilder polygonBuilder = new PolygonBuilder(SpatialReferences.WebMercator);
- polygonBuilder.AddPoint(x: -20e5, y: 20e5);
- polygonBuilder.AddPoint(x: 20e5, y: 20e5);
- polygonBuilder.AddPoint(x: 20e5, y: -20e5);
- polygonBuilder.AddPoint(x: -20e5, y: -20e5);
- Graphic polygonGraphic = new Graphic(polygonBuilder.ToGeometry());
-
- // Add the graphic to the overlay.
- squareGraphicsOverlay.Graphics.Add(polygonGraphic);
- return squareGraphicsOverlay;
- }
-
- private GraphicsOverlay MakeCurvedGraphicsOverlay()
- {
- // Create a simple fill symbol with outline.
- SimpleLineSymbol curvedLineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Black, 1);
- SimpleFillSymbol curvedFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, Color.Red, curvedLineSymbol);
-
- // Create a graphics overlay for the polygons with curve segments.
- GraphicsOverlay curvedGraphicsOverlay = new GraphicsOverlay();
-
- // Create and assign a simple renderer to the graphics overlay.
- curvedGraphicsOverlay.Renderer = new SimpleRenderer(curvedFillSymbol);
-
- // Create a heart-shaped graphic.
- MapPoint origin = new MapPoint(x: 40e5, y: 5e5, SpatialReferences.WebMercator);
- Geometry heartGeometry = MakeHeartGeometry(origin, 10e5);
- Graphic heartGraphic = new Graphic(heartGeometry);
- curvedGraphicsOverlay.Graphics.Add(heartGraphic);
- return curvedGraphicsOverlay;
- }
-
- private Geometry MakeHeartGeometry(MapPoint center, double sideLength)
- {
- if (sideLength <= 0) return null;
-
- SpatialReference spatialReference = center.SpatialReference;
-
- // The x and y coordinates to simplify the calculation.
- double minX = center.X - 0.5 * sideLength;
- double minY = center.Y - 0.5 * sideLength;
-
- // The radius of the arcs.
- double arcRadius = sideLength * 0.25;
-
- // Bottom left curve.
- MapPoint leftCurveStart = new MapPoint(center.X, minY, spatialReference);
- MapPoint leftCurveEnd = new MapPoint(minX, minY + 0.75 * sideLength, spatialReference);
- MapPoint leftControlMapPoint1 = new MapPoint(center.X, minY + 0.25 * sideLength, spatialReference);
- MapPoint leftControlMapPoint2 = new MapPoint(minX, center.Y, spatialReference: spatialReference);
- CubicBezierSegment leftCurve = new CubicBezierSegment(leftCurveStart, leftControlMapPoint1, leftControlMapPoint2, leftCurveEnd, spatialReference);
-
- // Top left arc.
- MapPoint leftArcCenter = new MapPoint(minX + 0.25 * sideLength, minY + 0.75 * sideLength, spatialReference);
- EllipticArcSegment leftArc = EllipticArcSegment.CreateCircularEllipticArc(leftArcCenter, arcRadius, Math.PI, centralAngle: -Math.PI, spatialReference);
-
- // Top right arc.
- MapPoint rightArcCenter = new MapPoint(minX + 0.75 * sideLength, minY + 0.75 * sideLength, spatialReference);
- EllipticArcSegment rightArc = EllipticArcSegment.CreateCircularEllipticArc(rightArcCenter, arcRadius, Math.PI, centralAngle: -Math.PI, spatialReference);
-
- // Bottom right curve.
- MapPoint rightCurveStart = new MapPoint(minX + sideLength, minY + 0.75 * sideLength, spatialReference);
- MapPoint rightCurveEnd = leftCurveStart;
- MapPoint rightControlMapPoint1 = new MapPoint(minX + sideLength, center.Y, spatialReference);
- MapPoint rightControlMapPoint2 = leftControlMapPoint1;
- CubicBezierSegment rightCurve = new CubicBezierSegment(rightCurveStart, rightControlMapPoint1, rightControlMapPoint2, rightCurveEnd, spatialReference);
-
- // Create the heart polygon.
- Part newPart = new Part(new Segment[]
- {
- leftCurve,
- leftArc,
- rightArc,
- rightCurve
- }, spatialReference);
- PolygonBuilder builder = new PolygonBuilder(spatialReference);
- builder.AddPart(newPart);
- return builder.ToGeometry();
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsRenderer/AddGraphicsRenderer.jpg b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsRenderer/AddGraphicsRenderer.jpg
deleted file mode 100644
index 46ee831835..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsRenderer/AddGraphicsRenderer.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsRenderer/readme.metadata.json b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsRenderer/readme.metadata.json
deleted file mode 100644
index 2cf2178c8d..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsRenderer/readme.metadata.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "category": "GraphicsOverlay",
- "description": "A renderer allows you to change the style of all graphics in a graphics overlay by referencing a single symbol style. A renderer will only affect graphics that do not specify their own symbol style.",
- "formal_name": "AddGraphicsRenderer",
- "ignore": false,
- "images": [
- "AddGraphicsRenderer.jpg"
- ],
- "keywords": [
- "arc",
- "bezier",
- "curve",
- "display",
- "graphics",
- "marker",
- "overlay",
- "renderer",
- "segment",
- "symbol",
- "true curve"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/addgraphicsrenderer.htm"
- ],
- "relevant_apis": [
- "CubicBezierSegment",
- "EllipticArcSegment",
- "Geometry",
- "Graphic",
- "GraphicsOverlay",
- "Part",
- "PolygonBuilder",
- "PolylineBuilder",
- "SimpleFillSymbol",
- "SimpleLineSymbol",
- "SimpleMarkerSymbol",
- "SimpleRenderer"
- ],
- "snippets": [
- "AddGraphicsRenderer.cs"
- ],
- "title": "Add graphics with renderer"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsWithSymbols/AddGraphicsWithSymbols.cs b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsWithSymbols/AddGraphicsWithSymbols.cs
deleted file mode 100644
index d4b0825ff0..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsWithSymbols/AddGraphicsWithSymbols.cs
+++ /dev/null
@@ -1,205 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System.Drawing;
-
-namespace ArcGISRuntime.Samples.AddGraphicsWithSymbols
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Add graphics with symbols",
- category: "GraphicsOverlay",
- description: "Use a symbol style to display a graphic on a graphics overlay.",
- instructions: "Observe the graphics on the map.",
- tags: new[] { "SimpleFillSymbol", "SimpleLineSymbol", "SimpleMarkerSymbol" })]
- public class AddGraphicsWithSymbols : Activity
- {
- // Hold a reference to the map view
- private MapView _myMapView;
-
- // Create the graphics overlay
- private readonly GraphicsOverlay _overlay = new GraphicsOverlay();
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Add graphics with symbols";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create the map
- Map myMap = new Map(BasemapStyle.ArcGISOceans);
- myMap.InitialViewpoint = new Viewpoint(56.075844, -2.681572, 14);
-
- // Add the map to the map view
- _myMapView.Map = myMap;
-
- // Add the graphics overlay to the map view
- _myMapView.GraphicsOverlays.Add(_overlay);
-
- // Call functions to create the graphics
- CreatePoints();
- CreatePolygon();
- CreatePolyline();
- CreateText();
-
- // Update the extent to encompass all of the symbols
- SetExtent();
- }
-
- private void CreatePoints()
- {
- // Create a red circle simple marker symbol
- SimpleMarkerSymbol redCircleSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, Color.Red, 10);
-
- // Create graphics and add them to graphics overlay
- Graphic graphic = new Graphic(new MapPoint(-2.72, 56.065, SpatialReferences.Wgs84), redCircleSymbol);
- _overlay.Graphics.Add(graphic);
-
- graphic = new Graphic(new MapPoint(-2.69, 56.065, SpatialReferences.Wgs84), redCircleSymbol);
- _overlay.Graphics.Add(graphic);
-
- graphic = new Graphic(new MapPoint(-2.66, 56.065, SpatialReferences.Wgs84), redCircleSymbol);
- _overlay.Graphics.Add(graphic);
-
- graphic = new Graphic(new MapPoint(-2.63, 56.065, SpatialReferences.Wgs84), redCircleSymbol);
- _overlay.Graphics.Add(graphic);
- }
-
- private void CreatePolyline()
- {
- // Create a purple simple line symbol
- SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Dash, Color.Purple, 4);
-
- // Create a new point collection for polyline
- PointCollection points = new PointCollection(SpatialReferences.Wgs84)
- {
- // Create and add points to the point collection
- new MapPoint(-2.715, 56.061),
- new MapPoint(-2.6438, 56.079),
- new MapPoint(-2.638, 56.079),
- new MapPoint(-2.636, 56.078),
- new MapPoint(-2.636, 56.077),
- new MapPoint(-2.637, 56.076),
- new MapPoint(-2.715, 56.061)
- };
-
- // Create the polyline from the point collection
- Polyline polyline = new Polyline(points);
-
- // Create the graphic with polyline and symbol
- Graphic graphic = new Graphic(polyline, lineSymbol);
-
- // Add graphic to the graphics overlay
- _overlay.Graphics.Add(graphic);
- }
-
- private void CreatePolygon()
- {
- // Create a green simple line symbol
- SimpleLineSymbol outlineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Dash, Color.Green, 1);
-
- // Create a green mesh simple fill symbol
- SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.DiagonalCross, Color.Green, outlineSymbol);
-
- // Create a new point collection for polygon
- PointCollection points = new PointCollection(SpatialReferences.Wgs84)
- {
- // Create and add points to the point collection
- new MapPoint(-2.6425, 56.0784),
- new MapPoint(-2.6430, 56.0763),
- new MapPoint(-2.6410, 56.0759),
- new MapPoint(-2.6380, 56.0765),
- new MapPoint(-2.6380, 56.0784),
- new MapPoint(-2.6410, 56.0786)
- };
-
- // Create the polyline from the point collection
- Polygon polygon = new Polygon(points);
-
- // Create the graphic with polyline and symbol
- Graphic graphic = new Graphic(polygon, fillSymbol);
-
- // Add graphic to the graphics overlay
- _overlay.Graphics.Add(graphic);
- }
-
- private void CreateText()
- {
- // Create two text symbols
- TextSymbol bassRockTextSymbol = new TextSymbol("Black Rock", Color.Blue, 10,
- HorizontalAlignment.Left, VerticalAlignment.Bottom);
-
- TextSymbol craigleithTextSymbol = new TextSymbol("Craigleith", Color.Blue, 10,
- HorizontalAlignment.Right, VerticalAlignment.Top);
-
- // Create two points
- MapPoint bassPoint = new MapPoint(-2.64, 56.079, SpatialReferences.Wgs84);
- MapPoint craigleithPoint = new MapPoint(-2.72, 56.076, SpatialReferences.Wgs84);
-
- // Create two graphics from the points and symbols
- Graphic bassRockGraphic = new Graphic(bassPoint, bassRockTextSymbol);
- Graphic craigleithGraphic = new Graphic(craigleithPoint, craigleithTextSymbol);
-
- // Add graphics to the graphics overlay
- _overlay.Graphics.Add(bassRockGraphic);
- _overlay.Graphics.Add(craigleithGraphic);
- }
-
- private void SetExtent()
- {
- // Get all of the graphics contained in the graphics overlay
- GraphicCollection myGraphicCollection = _overlay.Graphics;
-
- // Create a new envelope builder using the same spatial reference as the graphics
- EnvelopeBuilder myEnvelopeBuilder = new EnvelopeBuilder(SpatialReferences.Wgs84);
-
- // Loop through each graphic in the graphic collection
- foreach (Graphic oneGraphic in myGraphicCollection)
- {
- // Union the extent of each graphic in the envelope builder
- myEnvelopeBuilder.UnionOf(oneGraphic.Geometry.Extent);
- }
-
- // Expand the envelope builder by 30%
- myEnvelopeBuilder.Expand(1.3);
-
- // Adjust the viewable area of the map to encompass all of the graphics in the
- // graphics overlay plus an extra 30% margin for better viewing
- _myMapView.SetViewpointAsync(new Viewpoint(myEnvelopeBuilder.Extent));
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsWithSymbols/AddGraphicsWithSymbols.jpg b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsWithSymbols/AddGraphicsWithSymbols.jpg
deleted file mode 100644
index 023c4e7efa..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsWithSymbols/AddGraphicsWithSymbols.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsWithSymbols/readme.metadata.json b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsWithSymbols/readme.metadata.json
deleted file mode 100644
index 4cb92d2aa7..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/AddGraphicsWithSymbols/readme.metadata.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "category": "GraphicsOverlay",
- "description": "Use a symbol style to display a graphic on a graphics overlay.",
- "formal_name": "AddGraphicsWithSymbols",
- "ignore": false,
- "images": [
- "AddGraphicsWithSymbols.jpg"
- ],
- "keywords": [
- "SimpleFillSymbol",
- "SimpleLineSymbol",
- "SimpleMarkerSymbol"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/addgraphicswithsymbols.htm"
- ],
- "relevant_apis": [
- "Geometry",
- "Graphic",
- "GraphicsOverlay",
- "SimpleFillSymbol",
- "SimpleLineSymbol",
- "SimpleMarkerSymbol"
- ],
- "snippets": [
- "AddGraphicsWithSymbols.cs"
- ],
- "title": "Add graphics with symbols"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/Animate3DGraphic/Animate3DGraphic.cs b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/Animate3DGraphic/Animate3DGraphic.cs
deleted file mode 100644
index 47141463ee..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/Animate3DGraphic/Animate3DGraphic.cs
+++ /dev/null
@@ -1,512 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Timers;
-using ArcGISRuntime.Samples.Managers;
-using Debug = System.Diagnostics.Debug;
-using Surface = Esri.ArcGISRuntime.Mapping.Surface;
-using System.Globalization;
-
-namespace ArcGISRuntime.Samples.Animate3DGraphic
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.AndroidLayout("Animate3DGraphic.axml")]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("290f0c571c394461a8b58b6775d0bd63","e87c154fb9c2487f999143df5b08e9b1","5a9b60cee9ba41e79640a06bcdf8084d","12509ffdc684437f8f2656b0129d2c13","681d6f7694644709a7c830ec57a2d72b")]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Animate 3D graphic",
- category: "GraphicsOverlay",
- description: "An `OrbitGeoElementCameraController` follows a graphic while the graphic's position and rotation are animated.",
- instructions: "Animation Controls:",
- tags: new[] { "Camera", "ModelSceneSymbol", "OrbitGeoElementCameraController", "RendererSceneProperties", "SceneView" })]
- public class Animate3DGraphic : Activity
- {
- // Hold references to UI components so that they can be accessed by the sample programmatically
- // These will be populated from the AndroidLayout file in CreateLayout
- private Button _missionButton;
- private Button _cameraButton;
- private Button _playButton;
- private Button _statsButton;
- private TextView _altitudeTextView;
- private TextView _headingTextView;
- private TextView _pitchTextView;
- private TextView _rollTextView;
- private SeekBar _missionProgressBar;
- private SceneView _mySceneView;
- private MapView _insetMapView;
-
- // URL to the elevation service - provides terrain elevation
- private readonly Uri _elevationServiceUrl = new Uri("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer");
-
- // Graphic for highlighting the route in the inset map
- private Graphic _routeGraphic;
-
- // Graphic for highlighting the airplane in the inset map
- private Graphic _plane2D;
-
- // Graphic for showing the 3D plane model in the scene
- private Graphic _plane3D;
-
- // Camera controller for centering the camera on the airplane
- private OrbitGeoElementCameraController _orbitCameraController;
-
- // Timer enables frame-by-frame animation
- private Timer _animationTimer;
-
- // Number of frames in the mission animation
- private int _frameCount;
-
- // Index of current frame in the animation
- private int _keyframe;
-
- // Dictionary of mission file names and the corresponding portal item IDs
- private readonly Dictionary _missionToItemId = new Dictionary
- {
- {"GrandCanyon","290f0c571c394461a8b58b6775d0bd63"},
- {"Hawaii", "e87c154fb9c2487f999143df5b08e9b1"},
- {"Pyrenees", "5a9b60cee9ba41e79640a06bcdf8084d"},
- {"Snowdon", "12509ffdc684437f8f2656b0129d2c13"}
- };
-
- // Array of frames for the current mission
- // A MissionFrame contains the position of the plane for a single moment in the animation
- private MissionFrame[] _missionData;
-
- // Status flag controls which camera will be used
- private bool _shouldFollowPlane = true;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Animate 3D graphic";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private async void Initialize()
- {
- // Apply appropriate maps to the scene and the inset map view
- _insetMapView.Map = new Map(BasemapStyle.ArcGISImageryStandard);
- _mySceneView.Scene = new Scene(BasemapStyle.ArcGISImageryStandard);
-
- // Apply the elevation source
- Surface surface = new Surface();
- ElevationSource elevationSource = new ArcGISTiledElevationSource(_elevationServiceUrl);
- surface.ElevationSources.Add(elevationSource);
- _mySceneView.Scene.BaseSurface = surface;
-
- // Create and add the graphics overlay
- GraphicsOverlay sceneOverlay = new GraphicsOverlay
- {
- SceneProperties = { SurfacePlacement = SurfacePlacement.Absolute }
- };
- _mySceneView.GraphicsOverlays.Add(sceneOverlay);
-
- // Create a renderer to handle updating plane's orientation
- SimpleRenderer renderer3D = new SimpleRenderer();
- RendererSceneProperties renderProperties = renderer3D.SceneProperties;
- // Use expressions to keep the renderer properties updated as parameters of the rendered object
- renderProperties.HeadingExpression = "[HEADING]";
- renderProperties.PitchExpression = "[PITCH]";
- renderProperties.RollExpression = "[ROLL]";
- // Apply the renderer to the scene view's overlay
- sceneOverlay.Renderer = renderer3D;
-
- // Create renderer to symbolize plane and update plane orientation in the inset map
- SimpleRenderer renderer2D = new SimpleRenderer();
- // Create the symbol that will be used for the plane
- SimpleMarkerSymbol plane2DSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Triangle, System.Drawing.Color.Blue, 10);
- // Apply the symbol to the renderer
- renderer2D.Symbol = plane2DSymbol;
- // Apply a rotation expression to the renderer
- renderer2D.RotationExpression = "[ANGLE]";
- // Update the inset map with a new GraphicsOverlay based on the renderer
- GraphicsOverlay insetMapOperlay = new GraphicsOverlay
- {
- Renderer = renderer2D
- };
- _insetMapView.GraphicsOverlays.Add(insetMapOperlay);
-
- // Create placeholder graphic for showing the mission route in the inset map
- SimpleLineSymbol routeSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.Red, 2);
- _routeGraphic = new Graphic { Symbol = routeSymbol };
- insetMapOperlay.Graphics.Add(_routeGraphic);
-
- // Create the plane graphic; this is symbolized as a blue triangle because of renderer implemented above
- // Create the attribute dictionary
- Dictionary plane2DAttributes = new Dictionary
- {
- // Set the angle for the plane graphic
- ["ANGLE"] = 0f
- };
- // Create the graphic from the attributes and the initial point
- _plane2D = new Graphic(new MapPoint(0, 0, SpatialReferences.Wgs84), plane2DAttributes);
- // Add the plane graphic to the inset map via the overlay
- insetMapOperlay.Graphics.Add(_plane2D);
-
- try
- {
- // Create the model graphic for the plane
- // Get the path to the 3D model
- string modelPath = GetModelPath();
- // Create the scene symbol from the path to the model
- ModelSceneSymbol plane3DSymbol = await ModelSceneSymbol.CreateAsync(new Uri(modelPath), 1.0);
- // Create the graphic with an initial location and the plane symbol
- _plane3D = new Graphic(new MapPoint(0, 0, 0, SpatialReferences.Wgs84), plane3DSymbol);
- // Add the plane to the overlay
- sceneOverlay.Graphics.Add(_plane3D);
-
- // Create the orbit camera controller to follow the plane
- _orbitCameraController = new OrbitGeoElementCameraController(_plane3D, 20.0)
- {
- CameraPitchOffset = 75.0
- };
- _mySceneView.CameraController = _orbitCameraController;
-
- // Create a timer; this will enable animating the plane
- // The value is the duration of the timer in milliseconds. This controls the speed of the animation (fps)
- _animationTimer = new Timer(60)
- {
- Enabled = true,
- AutoReset = true
- };
-
- // Move the plane every time the timer expires
- _animationTimer.Elapsed += AnimatePlane;
-
- // Set the initial mission for when the sample loads
- await ChangeMission(_missionToItemId.Keys.First());
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private async Task ChangeMission(string mission)
- {
- // Stop animating the current mission
- _animationTimer.Stop();
-
- // Get mission data
- _missionData = GetMissionData(mission);
-
- // Draw mission route on the inset
- // Create a collection of points to hold the mission
- PointCollection points = new PointCollection(SpatialReferences.Wgs84);
- // Add all of the points from the mission to the point collection
- points.AddPoints(_missionData.Select(m => m.ToMapPoint()));
- // Create a polyline to symbolize the route from the point collection
- Polyline route = new Polyline(points);
- // Update the route graphic's geometry with the newly created route polyline
- _routeGraphic.Geometry = route;
- // Update the inset map's scale
- await _insetMapView.SetViewpointScaleAsync(100000);
-
- // Update animation parameters
- _frameCount = _missionData.Length;
- _keyframe = 0;
-
- // Set the _playButton button back to the currently 'playing' state
- _playButton.Text = "Pause";
-
- // Restart the animation
- _animationTimer.Start();
- }
-
- private MissionFrame[] GetMissionData(string mission)
- {
- // Get the path to the file
- string filePath = GetMissionFilePath(mission);
-
- // Read the file text
- string fileContents = File.ReadAllText(filePath);
-
- // Split the file contents into a list of lines
- return fileContents.Split('\n')
- // Then for each line, create a MissionFrame object
- .Select(MissionFrame.Create)
- // Then remove any null MissionFrames
- .Where(missionPart => missionPart != null)
- // Finally return that list of MissionFrames as an array
- .ToArray();
- }
-
- private string GetMissionFilePath(string mission)
- {
- string itemId = _missionToItemId[mission];
- string filename = mission + ".csv";
-
- return DataManager.GetDataFolder(itemId, filename);
- }
-
- private void AnimatePlane(object sender, ElapsedEventArgs elapsedEventArgs)
- {
- // Get the next position; % prevents going out of bounds even if the keyframe value is
- // changed unexpectedly (e.g. due to user interaction with the progress slider).
- MissionFrame currentFrame = _missionData[_keyframe % _frameCount];
-
- // Update the UI
- double missionProgress = _keyframe / (double)_frameCount;
-
- // This is needed because the event could be running on a non-UI thread
- RunOnUiThread(() =>
- {
- // Update the progress slider; temporarily remove event subscription to prevent feedback loop
- _missionProgressBar.ProgressChanged -= MissionProgressOnSeek;
- _missionProgressBar.Progress = (int)(missionProgress * 100);
- _missionProgressBar.ProgressChanged += MissionProgressOnSeek;
-
- // Update stats display
- _altitudeTextView.Text = $"{currentFrame.Elevation:F}m";
- _headingTextView.Text = $"{currentFrame.Heading:F}\u00b0";
- _pitchTextView.Text = $"{currentFrame.Pitch:F}\u00b0";
- _rollTextView.Text = $"{currentFrame.Roll:F}\u00b0";
- });
-
- // Update plane's position
- _plane3D.Geometry = currentFrame.ToMapPoint();
- _plane3D.Attributes["HEADING"] = currentFrame.Heading;
- _plane3D.Attributes["PITCH"] = currentFrame.Pitch;
- _plane3D.Attributes["ROLL"] = currentFrame.Roll;
-
- // Update the inset map; plane symbol position
- _plane2D.Geometry = currentFrame.ToMapPoint();
- // Update inset's viewpoint and heading
- Viewpoint vp = new Viewpoint(currentFrame.ToMapPoint(), _insetMapView.MapScale,
- 360 + (float)currentFrame.Heading);
- _insetMapView.SetViewpoint(vp);
-
- // Update the keyframe. This advances the animation
- _keyframe++;
-
- // Restart the animation if it has finished
- if (_keyframe >= _frameCount)
- {
- _keyframe = 0;
- }
- }
-
- private string GetModelPath()
- {
- return DataManager.GetDataFolder("681d6f7694644709a7c830ec57a2d72b", "Bristol.dae");
- }
-
- private void MissionPlayPlauseClick(object sender, EventArgs e)
- {
- // Get a reference to the button that sent the event
- Button playButton = (Button)sender;
-
- // Get the text of the button
- string playtext = playButton.Text;
-
- switch (playtext)
- {
- // Resume the animation
- case "Play":
- playButton.Text = "Pause";
- _animationTimer.Start();
- break;
- // Stop the animation
- case "Pause":
- playButton.Text = "Play";
- _animationTimer.Stop();
- break;
- }
- }
-
- private void ToggleFollowPlane()
- {
- // Update the flag
- _shouldFollowPlane = !_shouldFollowPlane;
-
- // If flag is set, use the orbit camera controller, else use null.
- // Setting the CameraController to null will cause the SceneView to use the default camera
- _mySceneView.CameraController = _shouldFollowPlane ? _orbitCameraController : null;
- }
-
- private void MissionButtonOnClick(object o, EventArgs eventArgs)
- {
- // Show a list of missions to choose from
-
- // Get an array of mission names
- string[] missions = _missionToItemId.Keys.ToArray();
-
- // Create an alert dialog builder
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.SetTitle("Select a mission");
-
- // Apply the list of items and provide a lambda to handle the selection event
- builder.SetItems(missions, async (sender, args) => { await ChangeMission(missions[args.Which]); });
-
- // Show the dialog
- builder.Show();
- }
-
- private void MissionProgressOnSeek(object sender, EventArgs e)
- {
- // Stop the animation
- _animationTimer.Stop();
-
- // Get the new mission progress
- double missionProgress = _missionProgressBar.Progress / 100.0;
-
- // Update the keyframe based on the progress
- _keyframe = (int)(missionProgress * _frameCount);
-
- // Set the _playButton button back to the currently 'playing' state
- _playButton.Text = "Pause";
-
- // Restart the animation
- _animationTimer.Start();
- }
-
- private void CreateLayout()
- {
- // Load the layout for the sample from the .axml file
- SetContentView(Resource.Layout.Animate3DGraphic);
-
- // Update control references to point to the controls defined in the layout
- _insetMapView = FindViewById(Resource.Id.insetMap);
- _mySceneView = FindViewById(Resource.Id.PrimarySceneView);
- _altitudeTextView = FindViewById(Resource.Id.planeAltitudeText);
- _headingTextView = FindViewById(Resource.Id.planeHeadingText);
- _pitchTextView = FindViewById(Resource.Id.planePitchText);
- _rollTextView = FindViewById(Resource.Id.planeRollText);
- _missionProgressBar = FindViewById(Resource.Id.missionProgressSeekBar);
- _cameraButton = FindViewById(Resource.Id.cameraButton);
- _missionButton = FindViewById(Resource.Id.missionButton);
- _statsButton = FindViewById(Resource.Id.statsButton);
- _playButton = FindViewById(Resource.Id.playPauseButton);
- LinearLayout statsLayout = FindViewById(Resource.Id.statsPanelLayout);
-
- // Update the SceneView to use an alternative atmosphere effect
- _mySceneView.AtmosphereEffect = AtmosphereEffect.Realistic;
-
- // Hide the attribution text on the inset map
- _insetMapView.IsAttributionTextVisible = false;
-
- // Handle the camera button click
- _cameraButton.Click += (sender, args) => ToggleFollowPlane();
-
- // Handle the play button click
- _playButton.Click += MissionPlayPlauseClick;
-
- // Handle the mission button click
- _missionButton.Click += MissionButtonOnClick;
-
- // Handle progress bar manipulation
- _missionProgressBar.ProgressChanged += MissionProgressOnSeek;
-
- // Handle the stats button click by hiding or showing the stats panel
- _statsButton.Click += (sender, args) =>
- {
- // If panel is visible already, hide it. Otherwise, show it.
- if (statsLayout.Visibility == ViewStates.Visible)
- {
- statsLayout.Visibility = ViewStates.Invisible;
- }
- else
- {
- statsLayout.Visibility = ViewStates.Visible;
- }
- };
- }
-
- protected override void OnDestroy()
- {
- base.OnDestroy();
-
- // Remove the sceneview
- (_mySceneView.Parent as ViewGroup).RemoveView(_mySceneView);
- _mySceneView.Dispose();
- _mySceneView = null;
- }
-
- ///
- /// Private helper class represents a single frame in the animation
- ///
- private class MissionFrame
- {
- private double Longitude { get; }
- private double Latitude { get; }
- public double Elevation { get; }
- public double Heading { get; }
- public double Pitch { get; }
- public double Roll { get; }
-
- ///
- /// Private constructor ensures that only the factory method (Create) can be called.
- ///
- /// A string describing a single frame in the mission animation.
- private MissionFrame(string missionLine)
- {
- // Split the string into a list of entries (columns)
- // Example line: -156.3666517,20.6255059,999.999908,83.77659,.00009,-47.766567
- string[] missionFrameParameters = missionLine.Split(',');
-
- // Throw if the line isn't valid
- if (missionFrameParameters.Length != 6)
- {
- throw new Exception("Invalid mission part definition");
- }
-
- // Populate the object's properties from the array of parameters
- Longitude = Convert.ToDouble(missionFrameParameters[0], CultureInfo.InvariantCulture);
- Latitude = Convert.ToDouble(missionFrameParameters[1], CultureInfo.InvariantCulture);
- Elevation = Convert.ToDouble(missionFrameParameters[2], CultureInfo.InvariantCulture);
- Heading = Convert.ToDouble(missionFrameParameters[3], CultureInfo.InvariantCulture);
- Pitch = Convert.ToDouble(missionFrameParameters[4], CultureInfo.InvariantCulture);
- Roll = Convert.ToDouble(missionFrameParameters[5], CultureInfo.InvariantCulture);
- }
-
- ///
- /// Creates a new MissionFrame.
- /// The private constructor + static construction method allows
- /// for keeping the exception-handling logic for the constructor
- /// internal to the class.
- ///
- /// A string describing a single frame in the mission animation
- /// Constructed MissionFrame or null if the line is invalid
- public static MissionFrame Create(string missionLine)
- {
- try
- {
- return new MissionFrame(missionLine);
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- return null;
- }
- }
-
- public MapPoint ToMapPoint()
- {
- return new MapPoint(Longitude, Latitude, Elevation, SpatialReferences.Wgs84);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/Animate3DGraphic/Animate3DGraphic.jpg b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/Animate3DGraphic/Animate3DGraphic.jpg
deleted file mode 100644
index 3d5a82a0cb..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/Animate3DGraphic/Animate3DGraphic.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/Animate3DGraphic/readme.metadata.json b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/Animate3DGraphic/readme.metadata.json
deleted file mode 100644
index c96f44751d..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/Animate3DGraphic/readme.metadata.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "category": "GraphicsOverlay",
- "description": "An `OrbitGeoElementCameraController` follows a graphic while the graphic's position and rotation are animated.",
- "formal_name": "Animate3DGraphic",
- "ignore": false,
- "images": [
- "Animate3DGraphic.jpg"
- ],
- "keywords": [
- "Camera",
- "ModelSceneSymbol",
- "OrbitGeoElementCameraController",
- "RendererSceneProperties",
- "SceneView"
- ],
- "offline_data": [
- "681d6f7694644709a7c830ec57a2d72b",
- "290f0c571c394461a8b58b6775d0bd63",
- "e87c154fb9c2487f999143df5b08e9b1",
- "5a9b60cee9ba41e79640a06bcdf8084d",
- "12509ffdc684437f8f2656b0129d2c13"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/animate3dgraphic.htm"
- ],
- "relevant_apis": [
- "Camera",
- "GlobeCameraController",
- "Graphic",
- "GraphicsOverlay",
- "ModelSceneSymbol",
- "OrbitGeoElementCameraController",
- "Renderer",
- "Scene",
- "SceneProperties",
- "SceneView",
- "SurfacePlacement"
- ],
- "snippets": [
- "../../../Resources/layout/Animate3DGraphic.axml",
- "Animate3DGraphic.cs"
- ],
- "title": "Animate 3D graphic"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/DictionaryRendererGraphicsOverlay/DictionaryRendererGraphicsOverlay.cs b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/DictionaryRendererGraphicsOverlay/DictionaryRendererGraphicsOverlay.cs
deleted file mode 100644
index a493fb3a29..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/DictionaryRendererGraphicsOverlay/DictionaryRendererGraphicsOverlay.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using ArcGISRuntime.Samples.Managers;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Xml.Linq;
-
-namespace ArcGISRuntimeXamarin.Samples.DictionaryRendererGraphicsOverlay
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Graphics overlay (dictionary renderer)",
- category: "GraphicsOverlay",
- description: "This sample demonstrates applying a dictionary renderer to graphics, in order to display military symbology without the need for a feature table.",
- instructions: "Pan and zoom to explore military symbols on the map.",
- tags: new[] { "defense", "military", "situational awareness", "tactical", "visualization" })]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("c78b149a1d52414682c86a5feeb13d30", "1e4ea99af4b440c092e7959cf3957bfa")]
- public class DictionaryRendererGraphicsOverlay : Activity
- {
- // Create and hold reference to the used MapView.
- private MapView _myMapView;
-
- // Hold a reference to the graphics overlay for easy access.
- private GraphicsOverlay _tacticalMessageOverlay;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Dictionary renderer with graphics overlay";
-
- CreateLayout();
- Initialize();
- }
-
- private async void Initialize()
- {
- try
- {
- _myMapView.Map = new Map(BasemapStyle.ArcGISTopographic);
-
- // Create an overlay for visualizing tactical messages and add it to the map.
- _tacticalMessageOverlay = new GraphicsOverlay();
- _myMapView.GraphicsOverlays.Add(_tacticalMessageOverlay);
-
- // Prevent graphics from showing up when zoomed too far out.
- _tacticalMessageOverlay.MinScale = 1000000;
-
- // Create a symbol dictionary style following the mil2525d spec.
- string symbolFilePath = DataManager.GetDataFolder("c78b149a1d52414682c86a5feeb13d30", "mil2525d.stylx");
- DictionarySymbolStyle mil2525DStyle = await DictionarySymbolStyle.CreateFromFileAsync(symbolFilePath);
-
- // Use the dictionary symbol style to render graphics in the overlay.
- _tacticalMessageOverlay.Renderer = new DictionaryRenderer(mil2525DStyle);
-
- // Load the military messages and render them.
- LoadMilitaryMessages();
-
- // Get the extent of the graphics.
- Envelope graphicExtent = GeometryEngine.CombineExtents(_tacticalMessageOverlay.Graphics.Select(graphic => graphic.Geometry));
-
- // Zoom to the extent of the graphics.
- await _myMapView.SetViewpointGeometryAsync(graphicExtent, 10);
- }
- catch (Exception e)
- {
- Console.WriteLine(e);
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private void LoadMilitaryMessages()
- {
- // Get the path to the messages file.
- string militaryMessagePath = DataManager.GetDataFolder("1e4ea99af4b440c092e7959cf3957bfa", "Mil2525DMessages.xml");
-
- // Load the XML document.
- XElement xmlRoot = XElement.Load(militaryMessagePath);
-
- // Get all of the messages.
- IEnumerable messages = xmlRoot.Descendants("message");
-
- // Add a graphic for each message.
- foreach (var message in messages)
- {
- Graphic messageGraphic = GraphicFromAttributes(message.Descendants().ToList());
- _tacticalMessageOverlay.Graphics.Add(messageGraphic);
- }
- }
-
- private Graphic GraphicFromAttributes(List graphicAttributes)
- {
- // Get the geometry and the spatial reference from the message elements.
- XElement geometryAttribute = graphicAttributes.First(attr => attr.Name == "_control_points");
- XElement spatialReferenceAttr = graphicAttributes.First(attr => attr.Name == "_wkid");
-
- // Split the geometry field into a list of points.
- Array pointStrings = geometryAttribute.Value.Split(';');
-
- // Create a point collection in the correct spatial reference.
- int wkid = Convert.ToInt32(spatialReferenceAttr.Value);
- SpatialReference pointSR = SpatialReference.Create(wkid);
- PointCollection graphicPoints = new PointCollection(pointSR);
-
- // Add a point for each point in the list.
- foreach (string pointString in pointStrings)
- {
- var coords = pointString.Split(',');
- graphicPoints.Add(Convert.ToDouble(coords[0], CultureInfo.InvariantCulture), Convert.ToDouble(coords[1], CultureInfo.InvariantCulture));
- }
-
- // Create a multipoint from the point collection.
- Multipoint graphicMultipoint = new Multipoint(graphicPoints);
-
- // Create the graphic from the multipoint.
- Graphic messageGraphic = new Graphic(graphicMultipoint);
-
- // Add all of the message's attributes to the graphic (some of these are used for rendering).
- foreach (XElement attr in graphicAttributes)
- {
- messageGraphic.Attributes[attr.Name.ToString()] = attr.Value;
- }
-
- return messageGraphic;
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- var layout = new LinearLayout(this) {Orientation = Orientation.Vertical};
-
- // Add the map view to the layout.
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/DictionaryRendererGraphicsOverlay/DictionaryRendererGraphicsOverlay.jpg b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/DictionaryRendererGraphicsOverlay/DictionaryRendererGraphicsOverlay.jpg
deleted file mode 100644
index 874e36fe06..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/DictionaryRendererGraphicsOverlay/DictionaryRendererGraphicsOverlay.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/DictionaryRendererGraphicsOverlay/readme.metadata.json b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/DictionaryRendererGraphicsOverlay/readme.metadata.json
deleted file mode 100644
index 02fa3a3e11..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/DictionaryRendererGraphicsOverlay/readme.metadata.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "category": "GraphicsOverlay",
- "description": "This sample demonstrates applying a dictionary renderer to graphics, in order to display military symbology without the need for a feature table.",
- "formal_name": "DictionaryRendererGraphicsOverlay",
- "ignore": false,
- "images": [
- "DictionaryRendererGraphicsOverlay.jpg"
- ],
- "keywords": [
- "defense",
- "military",
- "situational awareness",
- "tactical",
- "visualization"
- ],
- "offline_data": [
- "e34835bf5ec5430da7cf16bb8c0b075c",
- "3db12175479147ea9c89ebaaf3b89996"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/dictionaryrenderergraphicsoverlay.htm"
- ],
- "relevant_apis": [
- "DictionaryRenderer",
- "DictionarySymbolStyle",
- "GraphicsOverlay"
- ],
- "snippets": [
- "DictionaryRendererGraphicsOverlay.cs"
- ],
- "title": "Graphics overlay (dictionary renderer)"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/IdentifyGraphics/IdentifyGraphics.cs b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/IdentifyGraphics/IdentifyGraphics.cs
deleted file mode 100644
index 88e2e0932f..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/IdentifyGraphics/IdentifyGraphics.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright 2016 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using System;
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-
-namespace ArcGISRuntime.Samples.IdentifyGraphics
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Identify graphics",
- category: "GraphicsOverlay",
- description: "Display an alert message when a graphic is clicked.",
- instructions: "Select a graphic to identify it. You will see an alert message displayed.",
- tags: new[] { "graphics", "identify" })]
- public class IdentifyGraphics : Activity
- {
- // Hold a reference to the map view
- private MapView _myMapView;
-
- // Graphics overlay to host graphics
- private GraphicsOverlay _polygonOverlay;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Identify graphics";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a map with 'Imagery with Labels' basemap and an initial location
- Map myMap = new Map(BasemapStyle.ArcGISTopographic);
-
- // Create graphics overlay with graphics
- CreateOverlay();
-
- _myMapView.GeoViewTapped += OnMapViewTapped;
-
- // Assign the map to the MapView
- _myMapView.Map = myMap;
- }
-
- private void CreateOverlay()
- {
- // Create polygon builder and add polygon corners into it
- PolygonBuilder builder = new PolygonBuilder(SpatialReferences.WebMercator);
- builder.AddPoint(new MapPoint(-20e5, 20e5));
- builder.AddPoint(new MapPoint(20e5, 20e5));
- builder.AddPoint(new MapPoint(20e5, -20e5));
- builder.AddPoint(new MapPoint(-20e5, -20e5));
-
- // Get geometry from the builder
- Polygon polygonGeometry = builder.ToGeometry();
-
- // Create symbol for the polygon
- SimpleFillSymbol polygonSymbol = new SimpleFillSymbol(
- SimpleFillSymbolStyle.Solid,
- System.Drawing.Color.Yellow,
- null);
-
- // Create new graphic
- Graphic polygonGraphic = new Graphic(polygonGeometry, polygonSymbol);
-
- // Create overlay to where graphics are shown
- _polygonOverlay = new GraphicsOverlay();
- _polygonOverlay.Graphics.Add(polygonGraphic);
-
- // Add created overlay to the MapView
- _myMapView.GraphicsOverlays.Add(_polygonOverlay);
- }
-
- private async void OnMapViewTapped(object sender, GeoViewInputEventArgs e)
- {
- double tolerance = 10d; // Use larger tolerance for touch
- int maximumResults = 1; // Only return one graphic
- bool onlyReturnPopups = false; // Don't only return popups
-
- try
- {
- // Use the following method to identify graphics in a specific graphics overlay
- IdentifyGraphicsOverlayResult identifyResults = await _myMapView.IdentifyGraphicsOverlayAsync(
- _polygonOverlay,
- e.Position,
- tolerance,
- onlyReturnPopups,
- maximumResults);
-
- // Check if we got results
- if (identifyResults.Graphics.Count > 0)
- {
- // Make sure that the UI changes are done in the UI thread
- RunOnUiThread(() =>
- {
- AlertDialog.Builder alert = new AlertDialog.Builder(this);
- alert.SetMessage("Tapped on graphic");
- alert.Show();
- });
- }
- }
- catch (Exception ex)
- {
- new AlertDialog.Builder(this).SetMessage(ex.ToString()).SetTitle("Error").Show();
- }
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Create a TextView for instructions.
- TextView sampleInstructionsTextView = new TextView(this)
- {
- Text = "Tap on the graphic to identify it."
- };
- layout.AddView(sampleInstructionsTextView);
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/IdentifyGraphics/IdentifyGraphics.jpg b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/IdentifyGraphics/IdentifyGraphics.jpg
deleted file mode 100644
index e651eabf7a..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/IdentifyGraphics/IdentifyGraphics.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/IdentifyGraphics/readme.metadata.json b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/IdentifyGraphics/readme.metadata.json
deleted file mode 100644
index 5141c5fc3a..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/IdentifyGraphics/readme.metadata.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "category": "GraphicsOverlay",
- "description": "Display an alert message when a graphic is clicked.",
- "formal_name": "IdentifyGraphics",
- "ignore": false,
- "images": [
- "IdentifyGraphics.jpg"
- ],
- "keywords": [
- "graphics",
- "identify"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/identifygraphics.htm"
- ],
- "relevant_apis": [
- "Graphic",
- "GraphicsOverlay",
- "MapView"
- ],
- "snippets": [
- "IdentifyGraphics.cs"
- ],
- "title": "Identify graphics"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/ScenePropertiesExpressions/ScenePropertiesExpressions.cs b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/ScenePropertiesExpressions/ScenePropertiesExpressions.cs
deleted file mode 100644
index 29e11166ae..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/ScenePropertiesExpressions/ScenePropertiesExpressions.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using System.Drawing;
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-
-namespace ArcGISRuntimeXamarin.Samples.ScenePropertiesExpressions
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Scene properties expressions",
- category: "GraphicsOverlay",
- description: "Update the orientation of a graphic using expressions based on its attributes.",
- instructions: "Adjust the heading and pitch sliders to rotate the cone.",
- tags: new[] { "3D", "expression", "graphics", "heading", "pitch", "rotation", "scene", "symbology" })]
- public class ScenePropertiesExpressions : Activity
- {
- // Hold reference to the used MapView.
- private SceneView _mySceneView;
- private SeekBar _headingSlider;
- private SeekBar _pitchSlider;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Scene properties expressions";
-
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Set up the scene with an imagery basemap.
- _mySceneView.Scene = new Scene(BasemapStyle.ArcGISImageryStandard);
-
- // Set the initial viewpoint for the scene.
- MapPoint point = new MapPoint(83.9, 28.4, 1000, SpatialReferences.Wgs84);
- Camera initialCamera = new Camera(point, 1000, 0, 50, 0);
- _mySceneView.SetViewpointCamera(initialCamera);
-
- // Create a graphics overlay.
- GraphicsOverlay overlay = new GraphicsOverlay();
- overlay.SceneProperties.SurfacePlacement = SurfacePlacement.Relative;
- _mySceneView.GraphicsOverlays.Add(overlay);
-
- // Add a renderer using rotation expressions.
- SimpleRenderer renderer = new SimpleRenderer();
- renderer.SceneProperties.HeadingExpression = "[HEADING]";
- renderer.SceneProperties.PitchExpression = "[PITCH]";
-
- // Apply the renderer to the graphics overlay.
- overlay.Renderer = renderer;
-
- // Create a red cone graphic.
- SimpleMarkerSceneSymbol coneSymbol = SimpleMarkerSceneSymbol.CreateCone(Color.Red, 100, 100);
- coneSymbol.Pitch = -90;
- MapPoint conePoint = new MapPoint(83.9, 28.41, 200, SpatialReferences.Wgs84);
- Graphic cone = new Graphic(conePoint, coneSymbol);
-
- // Add the cone graphic to the overlay.
- overlay.Graphics.Add(cone);
-
- // Listen for changes in slider values and update graphic properties.
- _headingSlider.ProgressChanged += (sender, e) => { cone.Attributes["HEADING"] = _headingSlider.Progress; };
- _pitchSlider.ProgressChanged += (sender, e) => { cone.Attributes["PITCH"] = _pitchSlider.Progress - 90; };
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app.
- var layout = new LinearLayout(this) {Orientation = Orientation.Vertical};
-
- _mySceneView = new SceneView(this);
- TextView headingLabel = new TextView(this);
- headingLabel.Text = "Heading:";
- _headingSlider = new SeekBar(this);
- _headingSlider.Min = 0;
- _headingSlider.Max = 360;
- TextView pitchLabel = new TextView(this);
- pitchLabel.Text = "Pitch:";
- _pitchSlider = new SeekBar(this);
- _pitchSlider.Min = 0;
- _pitchSlider.Max = 180;
-
- // Add the map view to the layout.
- layout.AddView(headingLabel);
- layout.AddView(_headingSlider);
- layout.AddView(pitchLabel);
- layout.AddView(_pitchSlider);
- layout.AddView(_mySceneView);
-
- // Show the layout in the app.
- SetContentView(layout);
- }
-
- protected override void OnDestroy()
- {
- base.OnDestroy();
-
- // Remove the sceneview
- (_mySceneView.Parent as ViewGroup).RemoveView(_mySceneView);
- _mySceneView.Dispose();
- _mySceneView = null;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/ScenePropertiesExpressions/ScenePropertiesExpressions.jpg b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/ScenePropertiesExpressions/ScenePropertiesExpressions.jpg
deleted file mode 100644
index fb4db67bf5..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/ScenePropertiesExpressions/ScenePropertiesExpressions.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/ScenePropertiesExpressions/readme.metadata.json b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/ScenePropertiesExpressions/readme.metadata.json
deleted file mode 100644
index 2d20b24ce8..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/ScenePropertiesExpressions/readme.metadata.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "category": "GraphicsOverlay",
- "description": "Update the orientation of a graphic using expressions based on its attributes.",
- "formal_name": "ScenePropertiesExpressions",
- "ignore": false,
- "images": [
- "ScenePropertiesExpressions.jpg"
- ],
- "keywords": [
- "3D",
- "expression",
- "graphics",
- "heading",
- "pitch",
- "rotation",
- "scene",
- "symbology"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/scenepropertiesexpressions.htm"
- ],
- "relevant_apis": [
- "Graphic.Attributes",
- "GraphicsOverlay",
- "SceneProperties",
- "SceneProperties.HeadingExpression",
- "SceneProperties.PitchExpression",
- "SimpleRenderer",
- "SimpleRenderer.SceneProperties"
- ],
- "snippets": [
- "ScenePropertiesExpressions.cs"
- ],
- "title": "Scene properties expressions"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SketchOnMap/SketchOnMap.cs b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SketchOnMap/SketchOnMap.cs
deleted file mode 100644
index df079f39d5..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SketchOnMap/SketchOnMap.cs
+++ /dev/null
@@ -1,448 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Data;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows.Input;
-
-namespace ArcGISRuntime.Samples.SketchOnMap
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Sketch on map",
- category: "GraphicsOverlay",
- description: "Use the Sketch Editor to edit or sketch a new point, line, or polygon geometry on to a map.",
- instructions: "Choose which geometry type to sketch from one of the available buttons. Choose from points, multipoints, polylines, polygons, freehand polylines, and freehand polygons.",
- tags: new[] { "draw", "edit" })]
- public class SketchOnMap : Activity
- {
- // Hold a reference to the map view
- private MapView _myMapView;
-
- // Dictionary to hold sketch mode enum names and values
- private Dictionary _sketchModeDictionary;
-
- // Graphics overlay to host sketch graphics
- private GraphicsOverlay _sketchOverlay;
-
- // Buttons for interacting with the SketchEditor
- private Button _editButton;
-
- private Button _undoButton;
- private Button _redoButton;
- private Button _doneButton;
- private Button _clearButton;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Sketch on map";
-
- // Create the UI
- CreateLayout();
-
- // Initialize controls, set up event handlers, etc.
- Initialize();
- }
-
- private void Initialize()
- {
- // Create a light gray canvas map
- Map myMap = new Map(BasemapStyle.ArcGISLightGray);
-
- // Create graphics overlay to display sketch geometry
- _sketchOverlay = new GraphicsOverlay();
- _myMapView.GraphicsOverlays.Add(_sketchOverlay);
-
- // Assign the map to the MapView
- _myMapView.Map = myMap;
-
- // Listen to the sketch editor tools CanExecuteChange so controls can be enabled/disabled
- _myMapView.SketchEditor.UndoCommand.CanExecuteChanged += CanExecuteChanged;
- _myMapView.SketchEditor.RedoCommand.CanExecuteChanged += CanExecuteChanged;
- _myMapView.SketchEditor.CompleteCommand.CanExecuteChanged += CanExecuteChanged;
-
- // Listen to collection changed event on the graphics overlay to enable/disable controls that require a graphic
- _sketchOverlay.Graphics.CollectionChanged += GraphicsChanged;
- }
-
- private void CreateLayout()
- {
- // Create horizontal layouts for the buttons at the top
- LinearLayout buttonLayoutOne = new LinearLayout(this) { Orientation = Orientation.Horizontal };
- LinearLayout buttonLayoutTwo = new LinearLayout(this) { Orientation = Orientation.Horizontal };
-
- // Parameters for all of the buttons. Used to set buttons height and width.
- LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.MatchParent,
- ViewGroup.LayoutParams.MatchParent,
- 1.0f
- );
-
- // Button to sketch a selected geometry type on the map view
- Button sketchButton = new Button(this)
- {
- Text = "Sketch",
- LayoutParameters = param
- };
- sketchButton.Click += OnSketchClicked;
-
- // Button to edit an existing graphic's geometry
- _editButton = new Button(this)
- {
- Text = "Edit",
- LayoutParameters = param
- };
- _editButton.Click += OnEditClicked;
- _editButton.Enabled = false;
-
- // Buttons to Undo/Redo sketch and edit operations
- _undoButton = new Button(this)
- {
- Text = "Undo",
- LayoutParameters = param
- };
- _undoButton.Click += OnUndoClicked;
- _undoButton.Enabled = false;
- _redoButton = new Button(this)
- {
- Text = "Redo",
- LayoutParameters = param
- };
- _redoButton.Click += OnRedoClicked;
- _redoButton.Enabled = false;
-
- // Button to complete the sketch or edit
- _doneButton = new Button(this)
- {
- Text = "Done",
- LayoutParameters = param
- };
- _doneButton.Click += OnCompleteClicked;
- _doneButton.Enabled = false;
-
- // Button to clear all graphics and sketches
- _clearButton = new Button(this)
- {
- Text = "Clear",
- LayoutParameters = param
- };
- _clearButton.Click += OnClearClicked;
- _clearButton.Enabled = false;
-
- // Add all sketch controls (buttons) to the button bars
- buttonLayoutOne.AddView(sketchButton);
- buttonLayoutOne.AddView(_editButton);
- buttonLayoutOne.AddView(_clearButton);
- // Second button bar
- buttonLayoutTwo.AddView(_undoButton);
- buttonLayoutTwo.AddView(_redoButton);
- buttonLayoutTwo.AddView(_doneButton);
-
- // Create a new vertical layout for the app (buttons followed by map view)
- LinearLayout mainLayout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add the button layouts
- mainLayout.AddView(buttonLayoutOne);
- mainLayout.AddView(buttonLayoutTwo);
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- mainLayout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(mainLayout);
- }
-
- private void OnSketchClicked(object sender, EventArgs e)
- {
- Button sketchButton = (Button)sender;
-
- // Create a dictionary of enum names and values
- IEnumerable enumValues = Enum.GetValues(typeof(SketchCreationMode)).Cast();
- _sketchModeDictionary = enumValues.ToDictionary(v => Enum.GetName(typeof(SketchCreationMode), v), v => v);
-
- // Create a menu to show sketch modes
- PopupMenu sketchModesMenu = new PopupMenu(sketchButton.Context, sketchButton);
- sketchModesMenu.MenuItemClick += OnSketchModeItemClicked;
-
- // Create a menu option for each basemap type
- foreach (string mode in _sketchModeDictionary.Keys)
- {
- sketchModesMenu.Menu.Add(mode);
- }
-
- // Show menu in the view
- sketchModesMenu.Show();
- }
-
- private async void OnSketchModeItemClicked(object sender, PopupMenu.MenuItemClickEventArgs e)
- {
- try
- {
- // Get the title of the selected menu item (sketch mode)
- string sketchModeName = e.Item.TitleCondensedFormatted.ToString();
-
- // Let the user draw on the map view using the chosen sketch mode
- SketchCreationMode creationMode = (SketchCreationMode)_sketchModeDictionary[sketchModeName];
- Geometry geometry = await _myMapView.SketchEditor.StartAsync(creationMode, true);
-
- // Create and add a graphic from the geometry the user drew
- Graphic graphic = CreateGraphic(geometry);
- _sketchOverlay.Graphics.Add(graphic);
- }
- catch (TaskCanceledException)
- {
- // Ignore ... let the user cancel drawing
- }
- catch (Exception ex)
- {
- // Report exceptions
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Error drawing graphic shape");
- alertBuilder.SetMessage(ex.Message);
- alertBuilder.Show();
- }
- }
-
- private async void OnEditClicked(object sender, EventArgs e)
- {
- try
- {
- // Allow the user to select a graphic
- Graphic editGraphic = await GetGraphicAsync();
- if (editGraphic == null) { return; }
-
- // Let the user make changes to the graphic's geometry, await the result (updated geometry)
- Geometry newGeometry = await _myMapView.SketchEditor.StartAsync(editGraphic.Geometry);
-
- // Display the updated geometry in the graphic
- editGraphic.Geometry = newGeometry;
- }
- catch (TaskCanceledException)
- {
- // Ignore ... let the user cancel editing
- }
- catch (Exception ex)
- {
- // Report exceptions
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Error editing shape");
- alertBuilder.SetMessage(ex.Message);
- alertBuilder.Show();
- }
- }
-
- private void OnClearClicked(object sender, EventArgs e)
- {
- // Remove all graphics from the graphics overlay
- _sketchOverlay.Graphics.Clear();
-
- // Cancel any uncompleted sketch
- if (_myMapView.SketchEditor.CancelCommand.CanExecute(null))
- {
- _myMapView.SketchEditor.CancelCommand.Execute(null);
- }
- }
-
- private void OnCompleteClicked(object sender, EventArgs e)
- {
- // Execute the CompleteCommand on the sketch editor
- if (_myMapView.SketchEditor.CompleteCommand.CanExecute(null))
- {
- _myMapView.SketchEditor.CompleteCommand.Execute(null);
- }
- }
-
- private void OnRedoClicked(object sender, EventArgs e)
- {
- // Execute the RedoCommand on the sketch editor
- if (_myMapView.SketchEditor.RedoCommand.CanExecute(null))
- {
- _myMapView.SketchEditor.RedoCommand.Execute(null);
- }
- }
-
- private void OnUndoClicked(object sender, EventArgs e)
- {
- // Execute the UndoCommand on the sketch editor
- if (_myMapView.SketchEditor.UndoCommand.CanExecute(null))
- {
- _myMapView.SketchEditor.UndoCommand.Execute(null);
- }
- }
-
- private void GraphicsChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
- {
- // Enable or disable the clear and edit buttons depending on whether or not graphics exist
- bool haveGraphics = _sketchOverlay.Graphics.Count > 0;
- _editButton.Enabled = haveGraphics;
- _clearButton.Enabled = haveGraphics;
- }
-
- private void CanExecuteChanged(object sender, EventArgs e)
- {
- // Enable or disable the corresponding command for the sketch editor
- ICommand command = (ICommand)sender;
- if (command == _myMapView.SketchEditor.UndoCommand)
- {
- _undoButton.Enabled = command.CanExecute(null);
- }
- else if (command == _myMapView.SketchEditor.RedoCommand)
- {
- _redoButton.Enabled = command.CanExecute(null);
- }
- else if (command == _myMapView.SketchEditor.CompleteCommand)
- {
- _doneButton.Enabled = command.CanExecute(null);
- }
- }
-
- #region Graphic and symbol helpers
-
- private Graphic CreateGraphic(Geometry geometry)
- {
- // Create a graphic to display the specified geometry
- Symbol symbol = null;
- switch (geometry.GeometryType)
- {
- // Symbolize with a fill symbol
- case GeometryType.Envelope:
- case GeometryType.Polygon:
- {
- symbol = new SimpleFillSymbol()
- {
- Color = Color.Red,
- Style = SimpleFillSymbolStyle.Solid
- };
- break;
- }
- // Symbolize with a line symbol
- case GeometryType.Polyline:
- {
- symbol = new SimpleLineSymbol()
- {
- Color = Color.Red,
- Style = SimpleLineSymbolStyle.Solid,
- Width = 5d
- };
- break;
- }
- // Symbolize with a marker symbol
- case GeometryType.Point:
- case GeometryType.Multipoint:
- {
- symbol = new SimpleMarkerSymbol()
- {
- Color = Color.Red,
- Style = SimpleMarkerSymbolStyle.Circle,
- Size = 15d
- };
- break;
- }
- }
-
- // pass back a new graphic with the appropriate symbol
- return new Graphic(geometry, symbol);
- }
-
- private async Task GetGraphicAsync()
- {
- // Wait for the user to click a location on the map
- Geometry mapPoint = await _myMapView.SketchEditor.StartAsync(SketchCreationMode.Point, false);
-
- // Convert the map point to a screen point
- Android.Graphics.PointF screenCoordinate = _myMapView.LocationToScreen((MapPoint)mapPoint);
-
- // Identify graphics in the graphics overlay using the point
- IReadOnlyList results = await _myMapView.IdentifyGraphicsOverlaysAsync(screenCoordinate, 2, false);
-
- // If results were found, get the first graphic
- Graphic graphic = null;
- IdentifyGraphicsOverlayResult idResult = results.FirstOrDefault();
- if (idResult != null && idResult.Graphics.Count > 0)
- {
- graphic = idResult.Graphics.FirstOrDefault();
- }
-
- // Return the graphic (or null if none were found)
- return graphic;
- }
-
- #endregion Graphic and symbol helpers
-
- private async void SketchGeometry(string sketchModeName)
- {
- try
- {
- // Let the user draw on the map view using the chosen sketch mode
- SketchCreationMode creationMode = (SketchCreationMode)_sketchModeDictionary[sketchModeName];
- Geometry geometry = await _myMapView.SketchEditor.StartAsync(creationMode, true);
-
- // Create and add a graphic from the geometry the user drew
- Graphic graphic = CreateGraphic(geometry);
- _sketchOverlay.Graphics.Add(graphic);
- }
- catch (TaskCanceledException)
- {
- // Ignore ... let the user cancel drawing
- }
- catch (Exception ex)
- {
- // Report exceptions
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Error drawing graphic shape");
- alertBuilder.SetMessage(ex.Message);
- alertBuilder.Show();
- }
- }
-
- private async void EditGraphic()
- {
- try
- {
- // Allow the user to select a graphic
- Graphic editGraphic = await GetGraphicAsync();
- if (editGraphic == null) { return; }
-
- // Let the user make changes to the graphic's geometry, await the result (updated geometry)
- Geometry newGeometry = await _myMapView.SketchEditor.StartAsync(editGraphic.Geometry);
-
- // Display the updated geometry in the graphic
- editGraphic.Geometry = newGeometry;
- }
- catch (TaskCanceledException)
- {
- // Ignore ... let the user cancel editing
- }
- catch (Exception ex)
- {
- // Report exceptions
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
- alertBuilder.SetTitle("Error editing shape");
- alertBuilder.SetMessage(ex.Message);
- alertBuilder.Show();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SketchOnMap/SketchOnMap.jpg b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SketchOnMap/SketchOnMap.jpg
deleted file mode 100644
index 2615606587..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SketchOnMap/SketchOnMap.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SketchOnMap/readme.metadata.json b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SketchOnMap/readme.metadata.json
deleted file mode 100644
index 7ceffc846b..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SketchOnMap/readme.metadata.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "category": "GraphicsOverlay",
- "description": "Use the Sketch Editor to edit or sketch a new point, line, or polygon geometry on to a map.",
- "formal_name": "SketchOnMap",
- "ignore": false,
- "images": [
- "SketchOnMap.jpg"
- ],
- "keywords": [
- "draw",
- "edit"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/sketchonmap.htm"
- ],
- "relevant_apis": [
- "Geometry",
- "Graphic",
- "GraphicsOverlay",
- "MapView",
- "SketchCreationMode",
- "SketchEditor"
- ],
- "snippets": [
- "SketchOnMap.cs"
- ],
- "title": "Sketch on map"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SurfacePlacements/SurfacePlacements.cs b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SurfacePlacements/SurfacePlacements.cs
deleted file mode 100644
index 809621011b..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SurfacePlacements/SurfacePlacements.cs
+++ /dev/null
@@ -1,206 +0,0 @@
-// Copyright 2019 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using Android.App;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.Symbology;
-using Esri.ArcGISRuntime.UI;
-using Esri.ArcGISRuntime.UI.Controls;
-using System;
-using System.Drawing;
-
-namespace ArcGISRuntime.Samples.SurfacePlacements
-{
- [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Surface placement",
- category: "GraphicsOverlay",
- description: "Position graphics relative to a surface using different surface placement modes.",
- instructions: "The application loads a scene showing four points that use individual surface placement modes (Absolute, Relative, Relative to Scene, and either Draped Billboarded or Draped Flat). Use the toggle to change the draped mode and the slider to dynamically adjust the Z value of the graphics. Explore the scene by zooming in/out and by panning around to observe the effects of the surface placement rules.",
- tags: new[] { "3D", "absolute", "altitude", "draped", "elevation", "floating", "relative", "scenes", "sea level", "surface placement" })]
- [Shared.Attributes.AndroidLayout("FindFeaturesUtilityNetwork.xml")]
- public class SurfacePlacements : Activity
- {
- // Hold references to UI elements.
- private SceneView _mySceneView;
- private RadioButton _billboardedButton;
- private RadioButton _flatButton;
- private SeekBar _zSlider;
- private TextView _zLabel;
-
- // Draped overlays.
- private GraphicsOverlay _drapedBillboardedOverlay;
- private GraphicsOverlay _drapedFlatOverlay;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Surface placement";
-
- CreateLayout();
- Initialize();
- }
-
- private void Initialize()
- {
- // Create new Scene.
- Scene myScene = new Scene
- {
- // Set the Scene's basemap property.
- Basemap = new Basemap(BasemapStyle.ArcGISImageryStandard)
- };
-
- // Create a camera with coordinates showing layer data.
- Camera camera = new Camera(48.389124348393182, -4.4595173327138591, 140, 322, 74, 0);
-
- // Assign the Scene to the SceneView.
- _mySceneView.Scene = myScene;
-
- // Create ElevationSource from elevation data Uri.
- ArcGISTiledElevationSource elevationSource = new ArcGISTiledElevationSource(
- new Uri("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"));
-
- // Create scene layer from the Brest, France scene server.
- var sceneLayer = new ArcGISSceneLayer(new Uri("https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Buildings_Brest/SceneServer"));
- _mySceneView.Scene.OperationalLayers.Add(sceneLayer);
-
- // Add elevationSource to BaseSurface's ElevationSources.
- _mySceneView.Scene.BaseSurface.ElevationSources.Add(elevationSource);
-
- // Set view point of scene view using camera.
- _mySceneView.SetViewpointCameraAsync(camera);
-
- // Create overlays with elevation modes.
- _drapedBillboardedOverlay = new GraphicsOverlay();
- _drapedBillboardedOverlay.SceneProperties.SurfacePlacement = SurfacePlacement.DrapedBillboarded;
- _mySceneView.GraphicsOverlays.Add(_drapedBillboardedOverlay);
-
- _drapedFlatOverlay = new GraphicsOverlay();
- _drapedFlatOverlay.SceneProperties.SurfacePlacement = SurfacePlacement.DrapedFlat;
-
- GraphicsOverlay relativeToSceneOverlay = new GraphicsOverlay();
- relativeToSceneOverlay.SceneProperties.SurfacePlacement = SurfacePlacement.RelativeToScene;
- _mySceneView.GraphicsOverlays.Add(relativeToSceneOverlay);
-
- GraphicsOverlay relativeToSurfaceOverlay = new GraphicsOverlay();
- relativeToSurfaceOverlay.SceneProperties.SurfacePlacement = SurfacePlacement.Relative;
- _mySceneView.GraphicsOverlays.Add(relativeToSurfaceOverlay);
-
- GraphicsOverlay absoluteOverlay = new GraphicsOverlay();
- absoluteOverlay.SceneProperties.SurfacePlacement = SurfacePlacement.Absolute;
- _mySceneView.GraphicsOverlays.Add(absoluteOverlay);
-
- // Create point for graphic location.
- MapPoint sceneRelatedPoint = new MapPoint(-4.4610562, 48.3902727, 70, camera.Location.SpatialReference);
- MapPoint surfaceRelatedPoint = new MapPoint(-4.4609257, 48.3903965, 70, camera.Location.SpatialReference);
-
- // Create a red triangle symbol.
- var triangleSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Triangle, Color.FromArgb(255, 255, 0, 0), 10);
-
- // Create a text symbol for each elevation mode.
- TextSymbol drapedBillboardedText = new TextSymbol("DRAPED BILLBOARDED", Color.FromArgb(255, 0, 0, 255), 10,
- Esri.ArcGISRuntime.Symbology.HorizontalAlignment.Center,
- Esri.ArcGISRuntime.Symbology.VerticalAlignment.Middle);
- drapedBillboardedText.OffsetY += 20;
-
- TextSymbol drapedFlatText = new TextSymbol("DRAPED FLAT", Color.FromArgb(255, 0, 0, 255), 10,
- Esri.ArcGISRuntime.Symbology.HorizontalAlignment.Center,
- Esri.ArcGISRuntime.Symbology.VerticalAlignment.Middle);
- drapedFlatText.OffsetY += 20;
-
- TextSymbol relativeToSurfaceText = new TextSymbol("RELATIVE TO SURFACE", Color.FromArgb(255, 0, 0, 255), 10,
- Esri.ArcGISRuntime.Symbology.HorizontalAlignment.Center,
- Esri.ArcGISRuntime.Symbology.VerticalAlignment.Middle);
- relativeToSurfaceText.OffsetY += 20;
-
- TextSymbol relativeToSceneText = new TextSymbol("RELATIVE TO SCENE", Color.FromArgb(255, 0, 0, 255), 10,
- Esri.ArcGISRuntime.Symbology.HorizontalAlignment.Center,
- Esri.ArcGISRuntime.Symbology.VerticalAlignment.Middle);
- relativeToSceneText.OffsetY -= 20;
-
- TextSymbol absoluteText = new TextSymbol("ABSOLUTE", Color.FromArgb(255, 0, 0, 255), 10,
- Esri.ArcGISRuntime.Symbology.HorizontalAlignment.Center,
- Esri.ArcGISRuntime.Symbology.VerticalAlignment.Middle);
- absoluteText.OffsetY += 20;
-
- // Add the point graphic and text graphic to the corresponding graphics overlay.
- _drapedBillboardedOverlay.Graphics.Add(new Graphic(surfaceRelatedPoint, triangleSymbol));
- _drapedBillboardedOverlay.Graphics.Add(new Graphic(surfaceRelatedPoint, drapedBillboardedText));
-
- _drapedFlatOverlay.Graphics.Add(new Graphic(surfaceRelatedPoint, triangleSymbol));
- _drapedFlatOverlay.Graphics.Add(new Graphic(surfaceRelatedPoint, drapedFlatText));
-
- relativeToSceneOverlay.Graphics.Add(new Graphic(sceneRelatedPoint, triangleSymbol));
- relativeToSceneOverlay.Graphics.Add(new Graphic(sceneRelatedPoint, relativeToSceneText));
-
- relativeToSurfaceOverlay.Graphics.Add(new Graphic(surfaceRelatedPoint, triangleSymbol));
- relativeToSurfaceOverlay.Graphics.Add(new Graphic(surfaceRelatedPoint, relativeToSurfaceText));
-
- absoluteOverlay.Graphics.Add(new Graphic(surfaceRelatedPoint, triangleSymbol));
- absoluteOverlay.Graphics.Add(new Graphic(surfaceRelatedPoint, absoluteText));
- absoluteOverlay.Graphics.Add(new Graphic(surfaceRelatedPoint, absoluteText));
- }
-
- private void SetBillboarded(object sender, EventArgs e)
- {
- _mySceneView.GraphicsOverlays.Remove(_drapedFlatOverlay);
- _mySceneView.GraphicsOverlays.Add(_drapedBillboardedOverlay);
- }
-
- private void SetFlat(object sender, EventArgs e)
- {
- _mySceneView.GraphicsOverlays.Remove(_drapedBillboardedOverlay);
- _mySceneView.GraphicsOverlays.Add(_drapedFlatOverlay);
- }
-
- private void ZValueChanged(object sender, SeekBar.ProgressChangedEventArgs e)
- {
- foreach (GraphicsOverlay overlay in _mySceneView.GraphicsOverlays)
- {
- foreach (Graphic graphic in overlay.Graphics)
- {
- graphic.Geometry = GeometryEngine.SetZ(graphic.Geometry, _zSlider.Progress);
- }
- }
- _zLabel.Text = $"{_zSlider.Progress} meters";
- }
-
- private void CreateLayout()
- {
- // Create a new layout for the app.
- SetContentView(Resource.Layout.SurfacePlacements);
-
- _mySceneView = FindViewById(Resource.Id.SceneView);
-
- _billboardedButton = FindViewById(Resource.Id.billboardedButton);
- _flatButton = FindViewById(Resource.Id.flatButton);
- _zSlider = FindViewById(Resource.Id.Slider);
- _zLabel = FindViewById(Resource.Id.ValueLabel);
-
- _billboardedButton.Click += SetBillboarded;
- _flatButton.Click += SetFlat;
- _zSlider.ProgressChanged += ZValueChanged;
- }
-
- protected override void OnDestroy()
- {
- base.OnDestroy();
-
- // Remove the sceneview
- (_mySceneView.Parent as ViewGroup).RemoveView(_mySceneView);
- _mySceneView.Dispose();
- _mySceneView = null;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SurfacePlacements/SurfacePlacements.jpg b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SurfacePlacements/SurfacePlacements.jpg
deleted file mode 100644
index 1cf8a2ae90..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SurfacePlacements/SurfacePlacements.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SurfacePlacements/readme.metadata.json b/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SurfacePlacements/readme.metadata.json
deleted file mode 100644
index 07b61009a9..0000000000
--- a/src/Android/Xamarin.Android/Samples/GraphicsOverlay/SurfacePlacements/readme.metadata.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "category": "GraphicsOverlay",
- "description": "Position graphics relative to a surface using different surface placement modes.",
- "formal_name": "SurfacePlacements",
- "ignore": false,
- "images": [
- "SurfacePlacements.jpg"
- ],
- "keywords": [
- "3D",
- "absolute",
- "altitude",
- "draped",
- "elevation",
- "floating",
- "relative",
- "scenes",
- "sea level",
- "surface placement"
- ],
- "offline_data": [],
- "redirect_from": [
- "/net/latest/android/sample-code/surfaceplacements.htm"
- ],
- "relevant_apis": [
- "Graphic",
- "GraphicsOverlay",
- "SceneProperties",
- "SceneProperties.SurfacePlacement",
- "Surface"
- ],
- "snippets": [
- "../../../Resources/layout/SurfacePlacements.xml",
- "SurfacePlacements.cs"
- ],
- "title": "Surface placement"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Hydrography/AddEncExchangeSet/AddEncExchangeSet.cs b/src/Android/Xamarin.Android/Samples/Hydrography/AddEncExchangeSet/AddEncExchangeSet.cs
deleted file mode 100644
index ec66f81a60..0000000000
--- a/src/Android/Xamarin.Android/Samples/Hydrography/AddEncExchangeSet/AddEncExchangeSet.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using System;
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using ArcGISRuntime.Samples.Managers;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Hydrography;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using System.Collections.Generic;
-
-namespace ArcGISRuntimeXamarin.Samples.AddEncExchangeSet
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Add ENC exchange set",
- category: "Hydrography",
- description: "Display nautical charts per the ENC specification.",
- instructions: "Run the sample and view the ENC data. Pan and zoom around the map. Take note of the high level of detail in the data and the smooth rendering of the layer.",
- tags: new[] { "Data", "ENC", "hydrographic", "layers", "maritime", "nautical chart" })]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("9d2987a825c646468b3ce7512fb76e2d")]
- public class AddEncExchangeSet : Activity
- {
- // Hold a reference to the map view
- private MapView _myMapView;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "Add an ENC exchange set";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- private async void Initialize()
- {
- // Initialize the map with an oceans basemap
- _myMapView.Map = new Map(BasemapStyle.ArcGISOceans);
-
- // Get the path to the ENC Exchange Set
- string encPath = DataManager.GetDataFolder("9d2987a825c646468b3ce7512fb76e2d", "ExchangeSetwithoutUpdates", "ENC_ROOT", "CATALOG.031");
-
- // Create the Exchange Set
- // Note: this constructor takes an array of paths because so that update sets can be loaded alongside base data
- EncExchangeSet myEncExchangeSet = new EncExchangeSet( encPath );
-
- try
- {
- // Wait for the layer to load
- await myEncExchangeSet.LoadAsync();
-
- // Store a list of data set extent's - will be used to zoom the mapview to the full extent of the Exchange Set
- List dataSetExtents = new List();
-
- // Add each data set as a layer
- foreach (EncDataset myEncDataSet in myEncExchangeSet.Datasets)
- {
- EncLayer myEncLayer = new EncLayer(new EncCell(myEncDataSet));
-
- // Add the layer to the map
- _myMapView.Map.OperationalLayers.Add(myEncLayer);
-
- // Wait for the layer to load
- await myEncLayer.LoadAsync();
-
- // Add the extent to the list of extents
- dataSetExtents.Add(myEncLayer.FullExtent);
- }
-
- // Use the geometry engine to compute the full extent of the ENC Exchange Set
- Envelope fullExtent = GeometryEngine.CombineExtents(dataSetExtents);
-
- // Set the viewpoint
- await _myMapView.SetViewpointAsync(new Viewpoint(fullExtent));
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add the map view to the layout
- _myMapView = new MapView(this);
- layout.AddView(_myMapView);
-
- // Show the layout in the app
- SetContentView(layout);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Hydrography/AddEncExchangeSet/AddEncExchangeSet.jpg b/src/Android/Xamarin.Android/Samples/Hydrography/AddEncExchangeSet/AddEncExchangeSet.jpg
deleted file mode 100644
index f8350a4109..0000000000
Binary files a/src/Android/Xamarin.Android/Samples/Hydrography/AddEncExchangeSet/AddEncExchangeSet.jpg and /dev/null differ
diff --git a/src/Android/Xamarin.Android/Samples/Hydrography/AddEncExchangeSet/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Hydrography/AddEncExchangeSet/readme.metadata.json
deleted file mode 100644
index f70d4c5b15..0000000000
--- a/src/Android/Xamarin.Android/Samples/Hydrography/AddEncExchangeSet/readme.metadata.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "category": "Hydrography",
- "description": "Display nautical charts per the ENC specification.",
- "formal_name": "AddEncExchangeSet",
- "ignore": false,
- "images": [
- "AddEncExchangeSet.jpg"
- ],
- "keywords": [
- "Data",
- "ENC",
- "hydrographic",
- "layers",
- "maritime",
- "nautical chart"
- ],
- "offline_data": [
- "9d2987a825c646468b3ce7512fb76e2d"
- ],
- "redirect_from": [
- "/net/latest/android/sample-code/addencexchangeset.htm"
- ],
- "relevant_apis": [
- "EncCell",
- "EncDataset",
- "EncExchangeSet",
- "EncLayer"
- ],
- "snippets": [
- "AddEncExchangeSet.cs"
- ],
- "title": "Add ENC exchange set"
-}
\ No newline at end of file
diff --git a/src/Android/Xamarin.Android/Samples/Hydrography/ChangeEncDisplaySettings/ChangeEncDisplaySettings.cs b/src/Android/Xamarin.Android/Samples/Hydrography/ChangeEncDisplaySettings/ChangeEncDisplaySettings.cs
deleted file mode 100644
index 19af6d63d5..0000000000
--- a/src/Android/Xamarin.Android/Samples/Hydrography/ChangeEncDisplaySettings/ChangeEncDisplaySettings.cs
+++ /dev/null
@@ -1,197 +0,0 @@
-// Copyright 2018 Esri.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
-// language governing permissions and limitations under the License.
-
-using System;
-using Android.App;
-using Android.OS;
-using Android.Widget;
-using ArcGISRuntime.Samples.Managers;
-using Esri.ArcGISRuntime.Geometry;
-using Esri.ArcGISRuntime.Hydrography;
-using Esri.ArcGISRuntime.Mapping;
-using Esri.ArcGISRuntime.UI.Controls;
-using System.Collections.Generic;
-
-namespace ArcGISRuntimeXamarin.Samples.ChangeEncDisplaySettings
-{
- [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
- [ArcGISRuntime.Samples.Shared.Attributes.Sample(
- name: "Change ENC display settings",
- category: "Hydrography",
- description: "Configure the display of ENC content.",
- instructions: "The sample displays an electronic navigational chart when it opens. Use the options to choose variations on colors and symbology.",
- tags: new[] { "ENC", "IHO", "S-52", "S-57", "display", "hydrographic", "hydrography", "layers", "maritime", "nautical chart", "settings", "symbology" })]
- [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("9d2987a825c646468b3ce7512fb76e2d")]
- public class ChangeEncDisplaySettings : Activity
- {
- // Hold a reference to the map view
- private MapView _myMapView;
-
- // Hold a reference to the (static) app-wide mariner settings
- private EncMarinerSettings _encMarinerSettings = EncEnvironmentSettings.Default.DisplaySettings.MarinerSettings;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- Title = "ENC Display Settings";
-
- // Create the UI, setup the control references and execute initialization
- CreateLayout();
- Initialize();
- }
-
- protected override void OnStop()
- {
- base.OnStop();
- // ENC environment settings apply to the entire application
- // They need to be reset after leaving the sample to avoid affecting other samples
- EncEnvironmentSettings.Default.DisplaySettings.MarinerSettings.ResetToDefaults();
- EncEnvironmentSettings.Default.DisplaySettings.ViewingGroupSettings.ResetToDefaults();
- EncEnvironmentSettings.Default.DisplaySettings.TextGroupVisibilitySettings.ResetToDefaults();
- }
-
- private async void Initialize()
- {
- // Initialize the map with an oceans basemap
- _myMapView.Map = new Map(BasemapStyle.ArcGISOceans);
-
- // Get the path to the ENC Exchange Set
- string encPath = DataManager.GetDataFolder("9d2987a825c646468b3ce7512fb76e2d", "ExchangeSetwithoutUpdates", "ENC_ROOT",
- "CATALOG.031");
-
- // Create the Exchange Set
- // Note: this constructor takes an array of paths because so that update sets can be loaded alongside base data
- EncExchangeSet myEncExchangeSet = new EncExchangeSet( encPath );
-
- try
- {
- // Wait for the layer to load
- await myEncExchangeSet.LoadAsync();
-
- // Store a list of data set extent's - will be used to zoom the mapview to the full extent of the Exchange Set
- List dataSetExtents = new List();
-
- // Add each data set as a layer
- foreach (EncDataset myEncDataSet in myEncExchangeSet.Datasets)
- {
- EncLayer myEncLayer = new EncLayer(new EncCell(myEncDataSet));
-
- // Add the layer to the map
- _myMapView.Map.OperationalLayers.Add(myEncLayer);
-
- // Wait for the layer to load
- await myEncLayer.LoadAsync();
-
- // Add the extent to the list of extents
- dataSetExtents.Add(myEncLayer.FullExtent);
- }
-
- // Use the geometry engine to compute the full extent of the ENC Exchange Set
- Envelope fullExtent = GeometryEngine.CombineExtents(dataSetExtents);
-
- // Set the viewpoint
- _myMapView.SetViewpoint(new Viewpoint(fullExtent));
- }
- catch (Exception e)
- {
- new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
- }
- }
-
- private void CreateLayout()
- {
- // Create a new vertical layout for the app
- LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
-
- // Add controls for display settings
- layout.AddView(new TextView(this) { Text = "Color Scheme:" });
- Spinner colorSpinner = new Spinner(this);
- ArrayAdapter colorAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, new List() { "Day", "Dusk", "Night" });
- colorSpinner.Adapter = colorAdapter;
- layout.AddView(colorSpinner);
-
- layout.AddView(new TextView(this) { Text = "Area Symbolization:" });
- Spinner areaSpinner = new Spinner(this);
- ArrayAdapter areaAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, new List() { "Plain", "Symbolized" });
- areaSpinner.Adapter = areaAdapter;
- layout.AddView(areaSpinner);
-
- layout.AddView(new TextView(this) { Text = "Point Symbolization:" });
- Spinner pointSpinner = new Spinner(this);
- ArrayAdapter pointAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, new List