Skip to content

Commit 3fce5a8

Browse files
New Basemaps: Search and Symbology Categories (#609)
* Update FindAddressSample.java * Update FindPlaceController.java * Update ReverseGeocodeOnlineSample.java * Update CustomDictionaryStyleSample.java * Update PictureMarkerSymbolSample.java * Update ReadSymbolsFromMobileStyleFileController.java * Update SimpleFillSymbolSample.java * Update SimpleLineSymbolSample.java * Update SimpleMarkerSymbolSample.java * Update SimpleRendererSample.java * Update SymbolizeShapefileSample.java * Update UniqueValueRendererSample.java * Fix comment * Find address - set viewpoint on mapview * Reverse geocode online - set viewpoint on mapview * Simple fill symbol - set viewpoint on mapview * Simple line symbol - set viewpoint on mapview * Find place - update readme URL to new service * Find place - tidy comments * Picture marker symbol - tidy comment * Simple fill symbol - tidy viewpoint * Simple fill symbol and simple line symbol - amend viewpoints * Simple marker symbol - tidy comments and viewpoint * Simple renderer - tidy comments * Unique value renderer - tidy up comments and viewpoint * update build.gradle - versions * tidy up comment and viewpoint consistencies * tidy comment Co-authored-by: sclaridge <[email protected]>
1 parent fbe529c commit 3fce5a8

File tree

25 files changed

+152
-101
lines changed

25 files changed

+152
-101
lines changed

search/find-address/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 {

search/find-address/src/main/java/com/esri/samples/find_address/FindAddressSample.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@
3333
import javafx.stage.Stage;
3434
import javafx.util.Duration;
3535

36+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3637
import com.esri.arcgisruntime.concurrent.ListenableFuture;
3738
import com.esri.arcgisruntime.geometry.Point;
3839
import com.esri.arcgisruntime.mapping.ArcGISMap;
39-
import com.esri.arcgisruntime.mapping.Basemap;
40+
import com.esri.arcgisruntime.mapping.BasemapStyle;
41+
import com.esri.arcgisruntime.mapping.Viewpoint;
4042
import com.esri.arcgisruntime.mapping.view.Callout;
4143
import com.esri.arcgisruntime.mapping.view.Callout.LeaderPosition;
4244
import com.esri.arcgisruntime.mapping.view.Graphic;
@@ -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 search box
7480
searchBox = new ComboBox<>();
7581
searchBox.setPromptText("Search");
@@ -82,13 +88,16 @@ public void start(Stage stage) {
8288
};
8389
searchBox.getItems().addAll(examples);
8490

85-
// create ArcGISMap with imagery basemap
86-
ArcGISMap map = new ArcGISMap(Basemap.Type.IMAGERY, 48.354406, -99.998267, 2);
91+
// create a map with the standard imagery basemap style
92+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_IMAGERY_STANDARD);
8793

88-
// create a view and set ArcGISMap to it
94+
// create a map view and set the map to it
8995
mapView = new MapView();
9096
mapView.setMap(map);
9197

98+
// set a viewpoint on the map view
99+
mapView.setViewpoint(new Viewpoint(48.354406, -99.998267, 147914382));
100+
92101
// add a graphics overlay
93102
graphicsOverlay = new GraphicsOverlay();
94103
mapView.getGraphicsOverlays().add(graphicsOverlay);
@@ -98,7 +107,7 @@ public void start(Stage stage) {
98107
callout.setLeaderPosition(LeaderPosition.BOTTOM);
99108

100109
// create a locatorTask
101-
locatorTask = new LocatorTask("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
110+
locatorTask = new LocatorTask("https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer");
102111

103112
// create geocode task parameters
104113
GeocodeParameters geocodeParameters = new GeocodeParameters();

search/find-place/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Choose a type of place in the first field and an area to search within in the se
3333

3434
## About the data
3535

36-
This sample uses the [world locator service](https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer).
36+
This sample uses the [world locator service](https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer).
3737

3838
## Relevant API
3939

search/find-place/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 {

search/find-place/src/main/java/com/esri/samples/find_place/FindPlaceController.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@
3232
import javafx.scene.input.MouseButton;
3333
import javafx.util.Duration;
3434

35+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3536
import com.esri.arcgisruntime.concurrent.ListenableFuture;
3637
import com.esri.arcgisruntime.geometry.Envelope;
3738
import com.esri.arcgisruntime.geometry.Point;
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.Callout;
4243
import com.esri.arcgisruntime.mapping.view.Graphic;
@@ -67,9 +68,14 @@ public class FindPlaceController {
6768

6869
@FXML
6970
public void initialize() {
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);
7074

71-
// create ArcGISMap with streets basemap and add it to map view
72-
ArcGISMap map = new ArcGISMap(Basemap.createStreets());
75+
// create a map with the streets basemap style
76+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_STREETS);
77+
78+
// set the map to the map view
7379
mapView.setMap(map);
7480
mapView.setWrapAroundMode(WrapAroundMode.DISABLED);
7581

@@ -81,8 +87,8 @@ public void initialize() {
8187
callout = mapView.getCallout();
8288
callout.setLeaderPosition(Callout.LeaderPosition.BOTTOM);
8389

84-
// create a locatorTask task
85-
locatorTask = new LocatorTask("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
90+
// create a locator task
91+
locatorTask = new LocatorTask("https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer");
8692

8793
// create a pin graphic
8894
Image img = new Image(getClass().getResourceAsStream("/find_place/pin.png"), 0, 80, true, true);

search/reverse-geocode-online/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 {

search/reverse-geocode-online/src/main/java/com/esri/samples/reverse_geocode_online/ReverseGeocodeOnlineSample.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@
3232
import javafx.stage.Stage;
3333
import javafx.util.Duration;
3434

35+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3536
import com.esri.arcgisruntime.concurrent.ListenableFuture;
3637
import com.esri.arcgisruntime.geometry.Point;
3738
import com.esri.arcgisruntime.mapping.ArcGISMap;
38-
import com.esri.arcgisruntime.mapping.Basemap;
39+
import com.esri.arcgisruntime.mapping.BasemapStyle;
40+
import com.esri.arcgisruntime.mapping.Viewpoint;
3941
import com.esri.arcgisruntime.mapping.view.Callout;
4042
import com.esri.arcgisruntime.mapping.view.Callout.LeaderPosition;
4143
import com.esri.arcgisruntime.mapping.view.Graphic;
@@ -69,19 +71,26 @@ public void start(Stage stage) {
6971
stage.setScene(scene);
7072
stage.show();
7173

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);
77+
7278
// add a progress indicator
7379
progressIndicator = new ProgressIndicator(ProgressIndicator.INDETERMINATE_PROGRESS);
7480
progressIndicator.setMaxSize(40, 40);
7581
progressIndicator.setStyle("-fx-progress-color: white;");
7682
progressIndicator.setVisible(false);
7783

78-
// create ArcGISMap with imagery basemap centered over the US
79-
ArcGISMap map = new ArcGISMap(Basemap.Type.IMAGERY_WITH_LABELS, 40, -95, 4);
84+
// create a map with the imagery basemap style
85+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_IMAGERY);
8086

81-
// create a view and set ArcGISMap to it
87+
// create a map view and set the map to it
8288
mapView = new MapView();
8389
mapView.setMap(map);
8490

91+
// set a viewpoint on the map view
92+
mapView.setViewpoint(new Viewpoint(40, -95, 36978595));
93+
8594
// add a graphics overlay
8695
graphicsOverlay = new GraphicsOverlay();
8796
mapView.getGraphicsOverlays().add(graphicsOverlay);
@@ -91,7 +100,7 @@ public void start(Stage stage) {
91100
callout.setLeaderPosition(LeaderPosition.BOTTOM);
92101

93102
// create a locator task
94-
locatorTask = new LocatorTask("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
103+
locatorTask = new LocatorTask("https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer");
95104

96105
// create geocode task parameters
97106
ReverseGeocodeParameters reverseGeocodeParameters = new ReverseGeocodeParameters();

symbology/custom-dictionary-style/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 {

symbology/custom-dictionary-style/src/main/java/com/esri/samples/custom_dictionary_style/CustomDictionaryStyleSample.java

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

24+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
2425
import com.esri.arcgisruntime.data.ServiceFeatureTable;
2526
import com.esri.arcgisruntime.geometry.Point;
2627
import com.esri.arcgisruntime.layers.FeatureLayer;
2728
import com.esri.arcgisruntime.mapping.ArcGISMap;
28-
import com.esri.arcgisruntime.mapping.Basemap;
29+
import com.esri.arcgisruntime.mapping.BasemapStyle;
2930
import com.esri.arcgisruntime.mapping.Viewpoint;
3031
import com.esri.arcgisruntime.mapping.view.MapView;
3132
import com.esri.arcgisruntime.symbology.DictionaryRenderer;
@@ -52,11 +53,15 @@ public void start(Stage stage) {
5253
stage.setScene(scene);
5354
stage.show();
5455

55-
// create a map view
56-
mapView = new MapView();
56+
// authentication with an API key or named user is required to access basemaps and other location services
57+
String yourAPIKey = System.getProperty("apiKey");
58+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
59+
60+
// create a map with the streets basemap style
61+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_STREETS);
5762

58-
// create a new map with a streets basemap and set it to the map view
59-
ArcGISMap map = new ArcGISMap(Basemap.createStreetsVector());
63+
// create a map view and set the map to it
64+
mapView = new MapView();
6065
mapView.setMap(map);
6166

6267
// set the initial viewpoint to the Esri Redlands campus

symbology/picture-marker-symbol/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 {

0 commit comments

Comments
 (0)