pull/7/head
Arthur VALIN 2 years ago
parent ad24c55bc4
commit 142b716aff

@ -1,13 +1,11 @@
package uca.baptistearthur.geocaching.ui.overlay package uca.baptistearthur.geocaching.ui.overlay
import android.os.AsyncTask
import android.util.Log import android.util.Log
import android.view.MotionEvent import android.view.MotionEvent
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import org.osmdroid.bonuspack.routing.Road
import org.osmdroid.bonuspack.routing.RoadManager import org.osmdroid.bonuspack.routing.RoadManager
import org.osmdroid.util.GeoPoint import org.osmdroid.util.GeoPoint
import org.osmdroid.views.MapView import org.osmdroid.views.MapView
@ -29,7 +27,7 @@ class AddMarkerOverlay(val roadManager: RoadManager) : Overlay() {
marker.position = loc marker.position = loc
mapView.overlays.add(marker) mapView.overlays.add(marker)
computeRoad(mapView) computeRoad(mapView)
addNewRoadtripOverlay(mapView); computeNewRoadtripOverlay(mapView);
} }
return true; return true;
} }
@ -48,7 +46,7 @@ class AddMarkerOverlay(val roadManager: RoadManager) : Overlay() {
} }
} }
fun addNewRoadtripOverlay(mapView: MapView){ fun computeNewRoadtripOverlay(mapView: MapView){
if (locations.size > 1) { if (locations.size > 1) {
mapView.overlays.add(NewRoadtripOverlay(locations)) mapView.overlays.add(NewRoadtripOverlay(locations))
}else{ }else{

@ -17,7 +17,8 @@ class PlaceMarker(val mapView: MapView, val locations: MutableSet<GeoPoint>, val
locations.remove(this.position) locations.remove(this.position)
this.closeInfoWindow() this.closeInfoWindow()
mapView.overlays.remove(this) mapView.overlays.remove(this)
parent.computeRoad(mapView); parent.computeRoad(mapView)
parent.computeNewRoadtripOverlay(mapView)
return true return true
} }
return false return false

Loading…
Cancel
Save