From 286bc76dcccddac4a8f7a70954773555254fce50 Mon Sep 17 00:00:00 2001 From: Gary Sheppard Date: Sat, 26 Jan 2019 15:02:21 -0500 Subject: [PATCH] January 2019 release (v2019.01) (#166) * Updated Java exercises to Runtime 100.4.0 (#152) Resolved #150 * Added KML (#154) Part of #153 * Added README and navigation (#155) Resolves #116 * Updated ArcGIS Runtime in Android exercises (#162) Resolves #156 * Added KML to Android (#163) #153 * Qt: updated Runtime, added KML (#164) - Part of #153 - Resolved #157 --- README.md | 9 ++- .../Android/Exercise 1 Map and Scene.md | 7 ++- .../Android/Exercise 3 Operational Layers.md | 44 ++++++++++---- runtime-workshop/exercises/Android/README.md | 7 +++ .../exercises/AppStudio_QTQML/README.md | 7 +++ .../Java/Exercise 1 Map and Scene.md | 52 +++++++++++++--- .../Java/Exercise 3 Operational Layers.md | 38 ++++++++++-- runtime-workshop/exercises/Java/README.md | 7 +++ .../Qt/Qt Quick/Exercise 1 Map and Scene.md | 16 +---- .../Qt Quick/Exercise 3 Operational Layers.md | 47 +++++++++++++-- .../exercises/Qt/Qt Quick/README.md | 7 +++ runtime-workshop/exercises/README.md | 9 +++ .../exercises/dotNETWPF/README.md | 7 +++ .../exercises/iOS/Swift/README.md | 7 +++ .../exercises/macOS/Swift/README.md | 7 +++ .../WorkshopApp/app/build.gradle | 14 ++--- .../Ex1_MapAndScene/WorkshopApp/build.gradle | 3 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- .../WorkshopApp/app/build.gradle | 14 ++--- .../Ex2_ZoomButtons/WorkshopApp/build.gradle | 3 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- .../Ex3_OpLyrs/WorkshopApp/app/build.gradle | 14 ++--- .../wdc/geodev/workshopapp/MainActivity.java | 14 ++++- .../Ex3_OpLyrs/WorkshopApp/build.gradle | 6 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- .../WorkshopApp/app/build.gradle | 14 ++--- .../wdc/geodev/workshopapp/MainActivity.java | 14 ++++- .../Ex4_BufferQuery/WorkshopApp/build.gradle | 6 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- .../Ex5_Routing/WorkshopApp/app/build.gradle | 14 ++--- .../wdc/geodev/workshopapp/MainActivity.java | 14 ++++- .../Ex5_Routing/WorkshopApp/build.gradle | 6 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- .../solutions/Java/Ex1_MapAndScene/pom.xml | 58 ++++++++++++++---- .../java/com/esri/wdc/geodev/Launcher.java | 9 +++ .../java/com/esri/wdc/geodev/WorkshopApp.java | 4 +- .../solutions/Java/Ex2_ZoomButtons/pom.xml | 58 ++++++++++++++---- .../java/com/esri/wdc/geodev/Launcher.java | 9 +++ .../java/com/esri/wdc/geodev/WorkshopApp.java | 4 +- .../Java/Ex3_OperationalLayers/pom.xml | 59 ++++++++++++++----- .../java/com/esri/wdc/geodev/Launcher.java | 9 +++ .../java/com/esri/wdc/geodev/WorkshopApp.java | 18 +++++- .../solutions/Java/Ex4_BufferAndQuery/pom.xml | 58 ++++++++++++++---- .../java/com/esri/wdc/geodev/Launcher.java | 9 +++ .../java/com/esri/wdc/geodev/WorkshopApp.java | 18 +++++- .../solutions/Java/Ex5_Routing/pom.xml | 58 ++++++++++++++---- .../java/com/esri/wdc/geodev/Launcher.java | 9 +++ .../java/com/esri/wdc/geodev/WorkshopApp.java | 18 +++++- .../Ex1_MapAndScene/WorkshopApp/AppInfo.h | 2 +- .../WorkshopApp/WorkshopApp.pro | 22 +++---- .../Ex1_MapAndScene/WorkshopApp/main.cpp | 5 -- .../Ex1_MapAndScene/WorkshopApp/qml/main.qml | 5 +- .../Ex2_ZoomButtons/WorkshopApp/AppInfo.h | 2 +- .../WorkshopApp/WorkshopApp.pro | 22 +++---- .../Ex2_ZoomButtons/WorkshopApp/main.cpp | 5 -- .../Ex2_ZoomButtons/WorkshopApp/qml/main.qml | 5 +- .../WorkshopApp/AppInfo.h | 2 +- .../WorkshopApp/WorkshopApp.pro | 22 +++---- .../WorkshopApp/main.cpp | 5 -- .../WorkshopApp/qml/main.qml | 25 ++++++-- .../Ex4_BufferAndQuery/WorkshopApp/AppInfo.h | 2 +- .../WorkshopApp/WorkshopApp.pro | 22 +++---- .../Ex4_BufferAndQuery/WorkshopApp/main.cpp | 5 -- .../WorkshopApp/qml/main.qml | 25 ++++++-- .../Ex5_Routing/WorkshopApp/AppInfo.h | 2 +- .../Ex5_Routing/WorkshopApp/WorkshopApp.pro | 22 +++---- .../Qt Quick/Ex5_Routing/WorkshopApp/main.cpp | 5 -- .../Ex5_Routing/WorkshopApp/qml/main.qml | 25 ++++++-- 68 files changed, 768 insertions(+), 287 deletions(-) create mode 100644 runtime-workshop/exercises/Android/README.md create mode 100644 runtime-workshop/exercises/AppStudio_QTQML/README.md create mode 100644 runtime-workshop/exercises/Java/README.md create mode 100644 runtime-workshop/exercises/Qt/Qt Quick/README.md create mode 100644 runtime-workshop/exercises/README.md create mode 100644 runtime-workshop/exercises/dotNETWPF/README.md create mode 100644 runtime-workshop/exercises/iOS/Swift/README.md create mode 100644 runtime-workshop/exercises/macOS/Swift/README.md create mode 100644 runtime-workshop/solutions/Java/Ex1_MapAndScene/src/main/java/com/esri/wdc/geodev/Launcher.java create mode 100644 runtime-workshop/solutions/Java/Ex2_ZoomButtons/src/main/java/com/esri/wdc/geodev/Launcher.java create mode 100644 runtime-workshop/solutions/Java/Ex3_OperationalLayers/src/main/java/com/esri/wdc/geodev/Launcher.java create mode 100644 runtime-workshop/solutions/Java/Ex4_BufferAndQuery/src/main/java/com/esri/wdc/geodev/Launcher.java create mode 100644 runtime-workshop/solutions/Java/Ex5_Routing/src/main/java/com/esri/wdc/geodev/Launcher.java diff --git a/README.md b/README.md index 1b28878..dbdd8bf 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,14 @@ # GeoDev D.C. Labs -Lab exercises for Esri GeoDev events held in the Washington, D.C., area. + +These lab exercises were developed for Esri GeoDev events held in the Washington, D.C., area. They are available for anyone who wants to get to know ArcGIS Runtime using step-by-step tutorial-style exercises in a variety of development platforms. + +Do you want to go step by step? [Go to the exercises.](runtime-workshop/exercises/README.md) + +Do you want to cut to the chase and see the code? [Go to the solutions.](runtime-workshop/solutions) ## Licensing -Copyright 2016-2018 Esri +Copyright 2016-2019 Esri Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/runtime-workshop/exercises/Android/Exercise 1 Map and Scene.md b/runtime-workshop/exercises/Android/Exercise 1 Map and Scene.md index b1a9b5f..3e85c5a 100644 --- a/runtime-workshop/exercises/Android/Exercise 1 Map and Scene.md +++ b/runtime-workshop/exercises/Android/Exercise 1 Map and Scene.md @@ -40,13 +40,14 @@ If you need some help, you can refer to [the solution to this exercise](../../so ## Add ArcGIS Runtime to the app -1. In your Android Studio project, under **Gradle Scripts**, there are two files called `build.gradle`: one for the **project** and one for the **app module**. Open `build.gradle` for your project. Under `allprojects` > `repositories`, add a reference to the Esri Maven repository on Bintray. Make sure you do this under `allprojects` and not under `buildscript`: +1. In your Android Studio project, under **Gradle Scripts**, there are two files called `build.gradle`: one for the **project** and one for the **app module**. Open `build.gradle` for your project. Under `allprojects` > `repositories`, add a reference to the Esri Maven repository on Bintray, as well as the Google repository. Make sure you do this under `allprojects` and not under `buildscript`: ``` allprojects { repositories { jcenter() - // Add the next three lines + // Add the next lines + google() maven { url 'https://esri.bintray.com/arcgis' } @@ -61,7 +62,7 @@ If you need some help, you can refer to [the solution to this exercise](../../so implementation fileTree(dir: 'libs', include: ['*.jar']) testImplementation 'junit:junit:4.12' // Add the next line - implementation 'com.esri.arcgisruntime:arcgis-android:100.2.1' + implementation 'com.esri.arcgisruntime:arcgis-android:100.4.0' } ``` diff --git a/runtime-workshop/exercises/Android/Exercise 3 Operational Layers.md b/runtime-workshop/exercises/Android/Exercise 3 Operational Layers.md index 52ea530..129fab5 100644 --- a/runtime-workshop/exercises/Android/Exercise 3 Operational Layers.md +++ b/runtime-workshop/exercises/Android/Exercise 3 Operational Layers.md @@ -3,6 +3,7 @@ This exercise walks you through the following: - Add a layer from a mobile map package to the 2D map - Add a scene layer to the 3D scene +- Add a KML layer to the 2D map and 3D scene Prerequisites: - Complete [Exercise 2](Exercise%202%20Zoom%20Buttons.md), or get the Exercise 2 code solution compiling and running properly, preferably in an IDE. @@ -23,14 +24,6 @@ ArcGIS Runtime provides a variety of ways to add **operational layers** to the m 1. In Android 6 (API level 23) and higher, in addition to the `uses-permission` element, a production app should include Java code to [request permissions at runtime](https://developer.android.com/training/permissions/requesting.html). You could instead go to **Settings > Apps > <your app> > Permissions** on your Android device and grant the **Storage** permission manually, but that permission sometimes gets wiped out when you reinstall the app during development, which becomes very inconvenient. Therefore, here we will take the time to request permissions at runtime. - First, open your project's `build.gradle` file where you added a reference to the Esri Bintray Maven repository. Add a reference to Google's Maven repository: - - ``` - maven { - url 'https://maven.google.com' - } - ``` - Open the app's `build.gradle` file where you added a reference to the ArcGIS Runtime Android library. Add a reference to the Android Support Library `v4` library: ``` @@ -151,18 +144,18 @@ ArcGIS Runtime provides a variety of ways to add **operational layers** to the m Web scene layers are cached web layers that are optimized for displaying a large amount of 2D and 3D features. Scene layers can be viewed in a variety of ArcGIS clients, including ArcGIS Runtime. Here you will add a scene layer to your 3D scene. -1. Declare a constant value to specify the URL of a scene service. You can use a `SceneServer` URL or an ArcGIS Online or Portal for ArcGIS item URL that represents a scene service. The following URL shows plain gray buildings in Washington, D.C.: +1. Declare a constant value to specify the URL of a scene service. You can use a `SceneServer` URL or an ArcGIS Online or Portal for ArcGIS item URL that represents a scene service. The following URL shows buildings in San Francisco: ``` private static final String SCENE_SERVICE_URL = - "https://www.arcgis.com/home/item.html?id=606596bae9e44394b42621e099ba392a"; + "https://www.arcgis.com/home/item.html?id=943d302fd85b4b6dbd35f399cfb9a4a8"; ``` The following URL shows photo-realistic buildings in Philadelphia: ``` private static final String SCENE_SERVICE_URL = - "https://www.arcgis.com/home/item.html?id=a7419641a50e412c980cf242c29aa3c0"; + "https://www.arcgis.com/home/item.html?id=2c9286dfc69349408764e09022b1f52e"; ``` 1. In Exercise 1, you added code to set up the scene with a basemap and an elevation source. After that code, in the same block, create a new `final ArcGISSceneLayer` based on the scene service, give the layer an event handler for when it is done loading, and add the layer to the scene: @@ -198,11 +191,38 @@ Web scene layers are cached web layers that are optimized for displaying a large 1. Compile and run your app. Verify that when you switch to 3D, the 3D features display and the view is rotated and pitched. +## Add a KML layer to the 2D map and 3D scene + +Most organizations use a mix of ArcGIS and non-ArcGIS data formats. Many organizations distribute mapping data in the Keyhole Markup Language (KML) format. Here you will use a KML URL to add a layer to your 2D map and 3D scene. + +1. Declare a constant value to specify the URL of a KML file or network link. The following URL shows earthquakes of magnitude 1.0 or greater in the past seven days, colored by age: + + ``` + private static final String KML_URL = + "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_week_age_link.kml"; + ``` + +1. You added a listener to the mobile map package to set up the map after the mobile map package loads. In that listener, after setting the map and the basemap, create a KML layer and add it to the map: + + ``` + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + map.getOperationalLayers().add(kmlLayer); + ``` + +1. You added a scene layer to the scene. After that, create a KML layer and add it to the scene: + + ``` + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + scene.getOperationalLayers().add(kmlLayer); + ``` + +1. Compile and run your app. Zoom out and verify that the earthquake dots appear on the 2D map. Switch to 3D and verify that the earthquake dots appear on the 3D scene. + ## How did it go? If you have trouble, **refer to the solution code**, which is linked near the beginning of this exercise. You can also **submit an issue** in this repo to ask a question or report a problem. If you are participating live with Esri presenters, feel free to **ask a question** of the presenters. -If you completed the exercise, congratulations! You learned how to add a local feature layer from a mobile map package to a map. +If you completed the exercise, congratulations! You learned how to add a local feature layer from a mobile map package to a map. You also learned how to add KML to a 2D map and a 3D scene. Ready for more? Choose from the following: diff --git a/runtime-workshop/exercises/Android/README.md b/runtime-workshop/exercises/Android/README.md new file mode 100644 index 0000000..165d600 --- /dev/null +++ b/runtime-workshop/exercises/Android/README.md @@ -0,0 +1,7 @@ +# Android exercises + +- [Exercise 1: Map and Scene](Exercise%201%20Map%20and%20Scene.md) +- [Exercise 2: Add Zoom In and Zoom Out Buttons](Exercise%202%20Zoom%20Buttons.md) +- [Exercise 3: Add Operational Layers](Exercise%203%20Operational%20Layers.md) +- [Exercise 4: Buffer a Point and Query Features](Exercise%204%20Buffer%20and%20Query.md) +- [Exercise 5: Routing](Exercise%205%20Routing.md) diff --git a/runtime-workshop/exercises/AppStudio_QTQML/README.md b/runtime-workshop/exercises/AppStudio_QTQML/README.md new file mode 100644 index 0000000..d358d93 --- /dev/null +++ b/runtime-workshop/exercises/AppStudio_QTQML/README.md @@ -0,0 +1,7 @@ +# AppStudio for ArcGIS (QML) exercises + +- [Exercise 1: Map](Exercise%201%20Map.md) +- [Exercise 2: Add Zoom In, and Zoom Out, and Location Buttons](Exercise%202%20Zoom%20Buttons.md) +- [Exercise 3: Add a Feature Service](Exercise%203%20Add%20Feature%20Service.md) +- [Exercise 4: Buffer a Point and Query Features](Exercise%204%20Buffer%20and%20Query.md) +- [Exercise 5: Service Area](Exercise%205%20ServiceArea.md) diff --git a/runtime-workshop/exercises/Java/Exercise 1 Map and Scene.md b/runtime-workshop/exercises/Java/Exercise 1 Map and Scene.md index a9cbe4e..d9dbe9c 100644 --- a/runtime-workshop/exercises/Java/Exercise 1 Map and Scene.md +++ b/runtime-workshop/exercises/Java/Exercise 1 Map and Scene.md @@ -7,7 +7,7 @@ This exercise walks you through the following: - Add a 3D scene to the app, and use a toggle button to switch between 2D and 3D Prerequisites: -- Install the Java Development Kit (JDK) version 8 or higher. +- Install the Java Development Kit (JDK) version 11 or higher. - Optional: install a Java integrated development environment (IDE). If you need some help, you can refer to [the solution to this exercise](../../solutions/Java/Ex1_MapAndScene), available in this repository. @@ -26,6 +26,16 @@ If you need some help, you can refer to [the solution to this exercise](../../so } ``` + **Note:** In recent Java releases, the JDK no longer includes JavaFX, so you will probably need to add a JavaFX dependency to your new project. In Maven, this is done as follows inside `pom.xml`'s `` element (which you should create if it does not yet exist): + + ``` + + org.openjfx + javafx-controls + 11.0.1 + + ``` + 1. Instantiate a field of type `AnchorPane` that will hold the app's UI components: ``` @@ -75,14 +85,30 @@ If you need some help, you can refer to [the solution to this exercise](../../so launch(args); } ``` - + +1. In newer versions of Java, you will probably get the following error if you run the app right now: + + >Error: JavaFX runtime components are missing, and are required to run this application + + Solve this error by creating a new class with a `main` method and having it call your app class's `main` method, and run this new class instead of your app class ([more info](https://stackoverflow.com/a/52654791/720773)): + + ``` + public class Launcher { + + public static void main(String[] args) { + WorkshopApp.main(args); + } + + } + ``` + 1. Compile and run your app. Verify that a button appears in the lower-right corner of the app: ![Blank app with button](01-blank-app-with-button.png) ## Add ArcGIS Runtime to the app -You have three options for adding ArcGIS Runtime 100.2.1 to your Java application project. Choose one of the following: +You have three options for adding ArcGIS Runtime to your Java application project. Choose one of the following: 1. **Use Gradle**: you can use Gradle if you started the exercise by creating a Gradle project. Open `build.gradle` and add ArcGIS dependencies. See [Develop your first map app with Gradle](https://developers.arcgis.com/java/latest/guide/develop-your-first-map-app-with-gradle.htm) for details. @@ -96,7 +122,7 @@ You have three options for adding ArcGIS Runtime 100.2.1 to your Java applicatio dependencies { classpath 'com.esri.arcgisruntime:gradle-arcgis-java-plugin:1.0.0' } } - arcgis.version = '100.2.1' + arcgis.version = '100.4.0' // download javadoc eclipse.classpath.downloadJavadoc = true @@ -123,8 +149,18 @@ You have three options for adding ArcGIS Runtime 100.2.1 to your Java applicatio com.esri.arcgisruntime arcgis-java - 100.2.1 + 100.4.0 + + + + compile + + arcgis + + + @@ -134,16 +170,16 @@ You have three options for adding ArcGIS Runtime 100.2.1 to your Java applicatio arcgis-java-maven-plugin 1.0 - 100.2.1 + 100.4.0 ``` - **Note:** Maven downloads the ArcGIS Runtime install to `/.arcgis`. ArcGIS Runtime tries to find it there, but that can fail under certain conditions. If it fails, you can go inside that install directory and copy the `jniLibs` and `resources` directories to your app's working directory. + **Note:** Maven downloads the ArcGIS Runtime install to `/.arcgis`. ArcGIS Runtime tries to find it there, but that can fail under certain conditions, especially with older ArcGIS Runtime releases. If it fails, you can go inside that install directory and copy the `jniLibs` and `resources` directories to your app's working directory. -3. **Use the downloaded ArcGIS Runtime SDK**: download the ArcGIS Runtime SDK (version 100.2.1) for Java and unzip it. In your Java project, reference the JAR files in the SDK's `libs` directory. You must also copy the SDK's `jniLibs` and `resources` directories to your Java project directory. (There are other ways of referencing ArcGIS Runtime, but copying `jniLibs` and `resources` is the simplest.) See [Develop your first map app using the downloaded SDK](https://developers.arcgis.com/java/latest/guide/develop-your-first-map-app.htm) for details. +3. **Use the downloaded ArcGIS Runtime SDK**: download the ArcGIS Runtime SDK for Java and unzip it. In your Java project, reference the JAR files in the SDK's `libs` directory. You must also copy the SDK's `jniLibs` and `resources` directories to your Java project directory. (There are other ways of referencing ArcGIS Runtime, but copying `jniLibs` and `resources` is the simplest.) See [Develop your first map app using the downloaded SDK](https://developers.arcgis.com/java/latest/guide/develop-your-first-map-app.htm) for details. ## Add a 2D map to the app diff --git a/runtime-workshop/exercises/Java/Exercise 3 Operational Layers.md b/runtime-workshop/exercises/Java/Exercise 3 Operational Layers.md index 2c84930..7600fd2 100644 --- a/runtime-workshop/exercises/Java/Exercise 3 Operational Layers.md +++ b/runtime-workshop/exercises/Java/Exercise 3 Operational Layers.md @@ -3,6 +3,7 @@ This exercise walks you through the following: - Add a layer from a mobile map package to the 2D map - Add a scene layer to the 3D scene +- Add a KML layer to the 2D map and 3D scene Prerequisites: - Complete [Exercise 2](Exercise%202%20Zoom%20Buttons.md), or get the Exercise 2 code solution compiling and running properly, preferably in an IDE. @@ -50,18 +51,18 @@ ArcGIS Runtime provides a variety of ways to add **operational layers** to the m Web scene layers are cached web layers that are optimized for displaying a large amount of 2D and 3D features. Scene layers can be viewed in a variety of ArcGIS clients, including ArcGIS Runtime. Here you will add a scene layer to your 3D scene. -1. Declare a constant value to specify the URL of a scene service. You can use a `SceneServer` URL or an ArcGIS Online or Portal for ArcGIS item URL that represents a scene service. The following URL shows plain gray buildings in Washington, D.C.: +1. Declare a constant value to specify the URL of a scene service. You can use a `SceneServer` URL or an ArcGIS Online or Portal for ArcGIS item URL that represents a scene service. The following URL shows buildings in San Francisco: ``` private static final String SCENE_SERVICE_URL - = "https://www.arcgis.com/home/item.html?id=606596bae9e44394b42621e099ba392a"; + = "https://www.arcgis.com/home/item.html?id=943d302fd85b4b6dbd35f399cfb9a4a8"; ``` The following URL shows photo-realistic buildings in Philadelphia: ``` private static final String SCENE_SERVICE_URL - = "https://www.arcgis.com/home/item.html?id=a7419641a50e412c980cf242c29aa3c0"; + = "https://www.arcgis.com/home/item.html?id=2c9286dfc69349408764e09022b1f52e"; ``` 1. In your 2D/3D toggle button event handler method, after you instantiate your `ArcGISScene`, set its basemap and surface, and instantiate your `SceneView`, create a new `ArcGISSceneLayer` based on the scene service, give the layer an event handler for when it is done loading, and add the layer to the scene: @@ -97,12 +98,39 @@ Web scene layers are cached web layers that are optimized for displaying a large 1. Compile and run your app. Verify that when you switch to 3D, the 3D features display and the view is rotated and pitched. Also try the built-in 3D navigation by holding the right mouse button and moving the mouse: ![3D scene pitched and rotated](07-scene-layer-rotated.jpg) - + +## Add a KML layer to the 2D map and 3D scene + +Most organizations use a mix of ArcGIS and non-ArcGIS data formats. Many organizations distribute mapping data in the Keyhole Markup Language (KML) format. Here you will use a KML URL to add a layer to your 2D map and 3D scene. + +1. Declare a constant value to specify the URL of a KML file or network link. The following URL shows earthquakes of magnitude 1.0 or greater in the past seven days, colored by age: + + ``` + private static final String KML_URL + = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_week_age_link.kml"; + ``` + +1. You added a listener to the mobile map package to set up the map after the mobile map package loads. In that listener, after setting the map and the basemap, create a KML layer and add it to the map: + + ``` + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + map.getOperationalLayers().add(kmlLayer); + ``` + +1. In your 2D/3D toggle button handler, you added a scene layer to the scene. After that, create a KML layer and add it to the scene: + + ``` + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + scene.getOperationalLayers().add(kmlLayer); + ``` + +1. Compile and run your app. Zoom out and verify that the earthquake dots appear on the 2D map. Switch to 3D and verify that the earthquake dots appear on the 3D scene. + ## How did it go? If you have trouble, **refer to the solution code**, which is linked near the beginning of this exercise. You can also **submit an issue** in this repo to ask a question or report a problem. If you are participating live with Esri presenters, feel free to **ask a question** of the presenters. -If you completed the exercise, congratulations! You learned how to add a local feature layer from a mobile map package to a 2D map and a scene layer to a 3D scene. +If you completed the exercise, congratulations! You learned how to add a local feature layer from a mobile map package to a 2D map and a scene layer to a 3D scene. You also learned how to add KML to a 2D map and a 3D scene. Ready for more? Choose from the following: diff --git a/runtime-workshop/exercises/Java/README.md b/runtime-workshop/exercises/Java/README.md new file mode 100644 index 0000000..7873f7e --- /dev/null +++ b/runtime-workshop/exercises/Java/README.md @@ -0,0 +1,7 @@ +# Java exercises + +- [Exercise 1: Map and Scene](Exercise%201%20Map%20and%20Scene.md) +- [Exercise 2: Add Zoom In and Zoom Out Buttons](Exercise%202%20Zoom%20Buttons.md) +- [Exercise 3: Add Operational Layers](Exercise%203%20Operational%20Layers.md) +- [Exercise 4: Buffer a Point and Query Features](Exercise%204%20Buffer%20and%20Query.md) +- [Exercise 5: Routing](Exercise%205%20Routing.md) diff --git a/runtime-workshop/exercises/Qt/Qt Quick/Exercise 1 Map and Scene.md b/runtime-workshop/exercises/Qt/Qt Quick/Exercise 1 Map and Scene.md index 3d405fd..19e4615 100644 --- a/runtime-workshop/exercises/Qt/Qt Quick/Exercise 1 Map and Scene.md +++ b/runtime-workshop/exercises/Qt/Qt Quick/Exercise 1 Map and Scene.md @@ -5,9 +5,9 @@ This exercise walks you through the following: - Add a 3D scene to the app, and use a toggle button to switch between 2D and 3D Prerequisites: -- Meet [the system requirements for the ArcGIS Runtime SDK for Qt](https://developers.arcgis.com/qt/latest/qml/guide/arcgis-runtime-sdk-for-qt-system-requirements.htm), including the need for OpenSSL. **_Important: use OpenSSL 1.0.2 with Qt 5.6 through 5.9! OpenSSL 1.1.0 does not work with those releases of Qt!_** +- Meet [the system requirements for the ArcGIS Runtime SDK for Qt](https://developers.arcgis.com/qt/latest/qml/guide/arcgis-runtime-sdk-for-qt-system-requirements.htm), including the need for OpenSSL. **Note that OpenSSL 1.0.2 seems to work better with Qt than OpenSSL 1.1.0 does.** One way to get OpenSSL on Windows is to install the Light edition of [Win64 OpenSSL](https://slproweb.com/products/Win32OpenSSL.html). *If you do not use OpenSSL, ArcGIS Online services will not work, since they run over HTTPS.* - Install Qt Creator. Refer to the ArcGIS Runtime system requirements for supported versions of Qt and Qt Creator. If you use Windows, you need to use a Qt kit for Visual Studio, rather than a Qt kit for MinGW, and you need to open Qt Creator from a Visual Studio command prompt. -- Install the ArcGIS Runtime SDK 100.2.1 for Qt. Go to [the ArcGIS Runtime SDK for Qt home page](https://developers.arcgis.com/qt/latest/) and click **Download SDK** if you haven't downloaded the SDK. Go to [the ArcGIS Runtime SDK for Qt guide](https://developers.arcgis.com/qt/latest/qml/guide/arcgis-runtime-sdk-for-qt.htm) and expand **Get started** to see links to the install instructions. Follow all of the applicable install instructions in order to configure Runtime with Qt Creator. (Note: there is no need to follow the Android portion of the instructions if you're not deploying to Android for this workshop.) +- Install the ArcGIS Runtime SDK 100.4.0 for Qt. Go to [the ArcGIS Runtime SDK for Qt home page](https://developers.arcgis.com/qt/latest/) and click **Download SDK** if you haven't downloaded the SDK. Go to [the ArcGIS Runtime SDK for Qt guide](https://developers.arcgis.com/qt/latest/qml/guide/arcgis-runtime-sdk-for-qt.htm) and expand **Get started** to see links to the install instructions. Follow all of the applicable install instructions in order to configure Runtime with Qt Creator. (Note: there is no need to follow the Android portion of the instructions if you're not deploying to Android for this workshop.) - This exercise was developed for Windows. If you would like to deploy to a different platform, such as Linux, Mac, Android, or iOS, additional setup may be required. If you need some help, you can refer to [the solution to this exercise](../../../solutions/Qt/Qt%20Quick/Ex1_MapAndScene), available in this repository. @@ -16,18 +16,6 @@ If you need some help, you can refer to [the solution to this exercise](../../.. 1. In Qt Creator, create a new **ArcGIS Runtime Qt Quick app** project. Go through the wizard to create the project. Do not check the **3D project** checkbox (we will add 3D to the app in a different way). -1. Add OpenSSL support to your app by adding the following lines to your project's `.pro` file: - - ``` - OPENSSL_LIBS = /path/to/openssl/lib - OPENSSL_INCLUDE = /path/to/openssl/include - - LIBS += -L$$OPENSSL_LIBS - INCLUDEPATH += $$OPENSSL_INCLUDE - ``` - - Adding OpenSSL is necessary in order to use ArcGIS Online basemaps, which ArcGIS Runtime loads over HTTPS. - 1. Run the project to verify that you see an app with a map: ![Map app](01-map.png) diff --git a/runtime-workshop/exercises/Qt/Qt Quick/Exercise 3 Operational Layers.md b/runtime-workshop/exercises/Qt/Qt Quick/Exercise 3 Operational Layers.md index 1bae73e..a46bab5 100644 --- a/runtime-workshop/exercises/Qt/Qt Quick/Exercise 3 Operational Layers.md +++ b/runtime-workshop/exercises/Qt/Qt Quick/Exercise 3 Operational Layers.md @@ -3,6 +3,7 @@ This exercise walks you through the following: - Add a layer from a mobile map package to the 2D map - Add a scene layer to the 3D scene +- Add a KML layer to the 2D map and 3D scene Prerequisites: - Complete [Exercise 2](Exercise%202%20Zoom%20Buttons.md), or get the Exercise 2 code solution compiling and running properly in Qt Creator. @@ -69,16 +70,16 @@ ArcGIS Runtime provides a variety of ways to add **operational layers** to the m Web scene layers are cached web layers that are optimized for displaying a large amount of 2D and 3D features. Scene layers can be viewed in a variety of ArcGIS clients, including ArcGIS Runtime. Here you will add a scene layer to your 3D scene. -1. In your QML file, declare a constant for the URL of a scene service. You can use a `SceneServer` URL or an ArcGIS Online or Portal for ArcGIS item URL that represents a scene service. The following URL shows plain gray buildings in Washington, D.C.: +1. In your QML file, declare a constant for the URL of a scene service. You can use a `SceneServer` URL or an ArcGIS Online or Portal for ArcGIS item URL that represents a scene service. The following URL shows buildings in San Francisco: ``` - readonly property url sceneServiceUrl: "https://www.arcgis.com/home/item.html?id=606596bae9e44394b42621e099ba392a" + readonly property url sceneServiceUrl: "https://www.arcgis.com/home/item.html?id=943d302fd85b4b6dbd35f399cfb9a4a8" ``` The following URL shows photo-realistic buildings in Philadelphia: ``` - readonly property url sceneServiceUrl: "https://www.arcgis.com/home/item.html?id=a7419641a50e412c980cf242c29aa3c0" + readonly property url sceneServiceUrl: "https://www.arcgis.com/home/item.html?id=2c9286dfc69349408764e09022b1f52e" ``` 1. In your `Scene`, after the basemap and `Surface`, create a new `ArcGISSceneLayer` based on the scene service, and give the layer an event handler for when it is done loading: @@ -142,11 +143,49 @@ Web scene layers are cached web layers that are optimized for displaying a large ![3D scene pitched and rotated](07-scene-layer-rotated.jpg) +## Add a KML layer to the 2D map and 3D scene + +Most organizations use a mix of ArcGIS and non-ArcGIS data formats. Many organizations distribute mapping data in the Keyhole Markup Language (KML) format. Here you will use a KML URL to add a layer to your 2D map and 3D scene. + +1. Declare a constant value to specify the URL of a KML file or network link. The following URL shows earthquakes of magnitude 1.0 or greater in the past seven days, colored by age: + + ``` + readonly property url kmlUrl: "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_week_age_link.kml" + ``` + +1. After your constant values, declare a `KmlLayer` property, which you will later add to the 2D map: + + ``` + property KmlLayer kmlLayer2d: KmlLayer { + dataset: KmlDataset { + url: kmlUrl + } + } + ``` + +1. You added a listener to the mobile map package to set up the map after the mobile map package loads. In that listener, after setting the map and the basemap, add your KML layer to the map (be sure to do this in the same `if` block where you set the map and basemap so that you only do it once): + + ``` + mapView.map.operationalLayers.append(kmlLayer2d); + ``` + +1. In your `Scene`, create a KML layer: + + ``` + KmlLayer { + dataset: KmlDataset { + url: kmlUrl + } + } + ``` + +1. Compile and run your app. Zoom out and verify that the earthquake dots appear on the 2D map. Switch to 3D and verify that the earthquake dots appear on the 3D scene. + ## How did it go? If you have trouble, **refer to the solution code**, which is linked near the beginning of this exercise. You can also **submit an issue** in this repo to ask a question or report a problem. If you are participating live with Esri presenters, feel free to **ask a question** of the presenters. -If you completed the exercise, congratulations! You learned how to add a local feature layer from a mobile map package to a 2D map and a scene layer to a 3D scene. +If you completed the exercise, congratulations! You learned how to add a local feature layer from a mobile map package to a 2D map and a scene layer to a 3D scene. You also learned how to add KML to a 2D map and a 3D scene. Ready for more? Choose from the following: diff --git a/runtime-workshop/exercises/Qt/Qt Quick/README.md b/runtime-workshop/exercises/Qt/Qt Quick/README.md new file mode 100644 index 0000000..6f78b5b --- /dev/null +++ b/runtime-workshop/exercises/Qt/Qt Quick/README.md @@ -0,0 +1,7 @@ +# Qt (Qt Quick) exercises + +- [Exercise 1: Map and Scene](Exercise%201%20Map%20and%20Scene.md) +- [Exercise 2: Add Zoom In and Zoom Out Buttons](Exercise%202%20Zoom%20Buttons.md) +- [Exercise 3: Add Operational Layers](Exercise%203%20Operational%20Layers.md) +- [Exercise 4: Buffer a Point and Query Features](Exercise%204%20Buffer%20and%20Query.md) +- [Exercise 5: Routing](Exercise%205%20Routing.md) diff --git a/runtime-workshop/exercises/README.md b/runtime-workshop/exercises/README.md new file mode 100644 index 0000000..f8a383d --- /dev/null +++ b/runtime-workshop/exercises/README.md @@ -0,0 +1,9 @@ +# Exercises + +- [Android](Android/README.md) +- [AppStudio for ArcGIS (QML)](AppStudio_QTQML/README.md) +- [.NET (WPF)](dotNETWPF/README.md) +- [iOS](iOS/Swift/README.md) +- [Java](Java/README.md) +- [macOS](macOS/Swift/README.md) +- [Qt](Qt/Qt%20Quick/README.md) diff --git a/runtime-workshop/exercises/dotNETWPF/README.md b/runtime-workshop/exercises/dotNETWPF/README.md new file mode 100644 index 0000000..4c80be3 --- /dev/null +++ b/runtime-workshop/exercises/dotNETWPF/README.md @@ -0,0 +1,7 @@ +# .NET (WPF) exercises + +- [Exercise 1: Map and Scene](Exercise%201%20Map%20and%20Scene.md) +- [Exercise 2: Add Zoom In and Zoom Out Buttons](Exercise%202%20Zoom%20Buttons.md) +- [Exercise 3: Add a Local Feature Layer](Exercise%203%20Operational%20Layer.md) +- [Exercise 4: Buffer a Point and Query Features](Exercise%204%20Buffer%20and%20Query.md) +- [Exercise 5: Routing](Exercise%205%20Routing.md) diff --git a/runtime-workshop/exercises/iOS/Swift/README.md b/runtime-workshop/exercises/iOS/Swift/README.md new file mode 100644 index 0000000..cbd99e5 --- /dev/null +++ b/runtime-workshop/exercises/iOS/Swift/README.md @@ -0,0 +1,7 @@ +# iOS (Swift) exercises + +- [Exercise 1: Map and Scene](Exercise%201%20Map%20and%20Scene.md) +- [Exercise 2: Add Zoom In and Zoom Out Buttons](Exercise%202%20Zoom%20Buttons.md) +- [Exercise 3: Add Operational Layers](Exercise%203%20Operational%20Layers.md) +- [Exercise 4: Buffer a Point and Query Features](Exercise%204%20Buffer%20and%20Query.md) +- [Exercise 5: Routing](Exercise%205%20Routing.md) diff --git a/runtime-workshop/exercises/macOS/Swift/README.md b/runtime-workshop/exercises/macOS/Swift/README.md new file mode 100644 index 0000000..a22be99 --- /dev/null +++ b/runtime-workshop/exercises/macOS/Swift/README.md @@ -0,0 +1,7 @@ +# macOS (Swift) exercises + +- [Exercise 1: Map and Scene](Exercise%201%20Map%20and%20Scene.md) +- [Exercise 2: Add Zoom In and Zoom Out Buttons](Exercise%202%20Zoom%20Buttons.md) +- [Exercise 3: Add Operational Layers](Exercise%203%20Operational%20Layers.md) +- [Exercise 4: Buffer a Point and Query Features](Exercise%204%20Buffer%20and%20Query.md) +- [Exercise 5: Routing](Exercise%205%20Routing.md) diff --git a/runtime-workshop/solutions/Android/Ex1_MapAndScene/WorkshopApp/app/build.gradle b/runtime-workshop/solutions/Android/Ex1_MapAndScene/WorkshopApp/app/build.gradle index 882e7b0..1f7be9d 100644 --- a/runtime-workshop/solutions/Android/Ex1_MapAndScene/WorkshopApp/app/build.gradle +++ b/runtime-workshop/solutions/Android/Ex1_MapAndScene/WorkshopApp/app/build.gradle @@ -1,14 +1,14 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 27 - buildToolsVersion "27.0.3" + compileSdkVersion 28 + buildToolsVersion "28.0.3" defaultConfig { applicationId "com.esri.wdc.geodev.workshopapp" - minSdkVersion 16 - targetSdkVersion 27 - versionCode 3 - versionName "2018.04" + minSdkVersion 19 + targetSdkVersion 28 + versionCode 4 + versionName "2019.01" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { @@ -22,5 +22,5 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) testImplementation 'junit:junit:4.12' - implementation 'com.esri.arcgisruntime:arcgis-android:100.2.1' + implementation 'com.esri.arcgisruntime:arcgis-android:100.4.0' } diff --git a/runtime-workshop/solutions/Android/Ex1_MapAndScene/WorkshopApp/build.gradle b/runtime-workshop/solutions/Android/Ex1_MapAndScene/WorkshopApp/build.gradle index e8b0758..f2ae978 100644 --- a/runtime-workshop/solutions/Android/Ex1_MapAndScene/WorkshopApp/build.gradle +++ b/runtime-workshop/solutions/Android/Ex1_MapAndScene/WorkshopApp/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.1' + classpath 'com.android.tools.build:gradle:3.2.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -16,6 +16,7 @@ buildscript { allprojects { repositories { jcenter() + google() maven { url 'https://esri.bintray.com/arcgis' } diff --git a/runtime-workshop/solutions/Android/Ex1_MapAndScene/WorkshopApp/gradle/wrapper/gradle-wrapper.properties b/runtime-workshop/solutions/Android/Ex1_MapAndScene/WorkshopApp/gradle/wrapper/gradle-wrapper.properties index dd2a452..49c476f 100644 --- a/runtime-workshop/solutions/Android/Ex1_MapAndScene/WorkshopApp/gradle/wrapper/gradle-wrapper.properties +++ b/runtime-workshop/solutions/Android/Ex1_MapAndScene/WorkshopApp/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Apr 20 09:37:55 EDT 2018 +#Wed Jan 09 10:35:52 EST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip diff --git a/runtime-workshop/solutions/Android/Ex2_ZoomButtons/WorkshopApp/app/build.gradle b/runtime-workshop/solutions/Android/Ex2_ZoomButtons/WorkshopApp/app/build.gradle index 882e7b0..1f7be9d 100644 --- a/runtime-workshop/solutions/Android/Ex2_ZoomButtons/WorkshopApp/app/build.gradle +++ b/runtime-workshop/solutions/Android/Ex2_ZoomButtons/WorkshopApp/app/build.gradle @@ -1,14 +1,14 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 27 - buildToolsVersion "27.0.3" + compileSdkVersion 28 + buildToolsVersion "28.0.3" defaultConfig { applicationId "com.esri.wdc.geodev.workshopapp" - minSdkVersion 16 - targetSdkVersion 27 - versionCode 3 - versionName "2018.04" + minSdkVersion 19 + targetSdkVersion 28 + versionCode 4 + versionName "2019.01" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { @@ -22,5 +22,5 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) testImplementation 'junit:junit:4.12' - implementation 'com.esri.arcgisruntime:arcgis-android:100.2.1' + implementation 'com.esri.arcgisruntime:arcgis-android:100.4.0' } diff --git a/runtime-workshop/solutions/Android/Ex2_ZoomButtons/WorkshopApp/build.gradle b/runtime-workshop/solutions/Android/Ex2_ZoomButtons/WorkshopApp/build.gradle index e8b0758..f2ae978 100644 --- a/runtime-workshop/solutions/Android/Ex2_ZoomButtons/WorkshopApp/build.gradle +++ b/runtime-workshop/solutions/Android/Ex2_ZoomButtons/WorkshopApp/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.1' + classpath 'com.android.tools.build:gradle:3.2.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -16,6 +16,7 @@ buildscript { allprojects { repositories { jcenter() + google() maven { url 'https://esri.bintray.com/arcgis' } diff --git a/runtime-workshop/solutions/Android/Ex2_ZoomButtons/WorkshopApp/gradle/wrapper/gradle-wrapper.properties b/runtime-workshop/solutions/Android/Ex2_ZoomButtons/WorkshopApp/gradle/wrapper/gradle-wrapper.properties index dd2a452..3b277b9 100644 --- a/runtime-workshop/solutions/Android/Ex2_ZoomButtons/WorkshopApp/gradle/wrapper/gradle-wrapper.properties +++ b/runtime-workshop/solutions/Android/Ex2_ZoomButtons/WorkshopApp/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Apr 20 09:37:55 EDT 2018 +#Wed Jan 09 11:02:40 EST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip diff --git a/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/app/build.gradle b/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/app/build.gradle index fb9ecc9..39e5193 100644 --- a/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/app/build.gradle +++ b/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/app/build.gradle @@ -1,14 +1,14 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 27 - buildToolsVersion "27.0.3" + compileSdkVersion 28 + buildToolsVersion "28.0.3" defaultConfig { applicationId "com.esri.wdc.geodev.workshopapp" - minSdkVersion 16 - targetSdkVersion 27 - versionCode 3 - versionName "2018.04" + minSdkVersion 19 + targetSdkVersion 28 + versionCode 4 + versionName "2019.01" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { @@ -22,6 +22,6 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) testImplementation 'junit:junit:4.12' - implementation 'com.esri.arcgisruntime:arcgis-android:100.2.1' + implementation 'com.esri.arcgisruntime:arcgis-android:100.4.0' implementation 'com.android.support:support-v4:27.1.1' } diff --git a/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/app/src/main/java/com/esri/wdc/geodev/workshopapp/MainActivity.java b/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/app/src/main/java/com/esri/wdc/geodev/workshopapp/MainActivity.java index abe7490..4fecf18 100644 --- a/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/app/src/main/java/com/esri/wdc/geodev/workshopapp/MainActivity.java +++ b/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/app/src/main/java/com/esri/wdc/geodev/workshopapp/MainActivity.java @@ -22,6 +22,7 @@ import com.esri.arcgisruntime.geometry.LinearUnitId; import com.esri.arcgisruntime.geometry.Point; import com.esri.arcgisruntime.layers.ArcGISSceneLayer; +import com.esri.arcgisruntime.layers.KmlLayer; import com.esri.arcgisruntime.mapping.ArcGISMap; import com.esri.arcgisruntime.mapping.ArcGISScene; import com.esri.arcgisruntime.mapping.ArcGISTiledElevationSource; @@ -35,6 +36,7 @@ import com.esri.arcgisruntime.mapping.view.MapView; import com.esri.arcgisruntime.mapping.view.OrbitLocationCameraController; import com.esri.arcgisruntime.mapping.view.SceneView; +import com.esri.arcgisruntime.ogc.kml.KmlDataset; import java.util.ArrayList; import java.util.List; @@ -51,7 +53,9 @@ public class MainActivity extends Activity { private static final String MMPK_PATH = Environment.getExternalStorageDirectory().getPath() + "/data/DC_Crime_Data.mmpk"; private static final String SCENE_SERVICE_URL = - "https://www.arcgis.com/home/item.html?id=a7419641a50e412c980cf242c29aa3c0"; + "https://www.arcgis.com/home/item.html?id=2c9286dfc69349408764e09022b1f52e"; + private static final String KML_URL = + "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_week_age_link.kml"; // Exercise 3: Permission request code for opening a mobile map package private static final int PERM_REQ_OPEN_MMPK = 1; @@ -98,6 +102,10 @@ public void run() { }); scene.getOperationalLayers().add(sceneLayer); + // Exercise 3: Add a KML layer to the scene + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + scene.getOperationalLayers().add(kmlLayer); + // Exercise 2: Set fields. imageButton_lockFocus = findViewById(R.id.imageButton_lockFocus); @@ -303,6 +311,10 @@ public void run() { }); } map.setBasemap(Basemap.createTopographicVector()); + + // Exercise 3: Add a KML layer to the map + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + map.getOperationalLayers().add(kmlLayer); } }); mmpk.loadAsync(); diff --git a/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/build.gradle b/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/build.gradle index 94b8f06..f2ae978 100644 --- a/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/build.gradle +++ b/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.1' + classpath 'com.android.tools.build:gradle:3.2.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -16,12 +16,10 @@ buildscript { allprojects { repositories { jcenter() + google() maven { url 'https://esri.bintray.com/arcgis' } - maven { - url 'https://maven.google.com' - } } } diff --git a/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/gradle/wrapper/gradle-wrapper.properties b/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/gradle/wrapper/gradle-wrapper.properties index dd2a452..6cfeb6f 100644 --- a/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/gradle/wrapper/gradle-wrapper.properties +++ b/runtime-workshop/solutions/Android/Ex3_OpLyrs/WorkshopApp/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Apr 20 09:37:55 EDT 2018 +#Wed Jan 09 11:43:19 EST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip diff --git a/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/app/build.gradle b/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/app/build.gradle index fb9ecc9..39e5193 100644 --- a/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/app/build.gradle +++ b/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/app/build.gradle @@ -1,14 +1,14 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 27 - buildToolsVersion "27.0.3" + compileSdkVersion 28 + buildToolsVersion "28.0.3" defaultConfig { applicationId "com.esri.wdc.geodev.workshopapp" - minSdkVersion 16 - targetSdkVersion 27 - versionCode 3 - versionName "2018.04" + minSdkVersion 19 + targetSdkVersion 28 + versionCode 4 + versionName "2019.01" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { @@ -22,6 +22,6 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) testImplementation 'junit:junit:4.12' - implementation 'com.esri.arcgisruntime:arcgis-android:100.2.1' + implementation 'com.esri.arcgisruntime:arcgis-android:100.4.0' implementation 'com.android.support:support-v4:27.1.1' } diff --git a/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/app/src/main/java/com/esri/wdc/geodev/workshopapp/MainActivity.java b/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/app/src/main/java/com/esri/wdc/geodev/workshopapp/MainActivity.java index e56817a..b64cb4a 100644 --- a/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/app/src/main/java/com/esri/wdc/geodev/workshopapp/MainActivity.java +++ b/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/app/src/main/java/com/esri/wdc/geodev/workshopapp/MainActivity.java @@ -27,6 +27,7 @@ import com.esri.arcgisruntime.geometry.SpatialReference; import com.esri.arcgisruntime.layers.ArcGISSceneLayer; import com.esri.arcgisruntime.layers.FeatureLayer; +import com.esri.arcgisruntime.layers.KmlLayer; import com.esri.arcgisruntime.layers.Layer; import com.esri.arcgisruntime.mapping.ArcGISMap; import com.esri.arcgisruntime.mapping.ArcGISScene; @@ -46,6 +47,7 @@ import com.esri.arcgisruntime.mapping.view.MapView; import com.esri.arcgisruntime.mapping.view.OrbitLocationCameraController; import com.esri.arcgisruntime.mapping.view.SceneView; +import com.esri.arcgisruntime.ogc.kml.KmlDataset; import com.esri.arcgisruntime.symbology.SimpleFillSymbol; import com.esri.arcgisruntime.symbology.SimpleLineSymbol; import com.esri.arcgisruntime.symbology.SimpleMarkerSymbol; @@ -66,7 +68,9 @@ public class MainActivity extends Activity { private static final String MMPK_PATH = Environment.getExternalStorageDirectory().getPath() + "/data/DC_Crime_Data.mmpk"; private static final String SCENE_SERVICE_URL = - "https://www.arcgis.com/home/item.html?id=a7419641a50e412c980cf242c29aa3c0"; + "https://www.arcgis.com/home/item.html?id=2c9286dfc69349408764e09022b1f52e"; + private static final String KML_URL = + "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_week_age_link.kml"; // Exercise 3: Permission request code for opening a mobile map package private static final int PERM_REQ_OPEN_MMPK = 1; @@ -124,6 +128,10 @@ public void run() { }); scene.getOperationalLayers().add(sceneLayer); + // Exercise 3: Add a KML layer to the scene + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + scene.getOperationalLayers().add(kmlLayer); + // Exercise 2: Set fields. imageButton_lockFocus = findViewById(R.id.imageButton_lockFocus); @@ -352,6 +360,10 @@ public void run() { }); } map.setBasemap(Basemap.createTopographicVector()); + + // Exercise 3: Add a KML layer to the map + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + map.getOperationalLayers().add(kmlLayer); } }); mmpk.loadAsync(); diff --git a/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/build.gradle b/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/build.gradle index 94b8f06..f2ae978 100644 --- a/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/build.gradle +++ b/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.1' + classpath 'com.android.tools.build:gradle:3.2.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -16,12 +16,10 @@ buildscript { allprojects { repositories { jcenter() + google() maven { url 'https://esri.bintray.com/arcgis' } - maven { - url 'https://maven.google.com' - } } } diff --git a/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/gradle/wrapper/gradle-wrapper.properties b/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/gradle/wrapper/gradle-wrapper.properties index dd2a452..ab49c6f 100644 --- a/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/gradle/wrapper/gradle-wrapper.properties +++ b/runtime-workshop/solutions/Android/Ex4_BufferQuery/WorkshopApp/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Apr 20 09:37:55 EDT 2018 +#Wed Jan 09 12:07:52 EST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip diff --git a/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/app/build.gradle b/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/app/build.gradle index fb9ecc9..39e5193 100644 --- a/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/app/build.gradle +++ b/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/app/build.gradle @@ -1,14 +1,14 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 27 - buildToolsVersion "27.0.3" + compileSdkVersion 28 + buildToolsVersion "28.0.3" defaultConfig { applicationId "com.esri.wdc.geodev.workshopapp" - minSdkVersion 16 - targetSdkVersion 27 - versionCode 3 - versionName "2018.04" + minSdkVersion 19 + targetSdkVersion 28 + versionCode 4 + versionName "2019.01" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { @@ -22,6 +22,6 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) testImplementation 'junit:junit:4.12' - implementation 'com.esri.arcgisruntime:arcgis-android:100.2.1' + implementation 'com.esri.arcgisruntime:arcgis-android:100.4.0' implementation 'com.android.support:support-v4:27.1.1' } diff --git a/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/app/src/main/java/com/esri/wdc/geodev/workshopapp/MainActivity.java b/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/app/src/main/java/com/esri/wdc/geodev/workshopapp/MainActivity.java index b11c802..7144170 100644 --- a/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/app/src/main/java/com/esri/wdc/geodev/workshopapp/MainActivity.java +++ b/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/app/src/main/java/com/esri/wdc/geodev/workshopapp/MainActivity.java @@ -29,6 +29,7 @@ import com.esri.arcgisruntime.geometry.SpatialReference; import com.esri.arcgisruntime.layers.ArcGISSceneLayer; import com.esri.arcgisruntime.layers.FeatureLayer; +import com.esri.arcgisruntime.layers.KmlLayer; import com.esri.arcgisruntime.layers.Layer; import com.esri.arcgisruntime.mapping.ArcGISMap; import com.esri.arcgisruntime.mapping.ArcGISScene; @@ -49,6 +50,7 @@ import com.esri.arcgisruntime.mapping.view.MapView; import com.esri.arcgisruntime.mapping.view.OrbitLocationCameraController; import com.esri.arcgisruntime.mapping.view.SceneView; +import com.esri.arcgisruntime.ogc.kml.KmlDataset; import com.esri.arcgisruntime.security.UserCredential; import com.esri.arcgisruntime.symbology.SimpleFillSymbol; import com.esri.arcgisruntime.symbology.SimpleLineSymbol; @@ -79,7 +81,9 @@ public class MainActivity extends Activity { private static final String MMPK_PATH = Environment.getExternalStorageDirectory().getPath() + "/data/DC_Crime_Data.mmpk"; private static final String SCENE_SERVICE_URL = - "https://www.arcgis.com/home/item.html?id=a7419641a50e412c980cf242c29aa3c0"; + "https://www.arcgis.com/home/item.html?id=2c9286dfc69349408764e09022b1f52e"; + private static final String KML_URL = + "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_week_age_link.kml"; // Exercise 3: Permission request code for opening a mobile map package private static final int PERM_REQ_OPEN_MMPK = 1; @@ -153,6 +157,10 @@ public void run() { }); scene.getOperationalLayers().add(sceneLayer); + // Exercise 3: Add a KML layer to the scene + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + scene.getOperationalLayers().add(kmlLayer); + // Exercise 2: Set fields. imageButton_lockFocus = findViewById(R.id.imageButton_lockFocus); @@ -437,6 +445,10 @@ public void run() { }); } map.setBasemap(Basemap.createTopographicVector()); + + // Exercise 3: Add a KML layer to the map + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + map.getOperationalLayers().add(kmlLayer); } }); mmpk.loadAsync(); diff --git a/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/build.gradle b/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/build.gradle index 94b8f06..f2ae978 100644 --- a/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/build.gradle +++ b/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.1' + classpath 'com.android.tools.build:gradle:3.2.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -16,12 +16,10 @@ buildscript { allprojects { repositories { jcenter() + google() maven { url 'https://esri.bintray.com/arcgis' } - maven { - url 'https://maven.google.com' - } } } diff --git a/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/gradle/wrapper/gradle-wrapper.properties b/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/gradle/wrapper/gradle-wrapper.properties index dd2a452..32d05b2 100644 --- a/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/gradle/wrapper/gradle-wrapper.properties +++ b/runtime-workshop/solutions/Android/Ex5_Routing/WorkshopApp/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Apr 20 09:37:55 EDT 2018 +#Wed Jan 09 12:16:27 EST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip diff --git a/runtime-workshop/solutions/Java/Ex1_MapAndScene/pom.xml b/runtime-workshop/solutions/Java/Ex1_MapAndScene/pom.xml index 236ac8e..61e2652 100644 --- a/runtime-workshop/solutions/Java/Ex1_MapAndScene/pom.xml +++ b/runtime-workshop/solutions/Java/Ex1_MapAndScene/pom.xml @@ -2,8 +2,15 @@ 4.0.0 com.esri.wdc.geodev Ex1_MapAndScene - 2018.04 - + 2019.01 + Exercise 1: Map and Scene + + + 11 + 11 + com.esri.wdc.geodev.Launcher + + arcgis @@ -19,10 +26,15 @@ + + org.openjfx + javafx-controls + 11.0.1 + com.esri.arcgisruntime arcgis-java - 100.2.1 + 100.4.0 @@ -34,13 +46,21 @@ arcgis-java-maven-plugin 1.0 - 100.2.1 + 100.4.0 + + + compile + + arcgis + + + maven-resources-plugin - 3.0.2 + 3.1.0 copy-resources @@ -65,13 +85,13 @@ org.apache.maven.plugins maven-jar-plugin - 3.0.2 + 3.1.1 true dependency/ - com.esri.wdc.geodev.WorkshopApp + ${mainClass} @@ -80,7 +100,7 @@ org.apache.maven.plugins maven-dependency-plugin - 3.0.1 + 3.1.1 @@ -89,10 +109,22 @@ + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + + java + + + + + ${mainClass} + + - - 1.8 - 1.8 - - \ No newline at end of file + diff --git a/runtime-workshop/solutions/Java/Ex1_MapAndScene/src/main/java/com/esri/wdc/geodev/Launcher.java b/runtime-workshop/solutions/Java/Ex1_MapAndScene/src/main/java/com/esri/wdc/geodev/Launcher.java new file mode 100644 index 0000000..c3407d7 --- /dev/null +++ b/runtime-workshop/solutions/Java/Ex1_MapAndScene/src/main/java/com/esri/wdc/geodev/Launcher.java @@ -0,0 +1,9 @@ +package com.esri.wdc.geodev; + +public class Launcher { + + public static void main(String[] args) { + WorkshopApp.main(args); + } + +} diff --git a/runtime-workshop/solutions/Java/Ex1_MapAndScene/src/main/java/com/esri/wdc/geodev/WorkshopApp.java b/runtime-workshop/solutions/Java/Ex1_MapAndScene/src/main/java/com/esri/wdc/geodev/WorkshopApp.java index f033606..1091b05 100644 --- a/runtime-workshop/solutions/Java/Ex1_MapAndScene/src/main/java/com/esri/wdc/geodev/WorkshopApp.java +++ b/runtime-workshop/solutions/Java/Ex1_MapAndScene/src/main/java/com/esri/wdc/geodev/WorkshopApp.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2016-2017 Esri + * Copyright 2016-2019 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ import javafx.stage.Stage; /** - * This Application class demonstrates key features of ArcGIS Runtime 100.0. + * This Application class demonstrates key features of ArcGIS Runtime. */ public class WorkshopApp extends Application { diff --git a/runtime-workshop/solutions/Java/Ex2_ZoomButtons/pom.xml b/runtime-workshop/solutions/Java/Ex2_ZoomButtons/pom.xml index 34a9110..16dcc84 100644 --- a/runtime-workshop/solutions/Java/Ex2_ZoomButtons/pom.xml +++ b/runtime-workshop/solutions/Java/Ex2_ZoomButtons/pom.xml @@ -2,8 +2,15 @@ 4.0.0 com.esri.wdc.geodev Ex2_ZoomButtons - 2018.04 - + 2019.01 + Exercise 2: Zoom Buttons + + + 11 + 11 + com.esri.wdc.geodev.Launcher + + arcgis @@ -19,10 +26,15 @@ + + org.openjfx + javafx-controls + 11.0.1 + com.esri.arcgisruntime arcgis-java - 100.2.1 + 100.4.0 @@ -34,13 +46,21 @@ arcgis-java-maven-plugin 1.0 - 100.2.1 + 100.4.0 + + + compile + + arcgis + + + maven-resources-plugin - 3.0.2 + 3.1.0 copy-resources @@ -65,13 +85,13 @@ org.apache.maven.plugins maven-jar-plugin - 3.0.2 + 3.1.1 true dependency/ - com.esri.wdc.geodev.WorkshopApp + ${mainClass} @@ -80,7 +100,7 @@ org.apache.maven.plugins maven-dependency-plugin - 3.0.1 + 3.1.1 @@ -89,10 +109,22 @@ + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + + java + + + + + ${mainClass} + + - - 1.8 - 1.8 - - \ No newline at end of file + diff --git a/runtime-workshop/solutions/Java/Ex2_ZoomButtons/src/main/java/com/esri/wdc/geodev/Launcher.java b/runtime-workshop/solutions/Java/Ex2_ZoomButtons/src/main/java/com/esri/wdc/geodev/Launcher.java new file mode 100644 index 0000000..c3407d7 --- /dev/null +++ b/runtime-workshop/solutions/Java/Ex2_ZoomButtons/src/main/java/com/esri/wdc/geodev/Launcher.java @@ -0,0 +1,9 @@ +package com.esri.wdc.geodev; + +public class Launcher { + + public static void main(String[] args) { + WorkshopApp.main(args); + } + +} diff --git a/runtime-workshop/solutions/Java/Ex2_ZoomButtons/src/main/java/com/esri/wdc/geodev/WorkshopApp.java b/runtime-workshop/solutions/Java/Ex2_ZoomButtons/src/main/java/com/esri/wdc/geodev/WorkshopApp.java index 01499a4..2c67c40 100644 --- a/runtime-workshop/solutions/Java/Ex2_ZoomButtons/src/main/java/com/esri/wdc/geodev/WorkshopApp.java +++ b/runtime-workshop/solutions/Java/Ex2_ZoomButtons/src/main/java/com/esri/wdc/geodev/WorkshopApp.java @@ -1,5 +1,5 @@ /** ***************************************************************************** - * Copyright 2016-2017 Esri + * Copyright 2016-2019 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ import javafx.stage.Stage; /** - * This Application class demonstrates key features of ArcGIS Runtime 100.0. + * This Application class demonstrates key features of ArcGIS Runtime. */ public class WorkshopApp extends Application { diff --git a/runtime-workshop/solutions/Java/Ex3_OperationalLayers/pom.xml b/runtime-workshop/solutions/Java/Ex3_OperationalLayers/pom.xml index 3675b5a..daafb60 100644 --- a/runtime-workshop/solutions/Java/Ex3_OperationalLayers/pom.xml +++ b/runtime-workshop/solutions/Java/Ex3_OperationalLayers/pom.xml @@ -2,8 +2,15 @@ 4.0.0 com.esri.wdc.geodev Ex3_OperationalLayers - 2018.04 - + 2019.01 + Exercise 3: Operational Layers + + + 11 + 11 + com.esri.wdc.geodev.Launcher + + arcgis @@ -19,10 +26,15 @@ + + org.openjfx + javafx-controls + 11.0.1 + com.esri.arcgisruntime arcgis-java - 100.2.1 + 100.4.0 @@ -34,13 +46,21 @@ arcgis-java-maven-plugin 1.0 - 100.2.1 + 100.4.0 + + + compile + + arcgis + + + maven-resources-plugin - 3.0.2 + 3.1.0 copy-resources @@ -65,13 +85,13 @@ org.apache.maven.plugins maven-jar-plugin - 3.0.2 + 3.1.1 true dependency/ - com.esri.wdc.geodev.WorkshopApp + ${mainClass} @@ -80,7 +100,7 @@ org.apache.maven.plugins maven-dependency-plugin - 3.0.1 + 3.1.1 @@ -89,11 +109,22 @@ + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + + java + + + + + ${mainClass} + + - - 1.8 - 1.8 - - Ex3_OperationalLayers - \ No newline at end of file + diff --git a/runtime-workshop/solutions/Java/Ex3_OperationalLayers/src/main/java/com/esri/wdc/geodev/Launcher.java b/runtime-workshop/solutions/Java/Ex3_OperationalLayers/src/main/java/com/esri/wdc/geodev/Launcher.java new file mode 100644 index 0000000..c3407d7 --- /dev/null +++ b/runtime-workshop/solutions/Java/Ex3_OperationalLayers/src/main/java/com/esri/wdc/geodev/Launcher.java @@ -0,0 +1,9 @@ +package com.esri.wdc.geodev; + +public class Launcher { + + public static void main(String[] args) { + WorkshopApp.main(args); + } + +} diff --git a/runtime-workshop/solutions/Java/Ex3_OperationalLayers/src/main/java/com/esri/wdc/geodev/WorkshopApp.java b/runtime-workshop/solutions/Java/Ex3_OperationalLayers/src/main/java/com/esri/wdc/geodev/WorkshopApp.java index a9aa460..0adc963 100644 --- a/runtime-workshop/solutions/Java/Ex3_OperationalLayers/src/main/java/com/esri/wdc/geodev/WorkshopApp.java +++ b/runtime-workshop/solutions/Java/Ex3_OperationalLayers/src/main/java/com/esri/wdc/geodev/WorkshopApp.java @@ -1,5 +1,5 @@ /** ***************************************************************************** - * Copyright 2016-2017 Esri + * Copyright 2016-2019 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import com.esri.arcgisruntime.geometry.LinearUnitId; import com.esri.arcgisruntime.geometry.Point; import com.esri.arcgisruntime.layers.ArcGISSceneLayer; +import com.esri.arcgisruntime.layers.KmlLayer; import com.esri.arcgisruntime.mapping.ArcGISMap; import com.esri.arcgisruntime.mapping.ArcGISScene; import com.esri.arcgisruntime.mapping.ArcGISTiledElevationSource; @@ -36,6 +37,7 @@ import com.esri.arcgisruntime.mapping.view.MapView; import com.esri.arcgisruntime.mapping.view.OrbitLocationCameraController; import com.esri.arcgisruntime.mapping.view.SceneView; +import com.esri.arcgisruntime.ogc.kml.KmlDataset; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; @@ -49,7 +51,7 @@ import javafx.stage.Stage; /** - * This Application class demonstrates key features of ArcGIS Runtime 100.0. + * This Application class demonstrates key features of ArcGIS Runtime. */ public class WorkshopApp extends Application { @@ -60,7 +62,9 @@ public class WorkshopApp extends Application { // Exercise 3: Specify operational layer paths private static final String MMPK_PATH = "../../../data/DC_Crime_Data.mmpk"; private static final String SCENE_SERVICE_URL - = "https://www.arcgis.com/home/item.html?id=a7419641a50e412c980cf242c29aa3c0"; + = "https://www.arcgis.com/home/item.html?id=2c9286dfc69349408764e09022b1f52e"; + private static final String KML_URL + = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_week_age_link.kml"; // Exercise 1: Declare and instantiate fields, including UI components private final MapView mapView = new MapView(); @@ -122,6 +126,10 @@ public WorkshopApp() { mapView.setMap(map); } map.setBasemap(Basemap.createTopographicVector()); + + // Exercise 3: Add a KML layer to the map + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + map.getOperationalLayers().add(kmlLayer); }); mmpk.loadAsync(); } @@ -198,6 +206,10 @@ private void button_toggle2d3d_onAction() { }); scene.getOperationalLayers().add(sceneLayer); + // Exercise 3: Add a KML layer to the scene + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + scene.getOperationalLayers().add(kmlLayer); + sceneView.setArcGISScene(scene); AnchorPane.setLeftAnchor(sceneView, 0.0); AnchorPane.setRightAnchor(sceneView, 0.0); diff --git a/runtime-workshop/solutions/Java/Ex4_BufferAndQuery/pom.xml b/runtime-workshop/solutions/Java/Ex4_BufferAndQuery/pom.xml index 0587253..3b34855 100644 --- a/runtime-workshop/solutions/Java/Ex4_BufferAndQuery/pom.xml +++ b/runtime-workshop/solutions/Java/Ex4_BufferAndQuery/pom.xml @@ -2,8 +2,15 @@ 4.0.0 com.esri.wdc.geodev Ex4_BufferAndQuery - 2018.04 - + 2019.01 + Exercise 4: Buffer and Query + + + 11 + 11 + com.esri.wdc.geodev.Launcher + + arcgis @@ -19,10 +26,15 @@ + + org.openjfx + javafx-controls + 11.0.1 + com.esri.arcgisruntime arcgis-java - 100.2.1 + 100.4.0 @@ -34,13 +46,21 @@ arcgis-java-maven-plugin 1.0 - 100.2.1 + 100.4.0 + + + compile + + arcgis + + + maven-resources-plugin - 3.0.2 + 3.1.0 copy-resources @@ -65,13 +85,13 @@ org.apache.maven.plugins maven-jar-plugin - 3.0.2 + 3.1.1 true dependency/ - com.esri.wdc.geodev.WorkshopApp + ${mainClass} @@ -80,7 +100,7 @@ org.apache.maven.plugins maven-dependency-plugin - 3.0.1 + 3.1.1 @@ -89,10 +109,22 @@ + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + + java + + + + + ${mainClass} + + - - 1.8 - 1.8 - - \ No newline at end of file + diff --git a/runtime-workshop/solutions/Java/Ex4_BufferAndQuery/src/main/java/com/esri/wdc/geodev/Launcher.java b/runtime-workshop/solutions/Java/Ex4_BufferAndQuery/src/main/java/com/esri/wdc/geodev/Launcher.java new file mode 100644 index 0000000..c3407d7 --- /dev/null +++ b/runtime-workshop/solutions/Java/Ex4_BufferAndQuery/src/main/java/com/esri/wdc/geodev/Launcher.java @@ -0,0 +1,9 @@ +package com.esri.wdc.geodev; + +public class Launcher { + + public static void main(String[] args) { + WorkshopApp.main(args); + } + +} diff --git a/runtime-workshop/solutions/Java/Ex4_BufferAndQuery/src/main/java/com/esri/wdc/geodev/WorkshopApp.java b/runtime-workshop/solutions/Java/Ex4_BufferAndQuery/src/main/java/com/esri/wdc/geodev/WorkshopApp.java index 629d791..546d6b5 100644 --- a/runtime-workshop/solutions/Java/Ex4_BufferAndQuery/src/main/java/com/esri/wdc/geodev/WorkshopApp.java +++ b/runtime-workshop/solutions/Java/Ex4_BufferAndQuery/src/main/java/com/esri/wdc/geodev/WorkshopApp.java @@ -1,5 +1,5 @@ /** ***************************************************************************** - * Copyright 2016-2017 Esri + * Copyright 2016-2019 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import com.esri.arcgisruntime.geometry.Polygon; import com.esri.arcgisruntime.layers.ArcGISSceneLayer; import com.esri.arcgisruntime.layers.FeatureLayer; +import com.esri.arcgisruntime.layers.KmlLayer; import com.esri.arcgisruntime.mapping.ArcGISMap; import com.esri.arcgisruntime.mapping.ArcGISScene; import com.esri.arcgisruntime.mapping.ArcGISTiledElevationSource; @@ -44,6 +45,7 @@ import com.esri.arcgisruntime.mapping.view.MapView; import com.esri.arcgisruntime.mapping.view.OrbitLocationCameraController; import com.esri.arcgisruntime.mapping.view.SceneView; +import com.esri.arcgisruntime.ogc.kml.KmlDataset; import com.esri.arcgisruntime.symbology.SimpleFillSymbol; import com.esri.arcgisruntime.symbology.SimpleLineSymbol; import com.esri.arcgisruntime.symbology.SimpleMarkerSymbol; @@ -64,7 +66,7 @@ import javafx.stage.Stage; /** - * This Application class demonstrates key features of ArcGIS Runtime 100.0. + * This Application class demonstrates key features of ArcGIS Runtime. */ public class WorkshopApp extends Application { @@ -75,7 +77,9 @@ public class WorkshopApp extends Application { // Exercise 3: Specify operational layer paths private static final String MMPK_PATH = "../../../data/DC_Crime_Data.mmpk"; private static final String SCENE_SERVICE_URL - = "https://www.arcgis.com/home/item.html?id=a7419641a50e412c980cf242c29aa3c0"; + = "https://www.arcgis.com/home/item.html?id=2c9286dfc69349408764e09022b1f52e"; + private static final String KML_URL + = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_week_age_link.kml"; // Exercise 4: Create symbols for click and buffer private static final SimpleMarkerSymbol CLICK_SYMBOL @@ -152,6 +156,10 @@ public WorkshopApp() { mapView.setMap(map); } map.setBasemap(Basemap.createTopographicVector()); + + // Exercise 3: Add a KML layer to the map + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + map.getOperationalLayers().add(kmlLayer); }); mmpk.loadAsync(); @@ -239,6 +247,10 @@ private void button_toggle2d3d_onAction() { }); scene.getOperationalLayers().add(sceneLayer); + // Exercise 3: Add a KML layer to the scene + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + scene.getOperationalLayers().add(kmlLayer); + /** * Exercise 4: Set the SceneView's onMouseClicked event handler * if the buffer and query button is already selected. diff --git a/runtime-workshop/solutions/Java/Ex5_Routing/pom.xml b/runtime-workshop/solutions/Java/Ex5_Routing/pom.xml index 94b3c83..f48d8e8 100644 --- a/runtime-workshop/solutions/Java/Ex5_Routing/pom.xml +++ b/runtime-workshop/solutions/Java/Ex5_Routing/pom.xml @@ -2,8 +2,15 @@ 4.0.0 com.esri.wdc.geodev Ex5_Routing - 2018.04 - + 2019.01 + Exercise 5: Routing + + + 11 + 11 + com.esri.wdc.geodev.Launcher + + arcgis @@ -19,10 +26,15 @@ + + org.openjfx + javafx-controls + 11.0.1 + com.esri.arcgisruntime arcgis-java - 100.2.1 + 100.4.0 @@ -34,13 +46,21 @@ arcgis-java-maven-plugin 1.0 - 100.2.1 + 100.4.0 + + + compile + + arcgis + + + maven-resources-plugin - 3.0.2 + 3.1.0 copy-resources @@ -65,13 +85,13 @@ org.apache.maven.plugins maven-jar-plugin - 3.0.2 + 3.1.1 true dependency/ - com.esri.wdc.geodev.WorkshopApp + ${mainClass} @@ -80,7 +100,7 @@ org.apache.maven.plugins maven-dependency-plugin - 3.0.1 + 3.1.1 @@ -89,10 +109,22 @@ + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + + java + + + + + ${mainClass} + + - - 1.8 - 1.8 - - \ No newline at end of file + diff --git a/runtime-workshop/solutions/Java/Ex5_Routing/src/main/java/com/esri/wdc/geodev/Launcher.java b/runtime-workshop/solutions/Java/Ex5_Routing/src/main/java/com/esri/wdc/geodev/Launcher.java new file mode 100644 index 0000000..c3407d7 --- /dev/null +++ b/runtime-workshop/solutions/Java/Ex5_Routing/src/main/java/com/esri/wdc/geodev/Launcher.java @@ -0,0 +1,9 @@ +package com.esri.wdc.geodev; + +public class Launcher { + + public static void main(String[] args) { + WorkshopApp.main(args); + } + +} diff --git a/runtime-workshop/solutions/Java/Ex5_Routing/src/main/java/com/esri/wdc/geodev/WorkshopApp.java b/runtime-workshop/solutions/Java/Ex5_Routing/src/main/java/com/esri/wdc/geodev/WorkshopApp.java index 7d4e19a..e24a886 100644 --- a/runtime-workshop/solutions/Java/Ex5_Routing/src/main/java/com/esri/wdc/geodev/WorkshopApp.java +++ b/runtime-workshop/solutions/Java/Ex5_Routing/src/main/java/com/esri/wdc/geodev/WorkshopApp.java @@ -1,5 +1,5 @@ /** ***************************************************************************** - * Copyright 2016-2017 Esri + * Copyright 2016-2019 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ import com.esri.arcgisruntime.geometry.Polygon; import com.esri.arcgisruntime.layers.ArcGISSceneLayer; import com.esri.arcgisruntime.layers.FeatureLayer; +import com.esri.arcgisruntime.layers.KmlLayer; import com.esri.arcgisruntime.mapping.ArcGISMap; import com.esri.arcgisruntime.mapping.ArcGISScene; import com.esri.arcgisruntime.mapping.ArcGISTiledElevationSource; @@ -46,6 +47,7 @@ import com.esri.arcgisruntime.mapping.view.MapView; import com.esri.arcgisruntime.mapping.view.OrbitLocationCameraController; import com.esri.arcgisruntime.mapping.view.SceneView; +import com.esri.arcgisruntime.ogc.kml.KmlDataset; import com.esri.arcgisruntime.security.UserCredential; import com.esri.arcgisruntime.symbology.SimpleFillSymbol; import com.esri.arcgisruntime.symbology.SimpleLineSymbol; @@ -73,7 +75,7 @@ import javafx.stage.Stage; /** - * This Application class demonstrates key features of ArcGIS Runtime 100.0. + * This Application class demonstrates key features of ArcGIS Runtime. */ public class WorkshopApp extends Application { @@ -84,7 +86,9 @@ public class WorkshopApp extends Application { // Exercise 3: Specify operational layer paths private static final String MMPK_PATH = "../../../data/DC_Crime_Data.mmpk"; private static final String SCENE_SERVICE_URL - = "https://www.arcgis.com/home/item.html?id=a7419641a50e412c980cf242c29aa3c0"; + = "https://www.arcgis.com/home/item.html?id=2c9286dfc69349408764e09022b1f52e"; + private static final String KML_URL + = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_week_age_link.kml"; // Exercise 4: Create symbols for click and buffer private static final SimpleMarkerSymbol CLICK_SYMBOL @@ -181,6 +185,10 @@ public WorkshopApp() { mapView.setMap(map); } map.setBasemap(Basemap.createTopographicVector()); + + // Exercise 3: Add a KML layer to the map + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + map.getOperationalLayers().add(kmlLayer); }); mmpk.loadAsync(); @@ -312,6 +320,10 @@ private void button_toggle2d3d_onAction() { }); scene.getOperationalLayers().add(sceneLayer); + // Exercise 3: Add a KML layer to the scene + KmlLayer kmlLayer = new KmlLayer(new KmlDataset(KML_URL)); + scene.getOperationalLayers().add(kmlLayer); + // Exercise 5: Add a GraphicsOverlay to the scene for the routing sceneRouteGraphics.getSceneProperties().setSurfacePlacement(SurfacePlacement.DRAPED); sceneView.getGraphicsOverlays().add(sceneRouteGraphics); diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/AppInfo.h b/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/AppInfo.h index 5f05bb4..af5e87d 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/AppInfo.h +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/AppInfo.h @@ -13,6 +13,7 @@ #ifndef __APPINFO__ #define __APPINFO__ + //------------------------------------------------------------------------------ #define kOrganizationName "MyOrganization" @@ -28,4 +29,3 @@ //------------------------------------------------------------------------------ #endif - diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/WorkshopApp.pro b/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/WorkshopApp.pro index 9fc1582..892db2c 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/WorkshopApp.pro +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/WorkshopApp.pro @@ -1,5 +1,5 @@ #------------------------------------------------- -# Copyright 2016-2018 ESRI +# Copyright 2016-2019 ESRI # # All rights reserved under the copyright laws of the United States # and applicable international laws, treaties, and conventions. @@ -11,7 +11,7 @@ # See the Sample code usage restrictions document for further information. #------------------------------------------------- -VERSION = "2018.04" +VERSION = "2019.01" mac { cache() @@ -19,20 +19,25 @@ mac { #------------------------------------------------------------------------------- -# Adjust these values as needed -OPENSSL_LIBS = D:/GitHub/openssl/out32dll -OPENSSL_INCLUDE = D:/GitHub/openssl/inc32 - CONFIG += c++11 QT += core gui opengl network positioning sensors qml quick -ARCGIS_RUNTIME_VERSION = "100.2.1" +ARCGIS_RUNTIME_VERSION = 100.4 include($$PWD/arcgisruntime.pri) TEMPLATE = app TARGET = WorkshopApp +equals(QT_MAJOR_VERSION, 5) { + lessThan(QT_MINOR_VERSION, 9) { + error("$$TARGET requires Qt 5.9.2") + } + equals(QT_MINOR_VERSION, 9) : lessThan(QT_PATCH_VERSION, 2) { + error("$$TARGET requires Qt 5.9.2") + } +} + #------------------------------------------------------------------------------- HEADERS += \ @@ -49,9 +54,6 @@ OTHER_FILES += \ wizard.xml \ wizard.png -LIBS += -L$$OPENSSL_LIBS -INCLUDEPATH += $$OPENSSL_INCLUDE - #------------------------------------------------------------------------------- win32 { diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/main.cpp b/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/main.cpp index 4d11f83..001fc37 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/main.cpp +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/main.cpp @@ -62,11 +62,6 @@ int main(int argc, char *argv[]) #endif QSettings::setDefaultFormat(kSettingsFormat); -#ifdef Q_OS_WIN - // Force usage of OpenGL ES through ANGLE on Windows - QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); -#endif - // Initialize license #ifdef kLicense diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/qml/main.qml b/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/qml/main.qml index 1c74e78..f0b2273 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/qml/main.qml +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex1_MapAndScene/WorkshopApp/qml/main.qml @@ -1,5 +1,5 @@ -// Copyright 2016-2017 ESRI +// Copyright 2016-2019 ESRI // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. @@ -13,7 +13,7 @@ import QtQuick 2.6 import QtQuick.Controls 1.4 -import Esri.ArcGISRuntime 100.2 +import Esri.ArcGISRuntime 100.4 ApplicationWindow { id: appWindow @@ -28,7 +28,6 @@ ApplicationWindow { MapView { id: mapView anchors.fill: parent - wrapAroundMode: Enums.WrapAroundModeDisabled // set focus to enable keyboard navigation focus: true diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/AppInfo.h b/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/AppInfo.h index 5f05bb4..af5e87d 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/AppInfo.h +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/AppInfo.h @@ -13,6 +13,7 @@ #ifndef __APPINFO__ #define __APPINFO__ + //------------------------------------------------------------------------------ #define kOrganizationName "MyOrganization" @@ -28,4 +29,3 @@ //------------------------------------------------------------------------------ #endif - diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/WorkshopApp.pro b/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/WorkshopApp.pro index 9fc1582..bf3dcad 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/WorkshopApp.pro +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/WorkshopApp.pro @@ -1,5 +1,5 @@ #------------------------------------------------- -# Copyright 2016-2018 ESRI +# Copyright 2016-2019 ESRI # # All rights reserved under the copyright laws of the United States # and applicable international laws, treaties, and conventions. @@ -11,7 +11,7 @@ # See the Sample code usage restrictions document for further information. #------------------------------------------------- -VERSION = "2018.04" +VERSION = "2019.01" mac { cache() @@ -19,20 +19,25 @@ mac { #------------------------------------------------------------------------------- -# Adjust these values as needed -OPENSSL_LIBS = D:/GitHub/openssl/out32dll -OPENSSL_INCLUDE = D:/GitHub/openssl/inc32 - CONFIG += c++11 QT += core gui opengl network positioning sensors qml quick -ARCGIS_RUNTIME_VERSION = "100.2.1" +ARCGIS_RUNTIME_VERSION = 100.4 include($$PWD/arcgisruntime.pri) TEMPLATE = app TARGET = WorkshopApp +equals(QT_MAJOR_VERSION, 5) { + lessThan(QT_MINOR_VERSION, 9) { + error("$$TARGET requires Qt 5.9.2") + } + equals(QT_MINOR_VERSION, 9) : lessThan(QT_PATCH_VERSION, 2) { + error("$$TARGET requires Qt 5.9.2") + } +} + #------------------------------------------------------------------------------- HEADERS += \ @@ -49,9 +54,6 @@ OTHER_FILES += \ wizard.xml \ wizard.png -LIBS += -L$$OPENSSL_LIBS -INCLUDEPATH += $$OPENSSL_INCLUDE - #------------------------------------------------------------------------------- win32 { diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/main.cpp b/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/main.cpp index 4d11f83..001fc37 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/main.cpp +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/main.cpp @@ -62,11 +62,6 @@ int main(int argc, char *argv[]) #endif QSettings::setDefaultFormat(kSettingsFormat); -#ifdef Q_OS_WIN - // Force usage of OpenGL ES through ANGLE on Windows - QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); -#endif - // Initialize license #ifdef kLicense diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/qml/main.qml b/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/qml/main.qml index 7155dd3..d5deeda 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/qml/main.qml +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex2_ZoomButtons/WorkshopApp/qml/main.qml @@ -1,5 +1,5 @@ -// Copyright 2016-2017 ESRI +// Copyright 2016-2019 ESRI // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. @@ -13,7 +13,7 @@ import QtQuick 2.6 import QtQuick.Controls 1.4 -import Esri.ArcGISRuntime 100.2 +import Esri.ArcGISRuntime 100.4 ApplicationWindow { id: appWindow @@ -28,7 +28,6 @@ ApplicationWindow { MapView { id: mapView anchors.fill: parent - wrapAroundMode: Enums.WrapAroundModeDisabled // set focus to enable keyboard navigation focus: true diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/AppInfo.h b/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/AppInfo.h index 5f05bb4..af5e87d 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/AppInfo.h +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/AppInfo.h @@ -13,6 +13,7 @@ #ifndef __APPINFO__ #define __APPINFO__ + //------------------------------------------------------------------------------ #define kOrganizationName "MyOrganization" @@ -28,4 +29,3 @@ //------------------------------------------------------------------------------ #endif - diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/WorkshopApp.pro b/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/WorkshopApp.pro index 9fc1582..bf3dcad 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/WorkshopApp.pro +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/WorkshopApp.pro @@ -1,5 +1,5 @@ #------------------------------------------------- -# Copyright 2016-2018 ESRI +# Copyright 2016-2019 ESRI # # All rights reserved under the copyright laws of the United States # and applicable international laws, treaties, and conventions. @@ -11,7 +11,7 @@ # See the Sample code usage restrictions document for further information. #------------------------------------------------- -VERSION = "2018.04" +VERSION = "2019.01" mac { cache() @@ -19,20 +19,25 @@ mac { #------------------------------------------------------------------------------- -# Adjust these values as needed -OPENSSL_LIBS = D:/GitHub/openssl/out32dll -OPENSSL_INCLUDE = D:/GitHub/openssl/inc32 - CONFIG += c++11 QT += core gui opengl network positioning sensors qml quick -ARCGIS_RUNTIME_VERSION = "100.2.1" +ARCGIS_RUNTIME_VERSION = 100.4 include($$PWD/arcgisruntime.pri) TEMPLATE = app TARGET = WorkshopApp +equals(QT_MAJOR_VERSION, 5) { + lessThan(QT_MINOR_VERSION, 9) { + error("$$TARGET requires Qt 5.9.2") + } + equals(QT_MINOR_VERSION, 9) : lessThan(QT_PATCH_VERSION, 2) { + error("$$TARGET requires Qt 5.9.2") + } +} + #------------------------------------------------------------------------------- HEADERS += \ @@ -49,9 +54,6 @@ OTHER_FILES += \ wizard.xml \ wizard.png -LIBS += -L$$OPENSSL_LIBS -INCLUDEPATH += $$OPENSSL_INCLUDE - #------------------------------------------------------------------------------- win32 { diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/main.cpp b/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/main.cpp index bcd15b2..411fcc5 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/main.cpp +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/main.cpp @@ -63,11 +63,6 @@ int main(int argc, char *argv[]) #endif QSettings::setDefaultFormat(kSettingsFormat); -#ifdef Q_OS_WIN - // Force usage of OpenGL ES through ANGLE on Windows - QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); -#endif - // Initialize license #ifdef kLicense diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/qml/main.qml b/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/qml/main.qml index e11ecbb..2b46a20 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/qml/main.qml +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex3_OperationalLayers/WorkshopApp/qml/main.qml @@ -1,5 +1,5 @@ -// Copyright 2016-2017 ESRI +// Copyright 2016-2019 ESRI // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. @@ -13,7 +13,7 @@ import QtQuick 2.6 import QtQuick.Controls 1.4 -import Esri.ArcGISRuntime 100.2 +import Esri.ArcGISRuntime 100.4 ApplicationWindow { id: appWindow @@ -26,13 +26,20 @@ ApplicationWindow { // Exercise 3: Specify operational layer paths readonly property url mmpkPath: workingDirectory + "/../../../../../../data/DC_Crime_Data.mmpk" - readonly property url sceneServiceUrl: "https://www.arcgis.com/home/item.html?id=a7419641a50e412c980cf242c29aa3c0" + readonly property url sceneServiceUrl: "https://www.arcgis.com/home/item.html?id=2c9286dfc69349408764e09022b1f52e" + readonly property url kmlUrl: "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_week_age_link.kml" + + // Exercise 3: Create a KML layer for the 2D map + property KmlLayer kmlLayer2d: KmlLayer { + dataset: KmlDataset { + url: kmlUrl + } + } // add a mapView component MapView { id: mapView anchors.fill: parent - wrapAroundMode: Enums.WrapAroundModeDisabled // set focus to enable keyboard navigation focus: true @@ -58,6 +65,9 @@ ApplicationWindow { if (loadStatus === Enums.LoadStatusLoaded) { mapView.map = mmpk.maps[0]; mapView.map.basemap = basemap; + + // Exercise 3: Add a KML layer to the map + mapView.map.operationalLayers.append(kmlLayer2d); } } } @@ -98,6 +108,13 @@ ApplicationWindow { } } } + + // Exercise 3: Add a KML layer to the scene + KmlLayer { + dataset: KmlDataset { + url: kmlUrl + } + } } } diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/AppInfo.h b/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/AppInfo.h index 5f05bb4..af5e87d 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/AppInfo.h +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/AppInfo.h @@ -13,6 +13,7 @@ #ifndef __APPINFO__ #define __APPINFO__ + //------------------------------------------------------------------------------ #define kOrganizationName "MyOrganization" @@ -28,4 +29,3 @@ //------------------------------------------------------------------------------ #endif - diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/WorkshopApp.pro b/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/WorkshopApp.pro index 9fc1582..bf3dcad 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/WorkshopApp.pro +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/WorkshopApp.pro @@ -1,5 +1,5 @@ #------------------------------------------------- -# Copyright 2016-2018 ESRI +# Copyright 2016-2019 ESRI # # All rights reserved under the copyright laws of the United States # and applicable international laws, treaties, and conventions. @@ -11,7 +11,7 @@ # See the Sample code usage restrictions document for further information. #------------------------------------------------- -VERSION = "2018.04" +VERSION = "2019.01" mac { cache() @@ -19,20 +19,25 @@ mac { #------------------------------------------------------------------------------- -# Adjust these values as needed -OPENSSL_LIBS = D:/GitHub/openssl/out32dll -OPENSSL_INCLUDE = D:/GitHub/openssl/inc32 - CONFIG += c++11 QT += core gui opengl network positioning sensors qml quick -ARCGIS_RUNTIME_VERSION = "100.2.1" +ARCGIS_RUNTIME_VERSION = 100.4 include($$PWD/arcgisruntime.pri) TEMPLATE = app TARGET = WorkshopApp +equals(QT_MAJOR_VERSION, 5) { + lessThan(QT_MINOR_VERSION, 9) { + error("$$TARGET requires Qt 5.9.2") + } + equals(QT_MINOR_VERSION, 9) : lessThan(QT_PATCH_VERSION, 2) { + error("$$TARGET requires Qt 5.9.2") + } +} + #------------------------------------------------------------------------------- HEADERS += \ @@ -49,9 +54,6 @@ OTHER_FILES += \ wizard.xml \ wizard.png -LIBS += -L$$OPENSSL_LIBS -INCLUDEPATH += $$OPENSSL_INCLUDE - #------------------------------------------------------------------------------- win32 { diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/main.cpp b/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/main.cpp index bcd15b2..411fcc5 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/main.cpp +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/main.cpp @@ -63,11 +63,6 @@ int main(int argc, char *argv[]) #endif QSettings::setDefaultFormat(kSettingsFormat); -#ifdef Q_OS_WIN - // Force usage of OpenGL ES through ANGLE on Windows - QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); -#endif - // Initialize license #ifdef kLicense diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/qml/main.qml b/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/qml/main.qml index c0763fc..724c5d9 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/qml/main.qml +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex4_BufferAndQuery/WorkshopApp/qml/main.qml @@ -1,5 +1,5 @@ -// Copyright 2016-2017 ESRI +// Copyright 2016-2019 ESRI // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. @@ -13,7 +13,7 @@ import QtQuick 2.6 import QtQuick.Controls 1.4 -import Esri.ArcGISRuntime 100.2 +import Esri.ArcGISRuntime 100.4 ApplicationWindow { id: appWindow @@ -26,7 +26,15 @@ ApplicationWindow { // Exercise 3: Specify operational layer paths readonly property url mmpkPath: workingDirectory + "/../../../../../../data/DC_Crime_Data.mmpk" - readonly property url sceneServiceUrl: "https://www.arcgis.com/home/item.html?id=a7419641a50e412c980cf242c29aa3c0" + readonly property url sceneServiceUrl: "https://www.arcgis.com/home/item.html?id=2c9286dfc69349408764e09022b1f52e" + readonly property url kmlUrl: "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_week_age_link.kml" + + // Exercise 3: Create a KML layer for the 2D map + property KmlLayer kmlLayer2d: KmlLayer { + dataset: KmlDataset { + url: kmlUrl + } + } // Exercise 4: Create symbols for click and buffer SimpleMarkerSymbol { @@ -59,7 +67,6 @@ ApplicationWindow { MapView { id: mapView anchors.fill: parent - wrapAroundMode: Enums.WrapAroundModeDisabled // set focus to enable keyboard navigation focus: true @@ -97,6 +104,9 @@ ApplicationWindow { if (loadStatus === Enums.LoadStatusLoaded) { mapView.map = mmpk.maps[0]; mapView.map.basemap = basemap; + + // Exercise 3: Add a KML layer to the map + mapView.map.operationalLayers.append(kmlLayer2d); } } } @@ -137,6 +147,13 @@ ApplicationWindow { } } } + + // Exercise 3: Add a KML layer to the scene + KmlLayer { + dataset: KmlDataset { + url: kmlUrl + } + } } } diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/AppInfo.h b/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/AppInfo.h index 5f05bb4..af5e87d 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/AppInfo.h +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/AppInfo.h @@ -13,6 +13,7 @@ #ifndef __APPINFO__ #define __APPINFO__ + //------------------------------------------------------------------------------ #define kOrganizationName "MyOrganization" @@ -28,4 +29,3 @@ //------------------------------------------------------------------------------ #endif - diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/WorkshopApp.pro b/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/WorkshopApp.pro index 9fc1582..bf3dcad 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/WorkshopApp.pro +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/WorkshopApp.pro @@ -1,5 +1,5 @@ #------------------------------------------------- -# Copyright 2016-2018 ESRI +# Copyright 2016-2019 ESRI # # All rights reserved under the copyright laws of the United States # and applicable international laws, treaties, and conventions. @@ -11,7 +11,7 @@ # See the Sample code usage restrictions document for further information. #------------------------------------------------- -VERSION = "2018.04" +VERSION = "2019.01" mac { cache() @@ -19,20 +19,25 @@ mac { #------------------------------------------------------------------------------- -# Adjust these values as needed -OPENSSL_LIBS = D:/GitHub/openssl/out32dll -OPENSSL_INCLUDE = D:/GitHub/openssl/inc32 - CONFIG += c++11 QT += core gui opengl network positioning sensors qml quick -ARCGIS_RUNTIME_VERSION = "100.2.1" +ARCGIS_RUNTIME_VERSION = 100.4 include($$PWD/arcgisruntime.pri) TEMPLATE = app TARGET = WorkshopApp +equals(QT_MAJOR_VERSION, 5) { + lessThan(QT_MINOR_VERSION, 9) { + error("$$TARGET requires Qt 5.9.2") + } + equals(QT_MINOR_VERSION, 9) : lessThan(QT_PATCH_VERSION, 2) { + error("$$TARGET requires Qt 5.9.2") + } +} + #------------------------------------------------------------------------------- HEADERS += \ @@ -49,9 +54,6 @@ OTHER_FILES += \ wizard.xml \ wizard.png -LIBS += -L$$OPENSSL_LIBS -INCLUDEPATH += $$OPENSSL_INCLUDE - #------------------------------------------------------------------------------- win32 { diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/main.cpp b/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/main.cpp index bcd15b2..411fcc5 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/main.cpp +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/main.cpp @@ -63,11 +63,6 @@ int main(int argc, char *argv[]) #endif QSettings::setDefaultFormat(kSettingsFormat); -#ifdef Q_OS_WIN - // Force usage of OpenGL ES through ANGLE on Windows - QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); -#endif - // Initialize license #ifdef kLicense diff --git a/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/qml/main.qml b/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/qml/main.qml index 9d273d7..56c4847 100644 --- a/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/qml/main.qml +++ b/runtime-workshop/solutions/Qt/Qt Quick/Ex5_Routing/WorkshopApp/qml/main.qml @@ -1,5 +1,5 @@ -// Copyright 2016-2017 ESRI +// Copyright 2016-2019 ESRI // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. @@ -13,7 +13,7 @@ import QtQuick 2.6 import QtQuick.Controls 1.4 -import Esri.ArcGISRuntime 100.2 +import Esri.ArcGISRuntime 100.4 ApplicationWindow { id: appWindow @@ -26,7 +26,15 @@ ApplicationWindow { // Exercise 3: Specify operational layer paths readonly property url mmpkPath: workingDirectory + "/../../../../../../data/DC_Crime_Data.mmpk" - readonly property url sceneServiceUrl: "https://www.arcgis.com/home/item.html?id=a7419641a50e412c980cf242c29aa3c0" + readonly property url sceneServiceUrl: "https://www.arcgis.com/home/item.html?id=2c9286dfc69349408764e09022b1f52e" + readonly property url kmlUrl: "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_week_age_link.kml" + + // Exercise 3: Create a KML layer for the 2D map + property KmlLayer kmlLayer2d: KmlLayer { + dataset: KmlDataset { + url: kmlUrl + } + } // Exercise 5: Declare origin point and route parameters variables property var originPoint: undefined @@ -141,7 +149,6 @@ ApplicationWindow { MapView { id: mapView anchors.fill: parent - wrapAroundMode: Enums.WrapAroundModeDisabled // set focus to enable keyboard navigation focus: true @@ -187,6 +194,9 @@ ApplicationWindow { if (loadStatus === Enums.LoadStatusLoaded) { mapView.map = mmpk.maps[0]; mapView.map.basemap = basemap; + + // Exercise 3: Add a KML layer to the map + mapView.map.operationalLayers.append(kmlLayer2d); } } } @@ -227,6 +237,13 @@ ApplicationWindow { } } } + + // Exercise 3: Add a KML layer to the scene + KmlLayer { + dataset: KmlDataset { + url: kmlUrl + } + } } // Exercise 5: Add routing graphics overlay