Skip to content

Commit

Permalink
Amend resource location (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
jenmerritt committed Aug 11, 2023
1 parent bd1e682 commit 02fe9b3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8,402 deletions.
20 changes: 20 additions & 0 deletions real_time/add-custom-dynamic-entity-data-source/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,23 @@ pluginManagement {
}

rootProject.name = 'add-custom-dynamic-entity-data-source'

// download sample data
def ant = new groovy.util.AntBuilder()

if (!file("./samples-data").exists()) {
file("./samples-data/real_time").mkdirs()

// get the json file
ant.get(
src: "https://arcgisruntime.maps.arcgis.com/sharing/rest/content/items/1f52d04a8dec40f78fcc414e020b2175/data",
dest: file("./data.zip")
)
ant.unzip(
src: file("./data.zip"),
dest: file("./samples-data/real_time")
)

delete file("./data.zip")

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.esri.samples.add_custom_dynamic_entity_data_source;

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

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

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

0 comments on commit 02fe9b3

Please sign in to comment.