-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add vectorlocation manager for vector map in android #544
- Loading branch information
Showing
7 changed files
with
540 additions
and
148 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
android/src/main/kotlin/hamza/dali/flutter_osm_plugin/location/CustomLocation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package hamza.dali.flutter_osm_plugin.location | ||
|
||
import android.content.Context | ||
import android.graphics.Bitmap | ||
import android.graphics.Canvas | ||
import android.graphics.Paint | ||
import android.graphics.Point | ||
import android.graphics.PointF | ||
import android.location.Location | ||
import android.os.Handler | ||
import android.os.Looper | ||
import android.util.Log | ||
import android.view.MotionEvent | ||
import androidx.core.content.res.ResourcesCompat | ||
import androidx.core.graphics.drawable.toBitmap | ||
import hamza.dali.flutter_osm_plugin.R | ||
import hamza.dali.flutter_osm_plugin.models.VoidCallback | ||
import hamza.dali.flutter_osm_plugin.utilities.toGeoPoint | ||
import hamza.dali.flutter_osm_plugin.utilities.toHashMap | ||
import io.flutter.plugin.common.MethodChannel | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers.Main | ||
import kotlinx.coroutines.launch | ||
import org.maplibre.android.location.LocationComponentOptions | ||
import org.maplibre.android.location.engine.LocationEngineCallback | ||
import org.maplibre.android.location.engine.LocationEngineRequest | ||
import org.maplibre.android.location.engine.LocationEngineResult | ||
import org.maplibre.android.location.modes.CameraMode | ||
import org.maplibre.android.maps.MapLibreMap | ||
import org.osmdroid.api.IGeoPoint | ||
import org.osmdroid.api.IMapView | ||
import org.osmdroid.util.GeoPoint | ||
import org.osmdroid.views.MapView | ||
import org.osmdroid.views.Projection | ||
import org.osmdroid.views.overlay.Overlay | ||
import org.osmdroid.views.overlay.Overlay.Snappable | ||
import org.osmdroid.views.overlay.mylocation.GpsMyLocationProvider | ||
import org.osmdroid.views.overlay.mylocation.IMyLocationConsumer | ||
import org.osmdroid.views.overlay.mylocation.IMyLocationProvider | ||
import java.lang.Exception | ||
import java.util.LinkedList | ||
import kotlin.lazy | ||
|
||
typealias OnChangedLocation = (userLocation: GeoPoint, heading: Double) -> Unit | ||
|
||
interface CustomLocationManager : IMyLocationConsumer { | ||
val context: Context | ||
val provider: GpsMyLocationProvider | ||
var currentLocation: Location? | ||
var mGeoPoint: GeoPoint? | ||
var mIsFollowing: Boolean | ||
var controlMapFromOutSide: Boolean | ||
var enableAutoStop: Boolean | ||
var mIsLocationEnabled: Boolean | ||
fun setMarkerIcon(personIcon: Bitmap?, directionIcon: Bitmap?) | ||
fun startLocationUpdating() | ||
fun stopLocationUpdating() | ||
fun enableMyLocation() | ||
fun onStopLocation() | ||
fun toggleFollow(enableStop: Boolean) | ||
fun disableFollowLocation() | ||
fun sendLocation() | ||
} | ||
|
||
|
||
|
||
|
Oops, something went wrong.