Skip to content

Commit 02fe9b3

Browse files
committed
Amend resource location (#801)
1 parent bd1e682 commit 02fe9b3

File tree

3 files changed

+23
-8402
lines changed

3 files changed

+23
-8402
lines changed

real_time/add-custom-dynamic-entity-data-source/settings.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,23 @@ pluginManagement {
66
}
77

88
rootProject.name = 'add-custom-dynamic-entity-data-source'
9+
10+
// download sample data
11+
def ant = new groovy.util.AntBuilder()
12+
13+
if (!file("./samples-data").exists()) {
14+
file("./samples-data/real_time").mkdirs()
15+
16+
// get the json file
17+
ant.get(
18+
src: "https://arcgisruntime.maps.arcgis.com/sharing/rest/content/items/1f52d04a8dec40f78fcc414e020b2175/data",
19+
dest: file("./data.zip")
20+
)
21+
ant.unzip(
22+
src: file("./data.zip"),
23+
dest: file("./samples-data/real_time")
24+
)
25+
26+
delete file("./data.zip")
27+
28+
}

real_time/add-custom-dynamic-entity-data-source/src/main/java/com/esri/samples/add_custom_dynamic_entity_data_source/AddCustomDynamicEntityDataSourceSample.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.esri.samples.add_custom_dynamic_entity_data_source;
1818

19+
import java.io.File;
1920
import java.util.concurrent.ExecutionException;
2021
import java.util.concurrent.TimeUnit;
2122
import java.util.concurrent.TimeoutException;
@@ -71,8 +72,8 @@ public void start(Stage stage) {
7172
// set the initial viewpoint
7273
mapView.setViewpoint(new Viewpoint(new Point(-123.657, 47.984, SpatialReferences.getWgs84()), 3e6));
7374

74-
// a JSON file (stored as a resource) with observations for use as the custom data source
75-
var resource = getClass().getResource("/add_custom_dynamic_entity_data_source/AIS_MarineCadastre_SelectedVessels_CustomDataSource.json").getPath();
75+
// a JSON file with observations for use as the custom data source
76+
var resource = new File(System.getProperty("data.dir"), "./samples-data/real_time/AIS_MarineCadastre_SelectedVessels_CustomDataSource.json").getPath();
7677

7778
// create a custom data source implementation of a DynamicEntityDataSource with a data source,
7879
// an entity id field name (a unique identifier for each entity), and an update delay

0 commit comments

Comments
 (0)