1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- package de.edotzlaff.detection;
-
- import androidx.fragment.app.FragmentActivity;
-
- import android.os.Bundle;
-
- import com.google.android.gms.maps.CameraUpdateFactory;
- import com.google.android.gms.maps.GoogleMap;
- import com.google.android.gms.maps.OnMapReadyCallback;
- import com.google.android.gms.maps.SupportMapFragment;
- import com.google.android.gms.maps.model.BitmapDescriptorFactory;
- import com.google.android.gms.maps.model.LatLng;
- import com.google.android.gms.maps.model.MarkerOptions;
-
- public class EarthquakeLocation extends FragmentActivity implements OnMapReadyCallback {
-
- private GoogleMap mMap;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_earthquake_location);
- // Obtain the SupportMapFragment and get notified when the map is ready to be used.
- SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
- .findFragmentById(R.id.map);
- mapFragment.getMapAsync(this);
- }
-
- //##########################################################################################################################################################################
- //################################################################## vvv DB Code vvv #####################################################################################
-
- //TODO Aron
-
- //################################################################## ^^^^ DB Code ^^^^ ###################################################################################
- //##########################################################################################################################################################################
-
-
-
- //##########################################################################################################################################################################
- //################################################################## vvv Calculate Epicenter vvv #########################################################################
-
- //TODO Jan
-
- //################################################################## ^^^^ Calculate Epicenter ^^^^ #######################################################################
- //##########################################################################################################################################################################
-
-
- //##########################################################################################################################################################################
- //################################################################## vvv Maps Code vvv ###################################################################################
-
- @Override
- public void onMapReady(GoogleMap googleMap) {
- mMap = googleMap;
-
- //TODO Aron: Daten aus DB in die jeweiligen Devices einsetzten
- //aus DB für Device 1 long lat
- LatLng divice1 = new LatLng(-34, 152);
- mMap.addMarker(new MarkerOptions().position(divice1).title("Device 1").icon(BitmapDescriptorFactory
- .defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));
-
- //aus DB für Device 2 long lat
- LatLng divice2 = new LatLng(-33, 152);
- mMap.addMarker(new MarkerOptions().position(divice2).title("Device 2").icon(BitmapDescriptorFactory
- .defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));
-
- //aus DB für Device 3 long lat
- LatLng divice3 = new LatLng(-34, 150);
- mMap.addMarker(new MarkerOptions().position(divice3).title("Device 3").icon(BitmapDescriptorFactory
- .defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));
-
- //man könnten noch eine IF Abfrage einbauen falls es 4 Devices gibt
-
- // Add a marker in Epicenter
- LatLng epicenter = new LatLng(-34, 151);
- mMap.addMarker(new MarkerOptions().position(epicenter).title("Epicenter"));
- mMap.moveCamera(CameraUpdateFactory.newLatLng(epicenter));
- }
-
- //################################################################## ^^^^ Maps Code ^^^^ #################################################################################
- //##########################################################################################################################################################################
-
-
- }
|