parent
5e44f01779
commit
fd33b41dd2
@ -1,26 +1,32 @@
|
||||
package uca.baptistearthur.geocaching.ui.overlay
|
||||
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.util.Log
|
||||
import android.view.MotionEvent
|
||||
import androidx.core.content.ContextCompat
|
||||
import org.osmdroid.bonuspack.routing.OSRMRoadManager
|
||||
import org.osmdroid.bonuspack.routing.RoadManager
|
||||
import org.osmdroid.util.GeoPoint
|
||||
import org.osmdroid.views.MapView
|
||||
import org.osmdroid.views.overlay.Marker
|
||||
import org.osmdroid.views.overlay.infowindow.InfoWindow
|
||||
import uca.baptistearthur.geocaching.R
|
||||
|
||||
class PlaceMarker(val mapView: MapView, val locations: MutableSet<GeoPoint>, val parent : AddMarkerOverlay) : Marker(mapView) {
|
||||
override fun getTitle(): String {
|
||||
return "Step " + (locations.indexOf(this.position)+1)
|
||||
}
|
||||
class PlaceMarker(val mapView: MapView, val parent : AddMarkerOverlay) : Marker(mapView) {
|
||||
|
||||
override fun getTitle() = parent.getMarkerLabel(this)
|
||||
override fun onLongPress(e: MotionEvent?, mapView: MapView?): Boolean {
|
||||
if(mapView!=null && this.hitTest(e, mapView)) {
|
||||
locations.remove(this.position)
|
||||
parent.removeMarker(this)
|
||||
this.closeInfoWindow()
|
||||
mapView.overlays.remove(this)
|
||||
parent.computeIcons(mapView.context)
|
||||
parent.computeRoad(mapView)
|
||||
parent.computeNewRoadtripOverlay(mapView)
|
||||
mapView.invalidate()
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<vector android:height="50dp" android:tint="#FF0000"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="50dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M14.4,6L14,4H5v17h2v-7h5.6l0.4,2h7V6z"/>
|
||||
</vector>
|
Loading…
Reference in new issue