Skip to content

Commit c6e93a2

Browse files
New Basemaps: Local Server and Map View Categories (#606)
* Update LocalServerFeatureLayerSample.java * Update LocalServerGeoprocessingController.java * Update LocalServerMapImageLayerSample.java * Update ChangeViewpointSample.java * Update DisplayDeviceLocationWithAutopanModesSample.java * Update DisplayDrawingStatusSample.java * Update DisplayLayerViewStateSample.java * Update IdentifyLayersSample.java * Update MapRotationSample.java * Update ScaleBarSample.java * Update ShowLocationHistorySample.java * Update TakeScreenshotSample.java * Fix comments * Scale bar - set viewpoint on mapview * Identify layers - set viewpoint on mapview * Display drawing status - reordering * Display layer view state - tidy comments * Identify layers - amend viewpoint * Show location history - tidy comment * update build.gradle - versions * Tidy comment and scale consistencies * Display drawing status - set viewpoint on map view Co-authored-by: sclaridge <[email protected]>
1 parent e2d5e37 commit c6e93a2

File tree

24 files changed

+145
-76
lines changed

24 files changed

+145
-76
lines changed

local_server/local-server-feature-layer/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 {

local_server/local-server-feature-layer/src/main/java/com/esri/samples/local_server_feature_layer/LocalServerFeatureLayerSample.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import javafx.scene.layout.StackPane;
2929
import javafx.stage.Stage;
3030

31+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3132
import com.esri.arcgisruntime.data.ServiceFeatureTable;
3233
import com.esri.arcgisruntime.geometry.Envelope;
3334
import com.esri.arcgisruntime.layers.FeatureLayer;
@@ -37,7 +38,7 @@
3738
import com.esri.arcgisruntime.localserver.LocalServerStatus;
3839
import com.esri.arcgisruntime.localserver.LocalService.StatusChangedEvent;
3940
import com.esri.arcgisruntime.mapping.ArcGISMap;
40-
import com.esri.arcgisruntime.mapping.Basemap;
41+
import com.esri.arcgisruntime.mapping.BasemapStyle;
4142
import com.esri.arcgisruntime.mapping.Viewpoint;
4243
import com.esri.arcgisruntime.mapping.view.MapView;
4344

@@ -66,8 +67,14 @@ public void start(Stage stage) {
6667
stage.setScene(scene);
6768
stage.show();
6869

69-
// create a view with a map and basemap
70-
map = new ArcGISMap(Basemap.createStreets());
70+
// authentication with an API key or named user is required to access basemaps and other location services
71+
String yourAPIKey = System.getProperty("apiKey");
72+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
73+
74+
// create a map with the streets basemap style
75+
map = new ArcGISMap(BasemapStyle.ARCGIS_STREETS);
76+
77+
// create a map view and set the map to it
7178
mapView = new MapView();
7279
mapView.setMap(map);
7380

@@ -101,7 +108,7 @@ public void start(Stage stage) {
101108
});
102109
}
103110

104-
// add view to application window
111+
// add the map view and progress indicator to the stack pane
105112
stackPane.getChildren().addAll(mapView, featureLayerProgress);
106113
StackPane.setAlignment(featureLayerProgress, Pos.CENTER);
107114
} catch (Exception e) {

local_server/local-server-geoprocessing/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 {

local_server/local-server-geoprocessing/src/main/java/com/esri/samples/local_server_geoprocessing/LocalServerGeoprocessingController.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import javafx.scene.control.ProgressBar;
2828
import javafx.scene.control.TextField;
2929

30+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3031
import com.esri.arcgisruntime.concurrent.Job;
3132
import com.esri.arcgisruntime.data.TileCache;
3233
import com.esri.arcgisruntime.layers.ArcGISMapImageLayer;
@@ -37,7 +38,7 @@
3738
import com.esri.arcgisruntime.localserver.LocalServer;
3839
import com.esri.arcgisruntime.localserver.LocalServerStatus;
3940
import com.esri.arcgisruntime.mapping.ArcGISMap;
40-
import com.esri.arcgisruntime.mapping.Basemap;
41+
import com.esri.arcgisruntime.mapping.BasemapStyle;
4142
import com.esri.arcgisruntime.mapping.view.MapView;
4243
import com.esri.arcgisruntime.tasks.geoprocessing.GeoprocessingDouble;
4344
import com.esri.arcgisruntime.tasks.geoprocessing.GeoprocessingJob;
@@ -65,8 +66,14 @@ public class LocalServerGeoprocessingController {
6566
public void initialize() {
6667

6768
try {
68-
// create a view with a map and basemap
69-
ArcGISMap map = new ArcGISMap(Basemap.createLightGrayCanvas());
69+
// authentication with an API key or named user is required to access basemaps and other location services
70+
String yourAPIKey = System.getProperty("apiKey");
71+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
72+
73+
// create a map with the light gray basemap style
74+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_LIGHT_GRAY);
75+
76+
// set the map to the map view
7077
mapView.setMap(map);
7178

7279
//load tiled layer and zoom to location

local_server/local-server-map-image-layer/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 {

local_server/local-server-map-image-layer/src/main/java/com/esri/samples/local_server_map_image_layer/LocalServerMapImageLayerSample.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import javafx.scene.layout.StackPane;
2929
import javafx.stage.Stage;
3030

31+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3132
import com.esri.arcgisruntime.geometry.Envelope;
3233
import com.esri.arcgisruntime.layers.ArcGISMapImageLayer;
3334
import com.esri.arcgisruntime.loadable.LoadStatus;
@@ -36,7 +37,7 @@
3637
import com.esri.arcgisruntime.localserver.LocalServerStatus;
3738
import com.esri.arcgisruntime.localserver.LocalService.StatusChangedEvent;
3839
import com.esri.arcgisruntime.mapping.ArcGISMap;
39-
import com.esri.arcgisruntime.mapping.Basemap;
40+
import com.esri.arcgisruntime.mapping.BasemapStyle;
4041
import com.esri.arcgisruntime.mapping.Viewpoint;
4142
import com.esri.arcgisruntime.mapping.view.MapView;
4243

@@ -64,8 +65,14 @@ public void start(Stage stage) {
6465
stage.setScene(scene);
6566
stage.show();
6667

67-
// create a view with a map and basemap
68-
ArcGISMap map = new ArcGISMap(Basemap.createStreets());
68+
// authentication with an API key or named user is required to access basemaps and other location services
69+
String yourAPIKey = System.getProperty("apiKey");
70+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
71+
72+
// create a map with the streets basemap style
73+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_STREETS);
74+
75+
// create a map view and set the map to it
6976
mapView = new MapView();
7077
mapView.setMap(map);
7178

@@ -97,7 +104,7 @@ public void start(Stage stage) {
97104
});
98105
}
99106

100-
// add view to application window with progress bar
107+
// add the map view and progress indicator to the stack pane
101108
stackPane.getChildren().addAll(mapView, imageLayerProgress);
102109
StackPane.setAlignment(imageLayerProgress, Pos.CENTER);
103110
} catch (Exception e) {

map_view/change-viewpoint/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 {

map_view/change-viewpoint/src/main/java/com/esri/samples/change_viewpoint/ChangeViewpointSample.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@
2929
import javafx.scene.paint.Paint;
3030
import javafx.stage.Stage;
3131

32+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3233
import com.esri.arcgisruntime.geometry.Point;
3334
import com.esri.arcgisruntime.geometry.PointCollection;
3435
import com.esri.arcgisruntime.geometry.Polyline;
3536
import com.esri.arcgisruntime.geometry.SpatialReference;
3637
import com.esri.arcgisruntime.geometry.SpatialReferences;
3738
import com.esri.arcgisruntime.mapping.ArcGISMap;
38-
import com.esri.arcgisruntime.mapping.Basemap;
39+
import com.esri.arcgisruntime.mapping.BasemapStyle;
3940
import com.esri.arcgisruntime.mapping.Viewpoint;
4041
import com.esri.arcgisruntime.mapping.view.MapView;
4142

@@ -62,6 +63,10 @@ public void start(Stage stage) {
6263
stage.setScene(scene);
6364
stage.show();
6465

66+
// authentication with an API key or named user is required to access basemaps and other location services
67+
String yourAPIKey = System.getProperty("apiKey");
68+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
69+
6570
// create a control panel
6671
VBox controlsVBox = new VBox(6);
6772
controlsVBox.setBackground(new Background(new BackgroundFill(Paint.valueOf("rgba(0,0,0,0.3)"), CornerRadii.EMPTY,
@@ -111,10 +116,10 @@ public void start(Stage stage) {
111116
// add controls to the user interface panel
112117
controlsVBox.getChildren().addAll(animateButton, centerButton, geometryButton);
113118

114-
// create ArcGISMap with imagery basemap
115-
ArcGISMap map = new ArcGISMap(Basemap.createImageryWithLabels());
119+
// create a map with the imagery basemap style
120+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_IMAGERY);
116121

117-
// create a view and set ArcGISMap to it
122+
// create a map view and set the map to it
118123
mapView = new MapView();
119124
mapView.setMap(map);
120125

map_view/display-device-location-with-autopan-modes/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.10.0-2934'
9+
arcgisVersion = '100.10.0-2992'
1010
}
1111

1212
javafx {

map_view/display-device-location-with-autopan-modes/src/main/java/com/esri/samples/display_device_location_with_autopan_modes/DisplayDeviceLocationWithAutopanModesSample.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,15 @@
3636
import javafx.scene.paint.Paint;
3737
import javafx.stage.Stage;
3838

39+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3940
import com.esri.arcgisruntime.geometry.Geometry;
4041
import com.esri.arcgisruntime.geometry.Polyline;
4142
import com.esri.arcgisruntime.geometry.SpatialReferences;
4243
import com.esri.arcgisruntime.loadable.LoadStatus;
4344
import com.esri.arcgisruntime.location.SimulatedLocationDataSource;
4445
import com.esri.arcgisruntime.location.SimulationParameters;
4546
import com.esri.arcgisruntime.mapping.ArcGISMap;
46-
import com.esri.arcgisruntime.mapping.Basemap;
47+
import com.esri.arcgisruntime.mapping.BasemapStyle;
4748
import com.esri.arcgisruntime.mapping.view.LocationDisplay;
4849
import com.esri.arcgisruntime.mapping.view.MapView;
4950

@@ -69,10 +70,14 @@ public void start(Stage stage) {
6970
stage.show();
7071
scene.getStylesheets().add(getClass().getResource("/display_device_location_with_autopan_modes/style.css").toExternalForm());
7172

72-
// create an ArcGISMap with the imagery basemap
73-
ArcGISMap map = new ArcGISMap(Basemap.createImagery());
73+
// authentication with an API key or named user is required to access basemaps and other location services
74+
String yourAPIKey = System.getProperty("apiKey");
75+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
7476

75-
// create a map view and add the map to it
77+
// create a map with the standard imagery basemap style
78+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_IMAGERY_STANDARD);
79+
80+
// create a map view and set the map to it
7681
mapView = new MapView();
7782
mapView.setMap(map);
7883

0 commit comments

Comments
 (0)