|
|
@@ -44,9 +44,10 @@ public class EarthquakeLocation extends FragmentActivity implements OnMapReadyCa |
|
|
|
private GoogleMap mMap; |
|
|
|
private static final String TAGEPIZENTRUM = "Epizentrum"; |
|
|
|
private DatabaseReference mDatenbank; |
|
|
|
private double latitudeD1, latitudeD2, latitudeD3, latitudeD4; |
|
|
|
private double longitudeD1, longitudeD2, longitudeD3, longitudeD4; |
|
|
|
private double latitudeD1, latitudeD2, latitudeD3, latitudeD4, latitudeEPI; |
|
|
|
private double longitudeD1, longitudeD2, longitudeD3, longitudeD4, lonitudeEPI; |
|
|
|
private String dev1, dev2, dev3, dev4; |
|
|
|
Epizentrum epizentrum; |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void onCreate(Bundle savedInstanceState) { |
|
|
@@ -74,7 +75,8 @@ public class EarthquakeLocation extends FragmentActivity implements OnMapReadyCa |
|
|
|
} |
|
|
|
else{ |
|
|
|
defineGPSforMapping(task.getResult()); |
|
|
|
ermittleEpizentrum(task.getResult()); |
|
|
|
epizentrum = ermittleEpizentrum(task.getResult()); |
|
|
|
//ermittleEpizentrum(task.getResult()); |
|
|
|
//mapToDetektionssignale(task.getResult()); |
|
|
|
} |
|
|
|
} |
|
|
@@ -191,11 +193,23 @@ public class EarthquakeLocation extends FragmentActivity implements OnMapReadyCa |
|
|
|
//########################################################################################################################################################################## |
|
|
|
//################################################################## vvv Maps Code vvv ################################################################################### |
|
|
|
|
|
|
|
@RequiresApi(api = Build.VERSION_CODES.N) |
|
|
|
@Override |
|
|
|
public void onMapReady(GoogleMap googleMap) { |
|
|
|
mMap = googleMap; |
|
|
|
|
|
|
|
//TODO Aron: Daten aus DB in die jeweiligen Devices einsetzten |
|
|
|
if(Objects.isNull(epizentrum)) |
|
|
|
{ |
|
|
|
System.out.println("--------Keine Epizentrum Koordinaten verfügbar"); |
|
|
|
}else |
|
|
|
{ |
|
|
|
System.out.println(">>>>>>>>Epizentrum Koordinaten"); |
|
|
|
latitudeEPI = epizentrum.getKoordinaten().getX(); |
|
|
|
lonitudeEPI = epizentrum.getKoordinaten().getY(); |
|
|
|
System.out.println("Breitengrad/Latitude: " + latitudeEPI); |
|
|
|
System.out.println("Längengrad/Longitude: " + lonitudeEPI); |
|
|
|
} |
|
|
|
|
|
|
|
//aus DB für Device 1 long lat |
|
|
|
LatLng device1 = new LatLng(latitudeD1, longitudeD1); |
|
|
|
mMap.addMarker(new MarkerOptions().position(device1).title("Device 1").icon(BitmapDescriptorFactory |
|
|
@@ -213,8 +227,10 @@ public class EarthquakeLocation extends FragmentActivity implements OnMapReadyCa |
|
|
|
|
|
|
|
//man könnten noch eine IF Abfrage einbauen falls es 4 Devices gibt |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add a marker in Epicenter |
|
|
|
LatLng epicenter = new LatLng(-34, 151); |
|
|
|
LatLng epicenter = new LatLng(latitudeEPI, lonitudeEPI); |
|
|
|
mMap.addMarker(new MarkerOptions().position(epicenter).title("Epicenter")); |
|
|
|
mMap.moveCamera(CameraUpdateFactory.newLatLng(epicenter)); |
|
|
|
} |