Skip to content

Commit 7da2819

Browse files
authored
New Basemaps: Analysis and Display Information Categories (#599)
* Analyze hotspots * Viewshed geoprocessing * Add graphics with renderer * Add graphics with symbols * Dictionary renderer graphics overlay * Display annotation - amend map constructor and fix indentation * Display grid * Identify graphics * Show callout * Show labels on layer * Sketch on map * Update graphics * Viewshed Geoprocessing - set viewpoint on mapview * Add Graphics with renderer - set viewpoint on mapview * Add Graphics with Symbols - set viewpoint on mapview * Display Annotation - set viewpoint on mapview * Sketch on map - set viewpoint on mapview * Update graphics - set viewpoint on mapview * Add graphics with symbols - correct comment * analyze hotspots - viewpoint and comment consistency * Viewshed geoprocessing - scale correction * Add graphics with renderer - scale fix * Display grid - set viewpoint on mapview * Scale and comment tidy ups * update build.gradle - versions * tidy ups
1 parent 0db6d96 commit 7da2819

File tree

24 files changed

+232
-131
lines changed

24 files changed

+232
-131
lines changed

analysis/analyze-hotspots/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 {

analysis/analyze-hotspots/src/main/java/com/esri/samples/analyze_hotspots/AnalyzeHotspotsSample.java

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

40+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
4041
import com.esri.arcgisruntime.concurrent.Job;
4142
import com.esri.arcgisruntime.concurrent.ListenableFuture;
4243
import com.esri.arcgisruntime.geometry.Point;
43-
import com.esri.arcgisruntime.geometry.SpatialReference;
44+
import com.esri.arcgisruntime.geometry.SpatialReferences;
4445
import com.esri.arcgisruntime.layers.ArcGISMapImageLayer;
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;
4849
import com.esri.arcgisruntime.mapping.Viewpoint;
4950
import com.esri.arcgisruntime.mapping.view.MapView;
5051
import com.esri.arcgisruntime.tasks.geoprocessing.GeoprocessingJob;
@@ -74,12 +75,20 @@ public void start(Stage stage) {
7475
stage.setScene(scene);
7576
stage.show();
7677

77-
// create a view with a map and topographic basemap
78-
ArcGISMap map = new ArcGISMap(Basemap.createTopographic());
79-
map.setInitialViewpoint(new Viewpoint(new Point(-13671170, 5693633, SpatialReference.create(3857)), 57779));
78+
// authentication with an API key or named user is required to access basemaps and other location services
79+
String yourAPIKey = System.getProperty("apiKey");
80+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
81+
82+
// create a map with the topographic basemap style
83+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_TOPOGRAPHIC);
84+
85+
// create a map view and set the map to it
8086
mapView = new MapView();
8187
mapView.setMap(map);
8288

89+
// set a viewpoint on the map view
90+
mapView.setViewpoint(new Viewpoint(new Point(-13671170, 5693633, SpatialReferences.getWebMercator()), 57779));
91+
8392
// show progress indicator when geoprocessing task is loading or geoprocessing job is running
8493
ProgressIndicator progress = new ProgressIndicator(ProgressIndicator.INDETERMINATE_PROGRESS);
8594
progress.setMaxWidth(30);
@@ -104,7 +113,7 @@ public void start(Stage stage) {
104113
controlsVBox.setMaxSize(180, 110);
105114
controlsVBox.getChildren().addAll(begDatePicker, endDatePicker, analyzeButton);
106115

107-
// and the mapView, controls, and progress indicator to the stack pane
116+
// add the map view, controls, and progress indicator to the stack pane
108117
stackPane.getChildren().addAll(mapView, controlsVBox, progress);
109118
StackPane.setAlignment(progress, Pos.CENTER);
110119
StackPane.setAlignment(controlsVBox, Pos.TOP_LEFT);

analysis/viewshed-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 {

analysis/viewshed-geoprocessing/src/main/java/com/esri/samples/viewshed_geoprocessing/ViewshedGeoprocessingSample.java

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

36+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3637
import com.esri.arcgisruntime.concurrent.Job;
3738
import com.esri.arcgisruntime.concurrent.ListenableFuture;
3839
import com.esri.arcgisruntime.data.Feature;
@@ -43,7 +44,8 @@
4344
import com.esri.arcgisruntime.geometry.Point;
4445
import com.esri.arcgisruntime.loadable.LoadStatus;
4546
import com.esri.arcgisruntime.mapping.ArcGISMap;
46-
import com.esri.arcgisruntime.mapping.Basemap;
47+
import com.esri.arcgisruntime.mapping.BasemapStyle;
48+
import com.esri.arcgisruntime.mapping.Viewpoint;
4749
import com.esri.arcgisruntime.mapping.view.Graphic;
4850
import com.esri.arcgisruntime.mapping.view.GraphicsOverlay;
4951
import com.esri.arcgisruntime.mapping.view.MapView;
@@ -81,11 +83,20 @@ public void start(Stage stage) {
8183
stage.setScene(scene);
8284
stage.show();
8385

84-
// create a view with a map and topographic basemap
85-
ArcGISMap map = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 45.3790902612337, 6.84905317262762, 12);
86+
// authentication with an API key or named user is required to access basemaps and other location services
87+
String yourAPIKey = System.getProperty("apiKey");
88+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
89+
90+
// create a map with the topographic basemap style
91+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_TOPOGRAPHIC);
92+
93+
// create a map view and set the map to it
8694
mapView = new MapView();
8795
mapView.setMap(map);
8896

97+
// set a viewpoint on the map view
98+
mapView.setViewpoint(new Viewpoint(45.3790902612337, 6.84905317262762, 144447));
99+
89100
// create an input graphics overlay to show red point markers where the user clicks
90101
SimpleMarkerSymbol pointSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, 0xFFFF0000, 10);
91102
SimpleRenderer renderer = new SimpleRenderer(pointSymbol);

display_information/add-graphics-with-renderer/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 {

display_information/add-graphics-with-renderer/src/main/java/com/esri/samples/add_graphics_with_renderer/AddGraphicsWithRendererSample.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
import javafx.scene.layout.StackPane;
2222
import javafx.stage.Stage;
2323

24+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
2425
import com.esri.arcgisruntime.geometry.Point;
2526
import com.esri.arcgisruntime.geometry.PolygonBuilder;
2627
import com.esri.arcgisruntime.geometry.PolylineBuilder;
2728
import com.esri.arcgisruntime.geometry.SpatialReferences;
2829
import com.esri.arcgisruntime.mapping.ArcGISMap;
29-
import com.esri.arcgisruntime.mapping.Basemap;
30+
import com.esri.arcgisruntime.mapping.BasemapStyle;
31+
import com.esri.arcgisruntime.mapping.Viewpoint;
3032
import com.esri.arcgisruntime.mapping.view.Graphic;
3133
import com.esri.arcgisruntime.mapping.view.GraphicsOverlay;
3234
import com.esri.arcgisruntime.mapping.view.MapView;
@@ -54,13 +56,20 @@ public void start(Stage stage) {
5456
stage.setScene(scene);
5557
stage.show();
5658

57-
// create a map with topographic basemap
58-
ArcGISMap map = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 15.169193, 16.333479, 2);
59+
// authentication with an API key or named user is required to access basemaps and other location services
60+
String yourAPIKey = System.getProperty("apiKey");
61+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
5962

60-
// set the map to the view
63+
// create a map with the topographic basemap style
64+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_TOPOGRAPHIC);
65+
66+
// create a map view and set the map to it
6167
mapView = new MapView();
6268
mapView.setMap(map);
6369

70+
// set a viewpoint on the map view
71+
mapView.setViewpoint(new Viewpoint(15.169193, 16.333479, 1479143818));
72+
6473
// create a graphics overlay for displaying point graphic
6574
GraphicsOverlay pointGraphicOverlay = new GraphicsOverlay();
6675
// create point geometry

display_information/add-graphics-with-symbols/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 {

display_information/add-graphics-with-symbols/src/main/java/com/esri/samples/add_graphics_with_symbols/AddGraphicsWithSymbolsSample.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121
import javafx.scene.layout.StackPane;
2222
import javafx.stage.Stage;
2323

24+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
2425
import com.esri.arcgisruntime.geometry.Point;
2526
import com.esri.arcgisruntime.geometry.PointCollection;
2627
import com.esri.arcgisruntime.geometry.Polygon;
2728
import com.esri.arcgisruntime.geometry.Polyline;
2829
import com.esri.arcgisruntime.geometry.SpatialReference;
2930
import com.esri.arcgisruntime.geometry.SpatialReferences;
3031
import com.esri.arcgisruntime.mapping.ArcGISMap;
31-
import com.esri.arcgisruntime.mapping.Basemap;
32+
import com.esri.arcgisruntime.mapping.BasemapStyle;
33+
import com.esri.arcgisruntime.mapping.Viewpoint;
3234
import com.esri.arcgisruntime.mapping.view.Graphic;
3335
import com.esri.arcgisruntime.mapping.view.GraphicsOverlay;
3436
import com.esri.arcgisruntime.mapping.view.MapView;
@@ -63,16 +65,23 @@ public void start(Stage stage) {
6365
stage.setScene(scene);
6466
stage.show();
6567

66-
// create the graphics overlay
67-
graphicsOverlay = new GraphicsOverlay();
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);
6871

69-
// create a ArcGISMap with a topographic basemap
70-
final ArcGISMap map = new ArcGISMap(Basemap.Type.OCEANS, 56.075844, -2.681572, 13);
72+
// create a map with the oceans basemap style
73+
final ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_OCEANS);
7174

72-
// create a view for the ArcGISMap and set the ArcGISMap to it
75+
// create a map view and set the map to it
7376
mapView = new MapView();
7477
mapView.setMap(map);
7578

79+
// set a viewpoint on the map view
80+
mapView.setViewpoint(new Viewpoint(56.075844, -2.681572, 72223));
81+
82+
// create the graphics overlay
83+
graphicsOverlay = new GraphicsOverlay();
84+
7685
// add the graphic overlay to the map view
7786
mapView.getGraphicsOverlays().add(graphicsOverlay);
7887

display_information/dictionary-renderer-graphics-overlay/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 {

display_information/dictionary-renderer-graphics-overlay/src/main/java/com/esri/samples/dictionary_renderer_graphics_overlay/DictionaryRendererGraphicsOverlaySample.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package com.esri.samples.dictionary_renderer_graphics_overlay;
1818

19-
import static org.joox.JOOX.$;
20-
2119
import javax.xml.parsers.DocumentBuilder;
2220
import javax.xml.parsers.DocumentBuilderFactory;
2321
import org.w3c.dom.Document;
@@ -37,12 +35,13 @@
3735
import javafx.scene.layout.StackPane;
3836
import javafx.stage.Stage;
3937

38+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
4039
import com.esri.arcgisruntime.geometry.Multipoint;
4140
import com.esri.arcgisruntime.geometry.Point;
4241
import com.esri.arcgisruntime.geometry.PointCollection;
4342
import com.esri.arcgisruntime.geometry.SpatialReference;
4443
import com.esri.arcgisruntime.mapping.ArcGISMap;
45-
import com.esri.arcgisruntime.mapping.Basemap;
44+
import com.esri.arcgisruntime.mapping.BasemapStyle;
4645
import com.esri.arcgisruntime.mapping.view.Graphic;
4746
import com.esri.arcgisruntime.mapping.view.GraphicsOverlay;
4847
import com.esri.arcgisruntime.mapping.view.MapView;
@@ -67,7 +66,12 @@ public void start(Stage stage) throws Exception {
6766
stage.setScene(scene);
6867
stage.show();
6968

70-
ArcGISMap map = new ArcGISMap(Basemap.createTopographic());
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 topographic basemap style and set it to the map view
74+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_TOPOGRAPHIC);
7175
mapView.setMap(map);
7276

7377
graphicsOverlay = new GraphicsOverlay();

0 commit comments

Comments
 (0)