Skip to content

Commit 0db6d96

Browse files
New Basemaps: Editing Category (#600)
* Update AddFeaturesSample.java * Update DeleteFeaturesSample.java * Update EditFeatureAttachmentsSample.java * Update EditFeaturesWithFeatureLinkedAnnotationSample.java * Update EditWithBranchVersioningController.java * Update UpdateAttributesSample.java * Update UpdateGeometriesSample.java * Fix comments and reorder map view * Add features - set viewpoint on mapview * Delete features - set viewpoint on mapview * Edit feature attachments - set viewpoint on mapview * Feature-linked annotation - set viewpoint on mapview * Update attributes - set viewpoint on mapview * Update geometries - set viewpoint on mapview * Add features - tidy comment * Delete features - tidy comment * Tidy comments * update build.gradle - versions * Make comments and viewpoint scales consistent Co-authored-by: sclaridge <[email protected]>
1 parent a18da09 commit 0db6d96

File tree

14 files changed

+100
-41
lines changed

14 files changed

+100
-41
lines changed

editing/add-features/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
group = 'com.esri.samples'
77

88
ext {
9-
arcgisVersion = '100.9.0'
9+
arcgisVersion = '100.10.0-2992'
1010
}
1111

1212
javafx {

editing/add-features/src/main/java/com/esri/samples/add_features/AddFeaturesSample.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import javafx.scene.layout.StackPane;
3232
import javafx.stage.Stage;
3333

34+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3435
import com.esri.arcgisruntime.concurrent.ListenableFuture;
3536
import com.esri.arcgisruntime.data.Feature;
3637
import com.esri.arcgisruntime.data.FeatureEditResult;
@@ -39,7 +40,8 @@
3940
import com.esri.arcgisruntime.geometry.Point;
4041
import com.esri.arcgisruntime.layers.FeatureLayer;
4142
import com.esri.arcgisruntime.mapping.ArcGISMap;
42-
import com.esri.arcgisruntime.mapping.Basemap;
43+
import com.esri.arcgisruntime.mapping.BasemapStyle;
44+
import com.esri.arcgisruntime.mapping.Viewpoint;
4345
import com.esri.arcgisruntime.mapping.view.MapView;
4446

4547
public class AddFeaturesSample extends Application {
@@ -66,11 +68,19 @@ public void start(Stage stage) {
6668
stage.setScene(scene);
6769
stage.show();
6870

69-
// create a map with streets basemap
70-
ArcGISMap map = new ArcGISMap(Basemap.Type.STREETS, 40, -95, 4);
71+
// authentication with an API key or named user is required to access basemaps and other location services
72+
String yourAPIKey = System.getProperty("apiKey");
73+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
7174

72-
// create a view for this ArcGISMap
75+
// create a map with the streets basemap style
76+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_STREETS);
77+
78+
// create a map view and set the map to it
7379
mapView = new MapView();
80+
mapView.setMap(map);
81+
82+
// set a viewpoint on the map view
83+
mapView.setViewpoint(new Viewpoint(40, -95, 36978595));
7484

7585
// create service feature table from URL
7686
featureTable = new ServiceFeatureTable(SERVICE_LAYER_URL);
@@ -99,9 +109,6 @@ public void start(Stage stage) {
99109
}
100110
});
101111

102-
// set ArcGISMap to be displayed in map view
103-
mapView.setMap(map);
104-
105112
// add the map view to stack pane
106113
stackPane.getChildren().addAll(mapView);
107114

editing/delete-features/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
group = 'com.esri.samples'
77

88
ext {
9-
arcgisVersion = '100.9.0'
9+
arcgisVersion = '100.10.0-2992'
1010
}
1111

1212
javafx {

editing/delete-features/src/main/java/com/esri/samples/delete_features/DeleteFeaturesSample.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,16 @@
3333
import javafx.scene.layout.StackPane;
3434
import javafx.stage.Stage;
3535

36+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3637
import com.esri.arcgisruntime.concurrent.ListenableFuture;
3738
import com.esri.arcgisruntime.data.Feature;
3839
import com.esri.arcgisruntime.data.FeatureEditResult;
3940
import com.esri.arcgisruntime.data.FeatureQueryResult;
4041
import com.esri.arcgisruntime.data.ServiceFeatureTable;
4142
import com.esri.arcgisruntime.layers.FeatureLayer;
4243
import com.esri.arcgisruntime.mapping.ArcGISMap;
43-
import com.esri.arcgisruntime.mapping.Basemap;
44+
import com.esri.arcgisruntime.mapping.BasemapStyle;
45+
import com.esri.arcgisruntime.mapping.Viewpoint;
4446
import com.esri.arcgisruntime.mapping.view.IdentifyLayerResult;
4547
import com.esri.arcgisruntime.mapping.view.MapView;
4648

@@ -70,6 +72,10 @@ public void start(Stage stage) {
7072
stage.setScene(scene);
7173
stage.show();
7274

75+
// authentication with an API key or named user is required to access basemaps and other location services
76+
String yourAPIKey = System.getProperty("apiKey");
77+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
78+
7379
// create a delete button and fill the width of the screen
7480
deleteButton = new Button("Delete");
7581
deleteButton.setMaxWidth(130);
@@ -90,11 +96,15 @@ public void start(Stage stage) {
9096
});
9197
});
9298

93-
// create a map with streets basemap
94-
ArcGISMap map = new ArcGISMap(Basemap.Type.STREETS, 40, -95, 4);
99+
// create a map with the streets basemap style
100+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_STREETS);
95101

96-
// create a view for this ArcGISMap
102+
// create a map view and set the map to it
97103
mapView = new MapView();
104+
mapView.setMap(map);
105+
106+
// set a viewpoint on the map view
107+
mapView.setViewpoint(new Viewpoint(40, -95, 36978595));
98108

99109
// create service feature table from URL
100110
featureTable = new ServiceFeatureTable(FEATURE_LAYER_URL);
@@ -130,9 +140,6 @@ public void start(Stage stage) {
130140
}
131141
});
132142

133-
// set ArcGISMap to be displayed in map view
134-
mapView.setMap(map);
135-
136143
// add the map view and control box to stack pane
137144
stackPane.getChildren().addAll(mapView, deleteButton);
138145
StackPane.setAlignment(deleteButton, Pos.TOP_LEFT);

editing/edit-feature-attachments/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
group = 'com.esri.samples'
77

88
ext {
9-
arcgisVersion = '100.9.0'
9+
arcgisVersion = '100.10.0-2992'
1010
}
1111

1212
javafx {

editing/edit-feature-attachments/src/main/java/com/esri/samples/edit_feature_attachments/EditFeatureAttachmentsSample.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import javafx.scene.paint.Paint;
4040
import javafx.stage.Stage;
4141

42+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
4243
import com.esri.arcgisruntime.concurrent.ListenableFuture;
4344
import com.esri.arcgisruntime.data.ArcGISFeature;
4445
import com.esri.arcgisruntime.data.Attachment;
@@ -47,8 +48,9 @@
4748
import com.esri.arcgisruntime.layers.FeatureLayer;
4849
import com.esri.arcgisruntime.loadable.LoadStatus;
4950
import com.esri.arcgisruntime.mapping.ArcGISMap;
50-
import com.esri.arcgisruntime.mapping.Basemap;
51+
import com.esri.arcgisruntime.mapping.BasemapStyle;
5152
import com.esri.arcgisruntime.mapping.GeoElement;
53+
import com.esri.arcgisruntime.mapping.Viewpoint;
5254
import com.esri.arcgisruntime.mapping.view.IdentifyLayerResult;
5355
import com.esri.arcgisruntime.mapping.view.MapView;
5456

@@ -78,6 +80,10 @@ public void start(Stage stage) {
7880
stage.setScene(scene);
7981
stage.show();
8082

83+
// authentication with an API key or named user is required to access basemaps and other location services
84+
String yourAPIKey = System.getProperty("apiKey");
85+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
86+
8187
// create a control panel
8288
VBox controlsVBox = new VBox(6);
8389
controlsVBox.setBackground(new Background(new BackgroundFill(Paint.valueOf("rgba(0,0,0,0.3)"), CornerRadii.EMPTY,
@@ -113,13 +119,16 @@ public void start(Stage stage) {
113119
// add controls to the panel
114120
controlsVBox.getChildren().addAll(addAttachmentButton, deleteAttachmentButton, attachmentsLabel, attachmentList);
115121

116-
// create a map view
117-
mapView = new MapView();
122+
// create a map with the streets basemap style
123+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_STREETS);
118124

119-
// create a map with streets basemap and set it to the map view
120-
ArcGISMap map = new ArcGISMap(Basemap.Type.STREETS, 40, -95, 4);
125+
// create a map view and set the map to it
126+
mapView = new MapView();
121127
mapView.setMap(map);
122128

129+
// set a viewpoint on the map view
130+
mapView.setViewpoint(new Viewpoint(40, -95, 36978595));
131+
123132
// set selection color
124133
mapView.getSelectionProperties().setColor(0xff0000ff);
125134

editing/edit-features-with-feature-linked-annotation/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
group = 'com.esri.samples'
77

88
ext {
9-
arcgisVersion = '100.9.0'
9+
arcgisVersion = '100.10.0-2992'
1010
}
1111

1212
javafx {

editing/edit-features-with-feature-linked-annotation/src/main/java/com.esri.samples.edit_features_with_feature_linked_annotation/EditFeaturesWithFeatureLinkedAnnotationSample.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import javafx.scene.layout.StackPane;
3131
import javafx.stage.Stage;
3232

33+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3334
import com.esri.arcgisruntime.concurrent.ListenableFuture;
3435
import com.esri.arcgisruntime.data.Feature;
3536
import com.esri.arcgisruntime.data.Geodatabase;
@@ -44,7 +45,8 @@
4445
import com.esri.arcgisruntime.layers.FeatureLayer;
4546
import com.esri.arcgisruntime.loadable.LoadStatus;
4647
import com.esri.arcgisruntime.mapping.ArcGISMap;
47-
import com.esri.arcgisruntime.mapping.Basemap;
48+
import com.esri.arcgisruntime.mapping.BasemapStyle;
49+
import com.esri.arcgisruntime.mapping.Viewpoint;
4850
import com.esri.arcgisruntime.mapping.view.IdentifyLayerResult;
4951
import com.esri.arcgisruntime.mapping.view.MapView;
5052

@@ -69,13 +71,20 @@ public void start(Stage stage) {
6971
stage.setScene(scene);
7072
stage.show();
7173

72-
// create the map with a light gray canvas basemap centered on Loudoun, Virginia
73-
ArcGISMap map = new ArcGISMap(Basemap.Type.LIGHT_GRAY_CANVAS_VECTOR, 39.0204, -77.4159, 18);
74+
// authentication with an API key or named user is required to access basemaps and other location services
75+
String yourAPIKey = System.getProperty("apiKey");
76+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
7477

75-
// create a map view and set its map
78+
// create a map with the light gray basemap style
79+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_LIGHT_GRAY);
80+
81+
// create a map view and set the map to it
7682
mapView = new MapView();
7783
mapView.setMap(map);
7884

85+
// set a viewpoint on the map view centered on Loudoun, Virginia
86+
mapView.setViewpoint(new Viewpoint(39.0204, -77.4159, 2257));
87+
7988
// add the map view to stack pane
8089
stackPane.getChildren().addAll(mapView);
8190

editing/edit-with-branch-versioning/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
group = 'com.esri.samples'
77

88
ext {
9-
arcgisVersion = '100.9.0'
9+
arcgisVersion = '100.10.0-2992'
1010
}
1111

1212
javafx {

editing/edit-with-branch-versioning/src/main/java/com/esri/samples/edit_with_branch_versioning/EditWithBranchVersioningController.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import javafx.scene.input.MouseButton;
3131
import javafx.scene.layout.VBox;
3232

33+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3334
import com.esri.arcgisruntime.arcgisservices.ServiceVersionInfo;
3435
import com.esri.arcgisruntime.arcgisservices.ServiceVersionParameters;
3536
import com.esri.arcgisruntime.arcgisservices.VersionAccess;
@@ -42,7 +43,7 @@
4243
import com.esri.arcgisruntime.layers.FeatureLayer;
4344
import com.esri.arcgisruntime.loadable.LoadStatus;
4445
import com.esri.arcgisruntime.mapping.ArcGISMap;
45-
import com.esri.arcgisruntime.mapping.Basemap;
46+
import com.esri.arcgisruntime.mapping.BasemapStyle;
4647
import com.esri.arcgisruntime.mapping.GeoElement;
4748
import com.esri.arcgisruntime.mapping.Viewpoint;
4849
import com.esri.arcgisruntime.mapping.view.IdentifyLayerResult;
@@ -73,8 +74,14 @@ public class EditWithBranchVersioningController {
7374
public void initialize() {
7475

7576
try {
76-
// create a map with the streets vector basemap and set it to the map view
77-
ArcGISMap map = new ArcGISMap(Basemap.createStreetsVector());
77+
// authentication with an API key or named user is required to access basemaps and other location services
78+
String yourAPIKey = System.getProperty("apiKey");
79+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
80+
81+
// create a map with the streets basemap style
82+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_STREETS);
83+
84+
// set the map to the map view
7885
mapView.setMap(map);
7986

8087
// add the version access types to the access type combo box

0 commit comments

Comments
 (0)