You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
4
+
// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
5
+
//
6
+
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
7
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
8
+
// language governing permissions and limitations under the License.
9
+
10
+
usingAndroid.App;
11
+
usingAndroid.OS;
12
+
usingAndroid.Widget;
13
+
usingEsri.ArcGISRuntime.Geometry;
14
+
usingEsri.ArcGISRuntime.Mapping;
15
+
usingEsri.ArcGISRuntime.Symbology;
16
+
usingEsri.ArcGISRuntime.UI;
17
+
usingEsri.ArcGISRuntime.UI.Controls;
18
+
usingSystem;
19
+
usingSystem.Collections.Generic;
20
+
21
+
namespaceArcGISRuntime.Samples.ConvexHullList
22
+
{
23
+
[Activity]
24
+
[ArcGISRuntime.Samples.Shared.Attributes.Sample(
25
+
"Convex hull list",
26
+
"GeometryEngine",
27
+
"This sample demonstrates how to use the GeometryEngine.ConvexHull to generate convex hull polygon(s) from multiple input geometries.",
28
+
"Click the 'ConvexHull' 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.",
29
+
"Analysis","ConvexHull","GeometryEngine")]
30
+
publicclassConvexHullList:Activity
31
+
{
32
+
// Create and hold reference to the used MapView.
33
+
privateMapView_myMapView=newMapView();
34
+
35
+
// Graphics overlay to display the graphics.
36
+
privateGraphicsOverlay_graphicsOverlay;
37
+
38
+
// Graphic that represents polygon1.
39
+
privateGraphic_polygonGraphic1;
40
+
41
+
// Graphic that represents polygon2.
42
+
privateGraphic_polygonGraphic2;
43
+
44
+
// Create a Switch to choose whether to union the resulting convex hull(s).
45
+
privateSwitch_convexHullListSwitch;
46
+
47
+
// Create a Button to create convex hull(s).
48
+
privateButton_convexHullListButton;
49
+
50
+
protectedoverridevoidOnCreate(Bundlebundle)
51
+
{
52
+
base.OnCreate(bundle);
53
+
Title="Convex hull list";
54
+
55
+
// Create the UI, setup the control references and execute initialization.
56
+
CreateLayout();
57
+
Initialize();
58
+
}
59
+
60
+
privatevoidInitialize()
61
+
{
62
+
// Create a map with a topographic basemap.
63
+
MapnewMap=newMap(Basemap.CreateTopographic());
64
+
65
+
// Assign the map to the MapView.
66
+
_myMapView.Map=newMap;
67
+
68
+
// Create a graphics overlay to hold the various graphics.
69
+
_graphicsOverlay=newGraphicsOverlay();
70
+
71
+
// Add the created graphics overlay to the MapView.
Text="Click the 'ConvexHull' 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."/>
0 commit comments