Hi, Could anyone suggest a potential work around ref enabling multiple locationDataSources to feed seperate Geofences. I have no issues creating a single fence and can define the monitor type no issue. I tried a couple of things. (Please forgive my current rough code) such as feeding the loactionDataSource directly. Creating different fences based on the name. The issue appears to be the singular loactionDataSource. Is there a way to enable multiple? (Java SDK 200.6 )
// This is being feed from the Dynamic entity data. (ESRI Realtime) The same data which populates the symbology on the screen
public void dataInput(Point latestPoint, HashMap<String, Object> attributes) {
this.latestPoint = latestPoint;
// Each latestPoint can be associated with an attribute. I want to create a different location data source for each attribute type
//I also considered the GeodataBase as a source
String uniquedesignation = (String) attributes.get("uniquedesignation");
//Given I am using Military Symbology 2525D I can determine the identity (Friendly, Hostile etc) I could also use the uniquedesignation
String sidc = (String) attributes.get("sidc");
String firstFour = (sidc != null) ? sidc.substring(0, Math.min(sidc.length(), 4)) : "";
if (monitor!=null) {
if (firstFour.equals(getMonitoringCategory(monitor)) || getMonitoringCategory(monitor).equals(uniquedesignation)) {
updateLocation(new Location(latestPoint));
}
}
}
//This is an SQLite database not the GeoDatabase
public void dataBaseOutput(String id, String theFence, String name, String monitor, String trigger, String bufferDistance, String enableMonitor) {
this.mapView = ui.getMapView();
this.name = name;
this.monitor=monitor;
this.bufferDistance=bufferDistance;
try {// Recreate the Graphic from the geometry json file
Geometry fenceGeometry = Geometry.fromJson(theFence);
Graphic fence = new Graphic(fenceGeometry);
//Reinsert the attributes. Maybe don't need to but have done so at this stage
fence.getAttributes().put("id", id);
fence.getAttributes().put("name", name);
//Add the fence graphic to a list
fences.add(fence);
//I wanted to be able to make different fences
GraphicFenceParameters selectedFenceParams = getFenceParametersForCategory(name,bufferDistance);
if (selectedFenceParams != null) {
updateFenceMonitoring(selectedFenceParams);
}
//Need to fix this
if ("1".equals(enableMonitor)) {
getMonitoringCategory(monitor);
startGeotriggerMonitoring(fence, monitor, trigger, bufferDistance);
}
} catch (Exception e) {
LOG.error("Error parsing fence geometry JSON", e);
}
}