Skip to content

Commit e2d5e37

Browse files
New Basemaps: Portal and Raster Categories (#608)
* Update IntegratedWindowsAuthenticationController.java * Update OAuthSample.java * Update ColormapRendererSample.java * Update IdentifyRasterCellSample.java * Update RasterFunctionSample.java * Update RasterLayerFileSample.java * Update RasterLayerGeopackageSample.java * Update RasterLayerURLSample.java * Update RasterRenderingRuleSample.java * Fix comment * Identify Raster Cell - tidy up indentation * Tidy style comments * update build.gradle - versions * oauth - update readme and comments * tidy comment consistencies Co-authored-by: sclaridge <[email protected]>
1 parent 3fce5a8 commit e2d5e37

File tree

19 files changed

+259
-212
lines changed

19 files changed

+259
-212
lines changed

portal/integrated-windows-authentication/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 {

portal/integrated-windows-authentication/src/main/java/com/esri/samples/integrated_windows_authentication/IntegratedWindowsAuthenticationController.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
import javafx.scene.control.TextField;
2727
import javafx.scene.text.Text;
2828

29+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
2930
import com.esri.arcgisruntime.concurrent.ListenableFuture;
3031
import com.esri.arcgisruntime.loadable.LoadStatus;
3132
import com.esri.arcgisruntime.mapping.ArcGISMap;
32-
import com.esri.arcgisruntime.mapping.Basemap;
33+
import com.esri.arcgisruntime.mapping.BasemapStyle;
3334
import com.esri.arcgisruntime.mapping.view.DrawStatus;
3435
import com.esri.arcgisruntime.mapping.view.MapView;
3536
import com.esri.arcgisruntime.portal.Portal;
@@ -50,9 +51,14 @@ public class IntegratedWindowsAuthenticationController {
5051

5152
public void initialize() {
5253
try {
54+
// authentication with an API key or named user is required to access basemaps and other location services
55+
String yourAPIKey = System.getProperty("apiKey");
56+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
5357

54-
// add a map to the map view
55-
ArcGISMap map = new ArcGISMap(Basemap.createStreets());
58+
// create a map with the streets basemap style
59+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_STREETS);
60+
61+
// set the map to the map view
5662
mapView.setMap(map);
5763

5864
// set authentication challenge handler

portal/oauth/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Your app may need to access items that are only shared with authorized users. Fo
1010

1111
## How to use the sample
1212

13-
When you run the sample, the app will load a web map which contains premium content. You will be challenged for an ArcGIS Online login to view the private layers. Enter a user name and password for an ArcGIS Online named user account (such as your ArcGIS for Developers account). If you authenticate successfully, the traffic layer will display, otherwise the map will contain only the public basemap layer.
13+
When you run the sample, the app will load a web map which contains premium content. You will be challenged for an ArcGIS Online login to view the private layers. Enter a user name and password for an ArcGIS Online named user account (such as your ArcGIS for Developers account). If you authenticate successfully, the traffic layer will display, otherwise the map will contain only the basemap style layer.
1414

1515
## How it works
1616

portal/oauth/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 {

portal/oauth/src/main/java/com/esri/samples/oauth/OAuthSample.java

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

24+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
2425
import com.esri.arcgisruntime.mapping.ArcGISMap;
25-
import com.esri.arcgisruntime.mapping.Basemap;
26+
import com.esri.arcgisruntime.mapping.BasemapStyle;
2627
import com.esri.arcgisruntime.mapping.view.MapView;
2728
import com.esri.arcgisruntime.portal.Portal;
2829
import com.esri.arcgisruntime.portal.PortalItem;
@@ -49,10 +50,14 @@ public void start(Stage stage) {
4950
stage.setScene(scene);
5051
stage.show();
5152

52-
// create a map with imagery basemap
53-
ArcGISMap map = new ArcGISMap(Basemap.createImagery());
53+
// authentication with an API key or named user is required to access basemaps and other location services
54+
String yourAPIKey = System.getProperty("apiKey");
55+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
5456

55-
// set the map to the map view
57+
// create a map with the standard imagery basemap style
58+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_IMAGERY_STANDARD);
59+
60+
// create a map view and set the map to it
5661
mapView = new MapView();
5762
mapView.setMap(map);
5863

raster/colormap-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 {

raster/colormap-renderer/src/main/java/com/esri/samples/colormap_renderer/ColormapRendererSample.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
import javafx.scene.layout.StackPane;
2828
import javafx.stage.Stage;
2929

30+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3031
import com.esri.arcgisruntime.layers.RasterLayer;
3132
import com.esri.arcgisruntime.loadable.LoadStatus;
3233
import com.esri.arcgisruntime.mapping.ArcGISMap;
33-
import com.esri.arcgisruntime.mapping.Basemap;
34+
import com.esri.arcgisruntime.mapping.BasemapStyle;
3435
import com.esri.arcgisruntime.mapping.view.MapView;
3536
import com.esri.arcgisruntime.raster.ColormapRenderer;
3637
import com.esri.arcgisruntime.raster.Raster;
@@ -54,20 +55,24 @@ public void start(Stage stage) {
5455
stage.setScene(scene);
5556
stage.show();
5657

58+
// authentication with an API key or named user is required to access basemaps and other location services
59+
String yourAPIKey = System.getProperty("apiKey");
60+
ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
61+
5762
// create a raster from a local raster file
5863
Raster raster = new Raster(new File(System.getProperty("data.dir"), "./samples-data/raster/ShastaBW.tif").getAbsolutePath());
5964

6065
// create a raster layer
6166
RasterLayer rasterLayer = new RasterLayer(raster);
6267

63-
// create a Map with imagery basemap
64-
ArcGISMap map = new ArcGISMap(Basemap.createImagery());
68+
// create a map with the standard imagery basemap style
69+
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_IMAGERY_STANDARD);
6570

66-
// add the map to a map view
71+
// create a map view and set the map to it
6772
mapView = new MapView();
6873
mapView.setMap(map);
6974

70-
// add the raster as an operational layer
75+
// add the raster to the map's operational layers
7176
map.getOperationalLayers().add(rasterLayer);
7277

7378
// create a color map where values 0-149 are red (0xFFFF0000) and 150-250 are yellow (0xFFFFFF00)

raster/identify-raster-cell/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)