Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
p x
MapMultiEngine
Commits
a05e954e
Commit
a05e954e
authored
Sep 10, 2025
by
p x
Browse files
微调类的包
parent
aff5465d
Changes
29
Hide whitespace changes
Inline
Side-by-side
mapapi/src/main/java/com/sd/api/intfaces/OnNaviPresenterListener.kt
View file @
a05e954e
...
...
@@ -43,7 +43,7 @@ interface OnNaviPresenterListener {
fun
onDistanceChanged
(
distance
:
Int
)
/**
*
导航路口剩余距离
*
到达目的地
* 目前是没有下一个引导点,距离路线距离10米,即为到达目的地。 有下一个引导点,下一个引导距此引导点距离在10米以内,到此引导距离在3米以内,也为到达目的地。
*/
fun
onArriveDestination
()
...
...
mapapi/src/main/java/com/sd/api/location/MSLoc
Bean
.kt
→
mapapi/src/main/java/com/sd/api/location/MSLoc
Cb
.kt
View file @
a05e954e
package
com.sd.api.location
/**定位数据回调*/
class
MSLoc
Bean
{
class
MSLoc
Cb
{
companion
object
{
val
instance
:
MSLoc
Bean
by
lazy
{
MSLoc
Bean
()
}
val
instance
:
MSLoc
Cb
by
lazy
{
MSLoc
Cb
()
}
}
//当前经纬度
...
...
mapapi/src/main/java/com/sd/api/location/MSLocation.kt
View file @
a05e954e
...
...
@@ -2,7 +2,7 @@ package com.sd.api.location
import
com.sd.api.MAP_TYPE
import
com.sd.api.MSDKInitializer
import
com.sd.api.
core.basic
.amap.AmapGpsLocation
import
com.sd.api.
maps
.amap.AmapGpsLocation
/**
* 定位类
...
...
mapapi/src/main/java/com/sd/api/location/MineGpsLocation.kt
View file @
a05e954e
...
...
@@ -7,7 +7,6 @@ import com.minedata.minenavi.location.MineLocationManager
import
com.minedata.minenavi.location.MineLocationOptions
import
com.minedata.minenavi.mapdal.CoordType
import
com.sd.api.UserCtx
import
com.sd.api.location.MSLocBean
/**GPS定位类*/
object
MineGpsLocation
{
...
...
@@ -63,7 +62,7 @@ object MineGpsLocation {
override
fun
onLocationChanged
(
location
:
MineLocation
?)
{
// println("-------四维定位改变 = ${location?.latitude} curLng=${location?.longitude} speed=${location?.speed}")
var
loc
=
MSLoc
Bean
.
Companion
.
instance
.
apply
{
var
loc
=
MSLoc
Cb
.
Companion
.
instance
.
apply
{
lat
=
location
?.
latitude
?:
0.0
lng
=
location
?.
longitude
?:
0.0
speed
=
location
?.
speed
?:
0f
...
...
mapapi/src/main/java/com/sd/api/location/OnMsGpsLoc.kt
View file @
a05e954e
package
com.sd.api.location
import
com.sd.api.location.MSLocBean
/**业务层Gps定位回调接口**/
interface
OnMsGpsLoc
{
fun
onMsGpsLoc
(
mSLocBean
:
MSLoc
Bean
)
fun
onMsGpsLoc
(
mSLocBean
:
MSLoc
Cb
)
}
\ No newline at end of file
mapapi/src/main/java/com/sd/api/maps/DrawInMap.kt
View file @
a05e954e
...
...
@@ -5,7 +5,7 @@ import com.sd.api.MAP_TYPE
import
com.sd.api.MSDKInitializer
import
com.sd.api.ui.MapReadyView
import
com.sd.api.maps.cdata.MSOverlay
import
com.sd.api.
core.basic
.mine.MineDrawInMap
import
com.sd.api.
maps
.mine.MineDrawInMap
import
com.sd.api.maps.amap.AmapDrawInMap
import
com.sd.api.maps.cdata.MSLatLng
import
com.sd.api.maps.cdata.MSMarker
...
...
mapapi/src/main/java/com/sd/api/
core/basic
/amap/AmapGpsLocation.kt
→
mapapi/src/main/java/com/sd/api/
maps
/amap/AmapGpsLocation.kt
View file @
a05e954e
package
com.sd.api.
core.basic
.amap
package
com.sd.api.
maps
.amap
import
com.amap.api.location.AMapLocation
import
com.amap.api.location.AMapLocationClient
import
com.amap.api.location.AMapLocationClientOption
import
com.amap.api.location.AMapLocationClientOption.AMapLocationMode
import
com.amap.api.location.AMapLocationClientOption.AMapLocationProtocol
import
com.amap.api.location.AMapLocationListener
import
com.sd.api.UserCtx
import
com.sd.api.location.MSLoc
Bean
import
com.sd.api.location.MSLoc
Cb
import
com.sd.api.location.OnMsGpsLoc
/**GPS定位类*/
...
...
@@ -21,14 +19,14 @@ class AmapGpsLocation {
// 设置高德定位参数
private
val
locationOption
:
AMapLocationClientOption
by
lazy
{
val
mOption
=
AMapLocationClientOption
()
mOption
.
setLocationMode
(
AMapLocationMode
.
Hight_Accuracy
);
//可选,设置定位模式,可选的模式有高精度、仅设备、仅网络。默认为高精度模式
mOption
.
setLocationMode
(
AMapLocationClientOption
.
AMapLocationMode
.
Hight_Accuracy
);
//可选,设置定位模式,可选的模式有高精度、仅设备、仅网络。默认为高精度模式
mOption
.
setGpsFirst
(
false
);
//可选,设置是否gps优先,只在高精度模式下有效。默认关闭
mOption
.
setHttpTimeOut
(
30000
);
//可选,设置网络请求超时时间。默认为30秒。在仅设备模式下无效
mOption
.
setInterval
(
2000
);
//可选,设置定位间隔。默认为2秒
mOption
.
setNeedAddress
(
true
);
//可选,设置是否返回逆地理地址信息。默认是true
mOption
.
setOnceLocation
(
false
);
//可选,设置是否单次定位。默认是false
mOption
.
setOnceLocationLatest
(
false
);
//可选,设置是否等待wifi刷新,默认为false.如果设置为true,会自动变为单次定位,持续定位时不要使用
AMapLocationClientOption
.
setLocationProtocol
(
AMapLocationProtocol
.
HTTP
);
//可选, 设置网络请求的协议。可选HTTP或者HTTPS。默认为HTTP
AMapLocationClientOption
.
setLocationProtocol
(
AMapLocationClientOption
.
AMapLocationProtocol
.
HTTP
);
//可选, 设置网络请求的协议。可选HTTP或者HTTPS。默认为HTTP
mOption
.
setSensorEnable
(
false
);
//可选,设置是否使用传感器。默认是false
mOption
.
setWifiScan
(
true
);
//可选,设置是否开启wifi扫描。默认为true,如果设置为false会同时停止主动刷新,停止以后完全依赖于系统刷新,定位位置可能存在误差
mOption
.
setLocationCacheEnable
(
true
);
//可选,设置是否使用缓存定位,默认为true
...
...
@@ -44,7 +42,7 @@ class AmapGpsLocation {
/**初始化定位*/
private
fun
initLoc
()
{
var
context
=
UserCtx
.
instance
.
mContext
var
context
=
UserCtx
.
Companion
.
instance
.
mContext
alocationClient
=
AMapLocationClient
(
context
)
//设置定位参数
...
...
@@ -84,7 +82,7 @@ class AmapGpsLocation {
//errCode等于0代表定位成功,其他的为定位失败,具体的可以参照官网定位错误码说明
if
(
location
.
getErrorCode
()
==
0
)
{
// println("-------高德定位改变 = ${location?.latitude} curLng=${location?.longitude} speed=${location?.speed}")
var
loc
=
MSLoc
Bea
n
.
instance
.
apply
{
var
loc
=
MSLoc
Cb
.
Companio
n
.
instance
.
apply
{
lat
=
location
?.
latitude
?:
0.0
lng
=
location
?.
longitude
?:
0.0
speed
=
location
?.
speed
?:
0f
...
...
mapapi/src/main/java/com/sd/api/
core/basic
/mine/MineDrawInMap.kt
→
mapapi/src/main/java/com/sd/api/
maps
/mine/MineDrawInMap.kt
View file @
a05e954e
package
com.sd.api.
core.basic
.mine
package
com.sd.api.
maps
.mine
import
android.graphics.BitmapFactory
import
androidx.core.graphics.toColorInt
...
...
@@ -10,10 +10,9 @@ import com.minedata.minenavi.mapdal.LatLng
import
com.msmap.api.R
import
com.sd.api.UserCtx
import
com.sd.api.maps.cdata.MSLatLng
import
com.sd.api.ui.MapReadyView
import
com.sd.api.maps.cdata.MSMarker
import
com.sd.api.maps.cdata.MSOverlay
import
com.sd.api.ui.MapReadyView
/**
* 四维在地图上绘制
...
...
@@ -33,7 +32,7 @@ object MineDrawInMap {
lat
:
Double
,
lng
:
Double
):
MSMarker
{
var
context
=
UserCtx
.
instance
.
mContext
var
context
=
UserCtx
.
Companion
.
instance
.
mContext
// 根据不同的地图类型绘制标记点
val
icon
=
BitmapFactory
.
decodeResource
(
context
?.
resources
,
R
.
drawable
.
market_loc
)
val
latLng
=
LatLng
(
lat
,
lng
)
...
...
mapapi/src/main/java/com/sd/api/ui/MineNaiDirActivity.kt
View file @
a05e954e
...
...
@@ -26,7 +26,6 @@ import com.sd.api.core.basic.OnDriveRoute
import
com.sd.api.core.basic.mine.MineNai
import
com.sd.api.core.basic.mine.MineNaiParams
import
com.sd.api.core.basic.mine.MineRoutePlans
import
com.sd.api.factorys.MapCoreApi
import
com.sd.api.intfaces.OnComCan
import
com.sd.api.intfaces.OnNaviPresenterListener
import
com.sd.api.ui.MapMultiView.OnMapReadyLis
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment