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
ea79dc91
Commit
ea79dc91
authored
Jan 12, 2026
by
p x
Browse files
规范类命名
parent
f1f5b064
Changes
48
Show whitespace changes
Inline
Side-by-side
mapapi/src/main/java/com/cusc/map/map2d/DelDrawInMap.kt
View file @
ea79dc91
package
com.cusc.map.map2d
package
com.cusc.map.map2d
import
com.cusc.map.map2d.cdata.MapOverlay
import
com.cusc.map.map2d.cdata.MapOverlay
import
com.cusc.map.map2d.cdata.Marker
M
import
com.cusc.map.map2d.cdata.Marker
/**
/**
* 删除地图上的绘制
* 删除地图上的绘制
...
@@ -217,7 +217,7 @@ object DelDrawInMap : MsOperationParent() {
...
@@ -217,7 +217,7 @@ object DelDrawInMap : MsOperationParent() {
* @param mapReadView 地图准备就绪的视图对象,可能为null
* @param mapReadView 地图准备就绪的视图对象,可能为null
* @param mSMarker 要删除的标记点对象,可能为null
* @param mSMarker 要删除的标记点对象,可能为null
*/
*/
fun
deleteMarker
(
mSMarker
:
Marker
M
?)
{
fun
deleteMarker
(
mSMarker
:
Marker
?)
{
if
(
mSMarker
==
null
)
if
(
mSMarker
==
null
)
return
return
var
mapReadView
=
getMapReadView
()
var
mapReadView
=
getMapReadView
()
...
@@ -230,7 +230,7 @@ object DelDrawInMap : MsOperationParent() {
...
@@ -230,7 +230,7 @@ object DelDrawInMap : MsOperationParent() {
MAP_TYPE
.
AMAP
->
{
MAP_TYPE
.
AMAP
->
{
//移除指定的标记点
//移除指定的标记点
Marker
M
.
amaker
?.
remove
()
Marker
.
amaker
?.
remove
()
// 清空高德地图上所有已经标注的marker
// 清空高德地图上所有已经标注的marker
// mapReadView?.aMap?.clear()
// mapReadView?.aMap?.clear()
}
}
...
...
mapapi/src/main/java/com/cusc/map/map2d/DrawInMap.kt
View file @
ea79dc91
...
@@ -2,8 +2,8 @@ package com.cusc.map.map2d
...
@@ -2,8 +2,8 @@ package com.cusc.map.map2d
import
androidx.core.graphics.toColorInt
import
androidx.core.graphics.toColorInt
import
com.cusc.map.map2d.amap.AmapDrawInMap
import
com.cusc.map.map2d.amap.AmapDrawInMap
import
com.cusc.map.map2d.cdata.LatLng
M
import
com.cusc.map.map2d.cdata.LatLng
import
com.cusc.map.map2d.cdata.Marker
M
import
com.cusc.map.map2d.cdata.Marker
import
com.cusc.map.map2d.cdata.MapOverlay
import
com.cusc.map.map2d.cdata.MapOverlay
import
com.cusc.map.map2d.mine.MineDrawInMap
import
com.cusc.map.map2d.mine.MineDrawInMap
...
@@ -24,7 +24,7 @@ class PolylineOptions {
...
@@ -24,7 +24,7 @@ class PolylineOptions {
/**绘制圆形选项**/
/**绘制圆形选项**/
class
CircleOptions
M
{
class
CircleOptions
{
/**半径(米)**/
/**半径(米)**/
var
radius
=
100f
var
radius
=
100f
...
@@ -68,7 +68,7 @@ object DrawInMap : MsOperationParent() {
...
@@ -68,7 +68,7 @@ object DrawInMap : MsOperationParent() {
fun
drawMarket
(
fun
drawMarket
(
lat
:
Double
,
lat
:
Double
,
lng
:
Double
lng
:
Double
):
Marker
M
{
):
Marker
{
val
mapReadView
=
getMapReadView
()
val
mapReadView
=
getMapReadView
()
when
(
MapSdkInit
.
getMapType
())
{
when
(
MapSdkInit
.
getMapType
())
{
MAP_TYPE
.
MINE
->
{
MAP_TYPE
.
MINE
->
{
...
@@ -88,7 +88,7 @@ object DrawInMap : MsOperationParent() {
...
@@ -88,7 +88,7 @@ object DrawInMap : MsOperationParent() {
* @return MSOverlay 覆盖物对象
* @return MSOverlay 覆盖物对象
*/
*/
fun
drawPolyline
(
fun
drawPolyline
(
msLatLng
:
List
<
LatLng
M
>,
msPolylineOptions
:
PolylineOptions
msLatLng
:
List
<
LatLng
>,
msPolylineOptions
:
PolylineOptions
):
MapOverlay
{
):
MapOverlay
{
val
mapReadView
=
getMapReadView
()
val
mapReadView
=
getMapReadView
()
when
(
MapSdkInit
.
getMapType
())
{
when
(
MapSdkInit
.
getMapType
())
{
...
@@ -113,8 +113,8 @@ object DrawInMap : MsOperationParent() {
...
@@ -113,8 +113,8 @@ object DrawInMap : MsOperationParent() {
* @return MSOverlay 返回覆盖物对象
* @return MSOverlay 返回覆盖物对象
*/
*/
fun
drawCircle
(
fun
drawCircle
(
center
:
LatLng
M
,
center
:
LatLng
,
msCircleOptions
:
CircleOptions
M
?
msCircleOptions
:
CircleOptions
?
):
MapOverlay
{
):
MapOverlay
{
val
mapReadView
=
getMapReadView
()
val
mapReadView
=
getMapReadView
()
when
(
MapSdkInit
.
getMapType
())
{
when
(
MapSdkInit
.
getMapType
())
{
...
@@ -141,7 +141,7 @@ object DrawInMap : MsOperationParent() {
...
@@ -141,7 +141,7 @@ object DrawInMap : MsOperationParent() {
* @param msPolygonOptions 多边形绘制选型
* @param msPolygonOptions 多边形绘制选型
*/
*/
fun
drawPolygon
(
fun
drawPolygon
(
msLatLng
:
List
<
LatLng
M
>,
msLatLng
:
List
<
LatLng
>,
msPolygonOptions
:
PolygonOptions
msPolygonOptions
:
PolygonOptions
):
MapOverlay
{
):
MapOverlay
{
val
mapReadView
=
getMapReadView
()
val
mapReadView
=
getMapReadView
()
...
...
mapapi/src/main/java/com/cusc/map/map2d/MapSdkInit.kt
View file @
ea79dc91
...
@@ -9,7 +9,7 @@ import com.minedata.minenavi.SDKInitializer
...
@@ -9,7 +9,7 @@ import com.minedata.minenavi.SDKInitializer
import
com.minedata.minenavi.SDKInitializer.InitListener
import
com.minedata.minenavi.SDKInitializer.InitListener
import
com.minedata.minenavi.map.MineMap
import
com.minedata.minenavi.map.MineMap
import
com.permissionx.guolindev.PermissionX
import
com.permissionx.guolindev.PermissionX
import
com.cusc.map.location.Locat
ionM
import
com.cusc.map.location.Locat
eMap
import
com.cusc.map.ui.MapReadyView
import
com.cusc.map.ui.MapReadyView
...
@@ -102,8 +102,8 @@ object MapSdkInit {
...
@@ -102,8 +102,8 @@ object MapSdkInit {
}
}
MAP_TYPE
.
MINE
->
{
MAP_TYPE
.
MINE
->
{
Locat
ionM
.
initLoc
()
Locat
eMap
.
initLoc
()
Locat
ionM
.
startLoc
(
null
)
Locat
eMap
.
startLoc
(
null
)
SDKInitializer
.
debug
(
false
)
SDKInitializer
.
debug
(
false
)
// SDKInitializer.enableEtaLog(false)
// SDKInitializer.enableEtaLog(false)
// SDKInitializer.outputLog(false)
// SDKInitializer.outputLog(false)
...
...
mapapi/src/main/java/com/cusc/map/map2d/Navigate.kt
View file @
ea79dc91
...
@@ -3,7 +3,7 @@ package com.cusc.map.map2d
...
@@ -3,7 +3,7 @@ package com.cusc.map.map2d
import
com.cusc.map.map2d.inters.OnNaviPresenterListener
import
com.cusc.map.map2d.inters.OnNaviPresenterListener
import
com.cusc.map.map2d.amap.AmapNai
import
com.cusc.map.map2d.amap.AmapNai
import
com.cusc.map.map2d.cdata.DriverRouteBean
import
com.cusc.map.map2d.cdata.DriverRouteBean
import
com.cusc.map.map2d.cdata.LatLng
M
import
com.cusc.map.map2d.cdata.LatLng
import
com.cusc.map.map2d.cdata.WayPoi
import
com.cusc.map.map2d.cdata.WayPoi
import
com.cusc.map.map2d.mine.MineNai
import
com.cusc.map.map2d.mine.MineNai
import
com.cusc.map.ui.MapReadyView
import
com.cusc.map.ui.MapReadyView
...
@@ -39,9 +39,9 @@ object Navigate {
...
@@ -39,9 +39,9 @@ object Navigate {
fun
startNavi
(
fun
startNavi
(
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
nType
:
Int
,
nType
:
Int
,
starPoint
:
LatLng
M
,
starPoint
:
LatLng
,
startName
:
String
,
startName
:
String
,
endPoint
:
LatLng
M
,
endPoint
:
LatLng
,
endName
:
String
,
endName
:
String
,
ways
:
List
<
WayPoi
>,
ways
:
List
<
WayPoi
>,
onNaviPresenterListener
:
OnNaviPresenterListener
?
onNaviPresenterListener
:
OnNaviPresenterListener
?
...
@@ -83,7 +83,7 @@ object Navigate {
...
@@ -83,7 +83,7 @@ object Navigate {
fun
startSimNavi
(
fun
startSimNavi
(
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
starPoint
:
LatLng
M
,
starPoint
:
LatLng
,
driverRouteBean
:
DriverRouteBean
?,
driverRouteBean
:
DriverRouteBean
?,
onNaviPresenterListener
:
OnNaviPresenterListener
?
onNaviPresenterListener
:
OnNaviPresenterListener
?
)
{
)
{
...
...
mapapi/src/main/java/com/cusc/map/map2d/PathPlanning.kt
View file @
ea79dc91
package
com.cusc.map.map2d
package
com.cusc.map.map2d
import
com.cusc.map.map2d.amap.AmapRoutePlans
import
com.cusc.map.map2d.amap.AmapRoutePlans
import
com.cusc.map.map2d.cdata.LatLng
M
import
com.cusc.map.map2d.cdata.LatLng
import
com.cusc.map.map2d.cdata.WayPoi
import
com.cusc.map.map2d.cdata.WayPoi
import
com.cusc.map.map2d.inters.OnDriveRoute
import
com.cusc.map.map2d.inters.OnDriveRoute
import
com.cusc.map.map2d.mine.MineRoutePlans
import
com.cusc.map.map2d.mine.MineRoutePlans
...
@@ -20,9 +20,9 @@ object PathPlanning : MsOperationParent() {
...
@@ -20,9 +20,9 @@ object PathPlanning : MsOperationParent() {
* @param onDriveRoute 路径规划结果回调
* @param onDriveRoute 路径规划结果回调
*/
*/
fun
drivingPathPlanning
(
fun
drivingPathPlanning
(
starPoint
:
LatLng
M
,
starPoint
:
LatLng
,
startName
:
String
=
"当前位置"
,
startName
:
String
=
"当前位置"
,
endPoint
:
LatLng
M
,
endPoint
:
LatLng
,
endName
:
String
=
""
,
endName
:
String
=
""
,
ways
:
List
<
WayPoi
>,
ways
:
List
<
WayPoi
>,
onDriveRoute
:
OnDriveRoute
?
onDriveRoute
:
OnDriveRoute
?
...
...
mapapi/src/main/java/com/cusc/map/map2d/PoiSearch.kt
View file @
ea79dc91
package
com.cusc.map.map2d
package
com.cusc.map.map2d
import
com.cusc.map.map2d.amap.AmapPoiSearch
import
com.cusc.map.map2d.amap.AmapPoiSearch
import
com.cusc.map.map2d.inters.On
MS
PoiSearchLis
import
com.cusc.map.map2d.inters.OnPoiSearchLis
import
com.cusc.map.map2d.mine.MinePoiSearch
import
com.cusc.map.map2d.mine.MinePoiSearch
/**
/**
...
@@ -21,7 +21,7 @@ object PoiSearch {
...
@@ -21,7 +21,7 @@ object PoiSearch {
lat
:
Double
,
lat
:
Double
,
lng
:
Double
,
lng
:
Double
,
adCode
:
String
,
adCode
:
String
,
onMSPoiSearchLis
:
On
MS
PoiSearchLis
onMSPoiSearchLis
:
OnPoiSearchLis
){
){
when
(
MapSdkInit
.
getMapType
())
{
when
(
MapSdkInit
.
getMapType
())
{
MAP_TYPE
.
MINE
->
{
MAP_TYPE
.
MINE
->
{
...
@@ -47,7 +47,7 @@ object PoiSearch {
...
@@ -47,7 +47,7 @@ object PoiSearch {
lat
:
Double
,
lat
:
Double
,
lng
:
Double
,
lng
:
Double
,
radios
:
Int
,
radios
:
Int
,
onMSPoiSearchLis
:
On
MS
PoiSearchLis
onMSPoiSearchLis
:
OnPoiSearchLis
){
){
when
(
MapSdkInit
.
getMapType
())
{
when
(
MapSdkInit
.
getMapType
())
{
MAP_TYPE
.
MINE
->
{
MAP_TYPE
.
MINE
->
{
...
...
mapapi/src/main/java/com/cusc/map/map2d/amap/AmapDrawInMap.kt
View file @
ea79dc91
...
@@ -3,20 +3,18 @@ package com.cusc.map.map2d.amap
...
@@ -3,20 +3,18 @@ package com.cusc.map.map2d.amap
import
android.graphics.BitmapFactory
import
android.graphics.BitmapFactory
import
androidx.core.graphics.toColorInt
import
androidx.core.graphics.toColorInt
import
com.amap.api.maps.model.BitmapDescriptorFactory
import
com.amap.api.maps.model.BitmapDescriptorFactory
import
com.amap.api.maps.model.CircleOptions
import
com.amap.api.maps.model.CircleOptions
as
ACircleOptions
import
com.amap.api.maps.model.LatLng
import
com.amap.api.maps.model.LatLng
as
ALatLng
import
com.amap.api.maps.model.MarkerOptions
import
com.amap.api.maps.model.MarkerOptions
import
com.amap.api.maps.model.PolygonOptions
as
APolygonOptions
import
com.amap.api.maps.model.PolygonOptions
as
APolygonOptions
import
com.amap.api.maps.model.PolylineOptions
as
APolylineOptions
import
com.amap.api.maps.model.PolylineOptions
as
APolylineOptions
import
com.cusc.map.R
import
com.cusc.map.R
import
com.cusc.map.map2d.UserCtx
import
com.cusc.map.map2d.UserCtx
import
com.cusc.map.map2d.CircleOptionsM
import
com.cusc.map.map2d.CircleOptions
import
com.cusc.map.map2d.PolygonOptions
import
com.cusc.map.map2d.cdata.LatLng
import
com.cusc.map.map2d.PolylineOptions
import
com.cusc.map.map2d.cdata.LatLngM
import
com.cusc.map.ui.MapReadyView
import
com.cusc.map.ui.MapReadyView
import
com.cusc.map.map2d.cdata.MapOverlay
import
com.cusc.map.map2d.cdata.MapOverlay
import
com.cusc.map.map2d.cdata.Marker
M
import
com.cusc.map.map2d.cdata.Marker
/**
/**
* 在地图上绘制
* 在地图上绘制
...
@@ -35,11 +33,11 @@ object AmapDrawInMap {
...
@@ -35,11 +33,11 @@ object AmapDrawInMap {
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
lat
:
Double
,
lat
:
Double
,
lng
:
Double
lng
:
Double
):
Marker
M
{
):
Marker
{
var
context
=
UserCtx
.
Companion
.
instance
.
mContext
var
context
=
UserCtx
.
Companion
.
instance
.
mContext
// 处理高德地图类型的标记点绘制
// 处理高德地图类型的标记点绘制
val
aLatLng
=
LatLng
(
lat
,
lng
)
val
aLatLng
=
A
LatLng
(
lat
,
lng
)
val
aMarkerOption
=
MarkerOptions
().
apply
{
val
aMarkerOption
=
MarkerOptions
().
apply
{
position
(
aLatLng
)
position
(
aLatLng
)
icon
(
icon
(
...
@@ -50,8 +48,8 @@ object AmapDrawInMap {
...
@@ -50,8 +48,8 @@ object AmapDrawInMap {
)
)
}
}
var
aMaker
=
mapReadView
?.
aMap
?.
addMarker
(
aMarkerOption
)
var
aMaker
=
mapReadView
?.
aMap
?.
addMarker
(
aMarkerOption
)
Marker
M
.
amaker
=
aMaker
Marker
.
amaker
=
aMaker
return
Marker
M
return
Marker
}
}
...
@@ -64,12 +62,12 @@ object AmapDrawInMap {
...
@@ -64,12 +62,12 @@ object AmapDrawInMap {
*/
*/
fun
drawPolyline
(
fun
drawPolyline
(
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
LatLng
M
>,
msLatLng
:
List
<
com.cusc.map.map2d.cdata.
LatLng
>,
msPolylineOptions
:
com
.
cusc
.
map
.
map2d
.
PolylineOptions
msPolylineOptions
:
com
.
cusc
.
map
.
map2d
.
PolylineOptions
):
MapOverlay
{
):
MapOverlay
{
// 绘制高德地图的线
// 绘制高德地图的线
var
latLngs
=
msLatLng
.
map
{
var
latLngs
=
msLatLng
.
map
{
LatLng
(
it
.
lat
,
it
.
lng
)
A
LatLng
(
it
.
lat
,
it
.
lng
)
}
}
val
aOption
=
APolylineOptions
().
addAll
(
latLngs
)
val
aOption
=
APolylineOptions
().
addAll
(
latLngs
)
.
width
(
msPolylineOptions
.
width
)
.
width
(
msPolylineOptions
.
width
)
...
@@ -89,11 +87,11 @@ object AmapDrawInMap {
...
@@ -89,11 +87,11 @@ object AmapDrawInMap {
*/
*/
fun
drawCircle
(
fun
drawCircle
(
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
center
:
LatLng
M
,
center
:
com
.
cusc
.
map
.
map2d
.
cdata
.
LatLng
,
msCircleOptions
:
CircleOptions
M
?
msCircleOptions
:
com
.
cusc
.
map
.
map2d
.
CircleOptions
?
):
MapOverlay
{
):
MapOverlay
{
var
latLng
=
LatLng
(
center
.
lat
,
center
.
lng
)
var
latLng
=
A
LatLng
(
center
.
lat
,
center
.
lng
)
val
options
=
CircleOptions
()
val
options
=
A
CircleOptions
()
.
center
(
latLng
)
.
center
(
latLng
)
.
radius
(
msCircleOptions
?.
radius
?.
toDouble
()
?:
100.0
)
.
radius
(
msCircleOptions
?.
radius
?.
toDouble
()
?:
100.0
)
.
fillColor
(
msCircleOptions
?.
fillColor
?:
"#50FF0000"
.
toColorInt
())
.
fillColor
(
msCircleOptions
?.
fillColor
?:
"#50FF0000"
.
toColorInt
())
...
@@ -112,11 +110,11 @@ object AmapDrawInMap {
...
@@ -112,11 +110,11 @@ object AmapDrawInMap {
*/
*/
fun
drawPolygon
(
fun
drawPolygon
(
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
LatLng
M
>,
msLatLng
:
List
<
com.cusc.map.map2d.cdata.
LatLng
>,
msPolygonOptions
:
com
.
cusc
.
map
.
map2d
.
PolygonOptions
msPolygonOptions
:
com
.
cusc
.
map
.
map2d
.
PolygonOptions
):
MapOverlay
{
):
MapOverlay
{
var
latLngs
=
msLatLng
.
map
{
var
latLngs
=
msLatLng
.
map
{
LatLng
(
it
.
lat
,
it
.
lng
)
A
LatLng
(
it
.
lat
,
it
.
lng
)
}
}
val
aPolygonOptions
=
APolygonOptions
().
apply
{
val
aPolygonOptions
=
APolygonOptions
().
apply
{
addAll
(
latLngs
)
addAll
(
latLngs
)
...
...
mapapi/src/main/java/com/cusc/map/map2d/amap/AmapGpsLocation.kt
View file @
ea79dc91
...
@@ -93,7 +93,7 @@ class AmapGpsLocation {
...
@@ -93,7 +93,7 @@ class AmapGpsLocation {
accuracy
=
location
?.
accuracy
?:
0f
accuracy
=
location
?.
accuracy
?:
0f
altitude
=
location
?.
altitude
?:
0.0
altitude
=
location
?.
altitude
?:
0.0
}
}
onMsGpsLoc
?.
on
Ms
GpsLoc
(
loc
)
onMsGpsLoc
?.
onGpsLoc
(
loc
)
}
}
}
else
{
}
else
{
...
...
mapapi/src/main/java/com/cusc/map/map2d/amap/AmapNai.kt
View file @
ea79dc91
package
com.cusc.map.map2d.amap
package
com.cusc.map.map2d.amap
import
com.amap.api.maps.model.LatLng
import
com.amap.api.maps.model.LatLng
as
ALatLng
import
com.amap.api.maps.model.Poi
import
com.amap.api.maps.model.Poi
import
com.amap.api.navi.AmapNaviPage
import
com.amap.api.navi.AmapNaviPage
import
com.amap.api.navi.AmapNaviParams
import
com.amap.api.navi.AmapNaviParams
...
@@ -8,7 +8,7 @@ import com.amap.api.navi.AmapNaviType
...
@@ -8,7 +8,7 @@ import com.amap.api.navi.AmapNaviType
import
com.amap.api.navi.AmapPageType
import
com.amap.api.navi.AmapPageType
import
com.cusc.map.map2d.UserCtx
import
com.cusc.map.map2d.UserCtx
import
com.cusc.map.map2d.cdata.WayPoi
import
com.cusc.map.map2d.cdata.WayPoi
import
com.cusc.map.map2d.cdata.LatLng
M
import
com.cusc.map.map2d.cdata.LatLng
/**
/**
* 高德导航
* 高德导航
...
@@ -25,9 +25,9 @@ object AmapNai {
...
@@ -25,9 +25,9 @@ object AmapNai {
* @param ways
* @param ways
*/
*/
fun
startNavi
(
fun
startNavi
(
starPoint
:
LatLng
M
,
starPoint
:
com
.
cusc
.
map
.
map2d
.
cdata
.
LatLng
,
startName
:
String
,
startName
:
String
,
endPoint
:
LatLng
M
,
endPoint
:
com
.
cusc
.
map
.
map2d
.
cdata
.
LatLng
,
endName
:
String
,
endName
:
String
,
ways
:
List
<
WayPoi
>
ways
:
List
<
WayPoi
>
)
{
)
{
...
@@ -39,16 +39,16 @@ object AmapNai {
...
@@ -39,16 +39,16 @@ object AmapNai {
poiList
.
add
(
poiList
.
add
(
Poi
(
Poi
(
wpoi
.
passName
,
wpoi
.
passName
,
LatLng
(
wpoi
.
passPoint
!!
.
lat
,
wpoi
.
passPoint
!!
.
lng
),
A
LatLng
(
wpoi
.
passPoint
!!
.
lat
,
wpoi
.
passPoint
!!
.
lng
),
""
""
)
)
)
)
}
}
}
}
val
params
=
AmapNaviParams
(
val
params
=
AmapNaviParams
(
Poi
(
startName
,
LatLng
(
starPoint
.
lat
,
starPoint
.
lng
),
""
),
Poi
(
startName
,
A
LatLng
(
starPoint
.
lat
,
starPoint
.
lng
),
""
),
poiList
,
poiList
,
Poi
(
endName
,
LatLng
(
endPoint
.
lat
,
endPoint
.
lng
),
""
),
Poi
(
endName
,
A
LatLng
(
endPoint
.
lat
,
endPoint
.
lng
),
""
),
AmapNaviType
.
DRIVER
,
AmapPageType
.
NAVI
AmapNaviType
.
DRIVER
,
AmapPageType
.
NAVI
)
)
params
.
setUseInnerVoice
(
true
)
params
.
setUseInnerVoice
(
true
)
...
@@ -67,9 +67,9 @@ object AmapNai {
...
@@ -67,9 +67,9 @@ object AmapNai {
* @param ways
* @param ways
*/
*/
fun
startPlanNavi
(
fun
startPlanNavi
(
starPoint
:
LatLng
M
,
starPoint
:
com
.
cusc
.
map
.
map2d
.
cdata
.
LatLng
,
startName
:
String
,
startName
:
String
,
endPoint
:
LatLng
M
,
endPoint
:
com
.
cusc
.
map
.
map2d
.
cdata
.
LatLng
,
endName
:
String
,
endName
:
String
,
ways
:
List
<
WayPoi
>
ways
:
List
<
WayPoi
>
)
{
)
{
...
@@ -81,16 +81,16 @@ object AmapNai {
...
@@ -81,16 +81,16 @@ object AmapNai {
poiList
.
add
(
poiList
.
add
(
Poi
(
Poi
(
wpoi
.
passName
,
wpoi
.
passName
,
LatLng
(
wpoi
.
passPoint
!!
.
lat
,
wpoi
.
passPoint
!!
.
lng
),
A
LatLng
(
wpoi
.
passPoint
!!
.
lat
,
wpoi
.
passPoint
!!
.
lng
),
""
""
)
)
)
)
}
}
}
}
val
params
=
AmapNaviParams
(
val
params
=
AmapNaviParams
(
Poi
(
startName
,
LatLng
(
starPoint
.
lat
,
starPoint
.
lng
),
""
),
Poi
(
startName
,
A
LatLng
(
starPoint
.
lat
,
starPoint
.
lng
),
""
),
poiList
,
poiList
,
Poi
(
endName
,
LatLng
(
endPoint
.
lat
,
endPoint
.
lng
),
""
),
Poi
(
endName
,
A
LatLng
(
endPoint
.
lat
,
endPoint
.
lng
),
""
),
AmapNaviType
.
DRIVER
,
AmapPageType
.
ROUTE
AmapNaviType
.
DRIVER
,
AmapPageType
.
ROUTE
)
)
params
.
setUseInnerVoice
(
true
)
params
.
setUseInnerVoice
(
true
)
...
...
mapapi/src/main/java/com/cusc/map/map2d/amap/AmapPoiSearch.kt
View file @
ea79dc91
...
@@ -7,7 +7,7 @@ import com.amap.api.services.poisearch.PoiResult
...
@@ -7,7 +7,7 @@ import com.amap.api.services.poisearch.PoiResult
import
com.amap.api.services.poisearch.PoiSearch
import
com.amap.api.services.poisearch.PoiSearch
import
com.cusc.map.map2d.UserCtx
import
com.cusc.map.map2d.UserCtx
import
com.cusc.map.map2d.cdata.PoiSearchRes
import
com.cusc.map.map2d.cdata.PoiSearchRes
import
com.cusc.map.map2d.inters.On
MS
PoiSearchLis
import
com.cusc.map.map2d.inters.OnPoiSearchLis
/**
/**
* 高配的Poi 搜索相关
* 高配的Poi 搜索相关
...
@@ -15,7 +15,7 @@ import com.cusc.map.map2d.inters.OnMSPoiSearchLis
...
@@ -15,7 +15,7 @@ import com.cusc.map.map2d.inters.OnMSPoiSearchLis
object
AmapPoiSearch
:
PoiSearch
.
OnPoiSearchListener
{
object
AmapPoiSearch
:
PoiSearch
.
OnPoiSearchListener
{
private
var
onMSPoiSearchLis
:
On
MS
PoiSearchLis
?
=
null
private
var
onMSPoiSearchLis
:
OnPoiSearchLis
?
=
null
/**关键字搜索
/**关键字搜索
...
@@ -28,7 +28,7 @@ object AmapPoiSearch : PoiSearch.OnPoiSearchListener {
...
@@ -28,7 +28,7 @@ object AmapPoiSearch : PoiSearch.OnPoiSearchListener {
keyWord
:
String
,
keyWord
:
String
,
lat
:
Double
=
41.80196
,
lat
:
Double
=
41.80196
,
lng
:
Double
=
123.43326
,
lng
:
Double
=
123.43326
,
onMSPoiSearchLis
:
On
MS
PoiSearchLis
onMSPoiSearchLis
:
OnPoiSearchLis
)
{
)
{
this
.
onMSPoiSearchLis
=
onMSPoiSearchLis
this
.
onMSPoiSearchLis
=
onMSPoiSearchLis
var
context
=
UserCtx
.
Companion
.
instance
.
mContext
var
context
=
UserCtx
.
Companion
.
instance
.
mContext
...
@@ -59,7 +59,7 @@ object AmapPoiSearch : PoiSearch.OnPoiSearchListener {
...
@@ -59,7 +59,7 @@ object AmapPoiSearch : PoiSearch.OnPoiSearchListener {
lat
:
Double
,
lat
:
Double
,
lng
:
Double
,
lng
:
Double
,
radios
:
Int
,
radios
:
Int
,
onMSPoiSearchLis
:
On
MS
PoiSearchLis
onMSPoiSearchLis
:
OnPoiSearchLis
)
{
)
{
this
.
onMSPoiSearchLis
=
onMSPoiSearchLis
this
.
onMSPoiSearchLis
=
onMSPoiSearchLis
var
context
=
UserCtx
.
Companion
.
instance
.
mContext
var
context
=
UserCtx
.
Companion
.
instance
.
mContext
...
...
mapapi/src/main/java/com/cusc/map/map2d/amap/AmapRoutePlans.kt
View file @
ea79dc91
package
com.cusc.map.map2d.amap
package
com.cusc.map.map2d.amap
import
com.amap.api.maps.CameraUpdateFactory
import
com.amap.api.maps.CameraUpdateFactory
import
com.amap.api.maps.model.LatLng
import
com.amap.api.maps.model.LatLng
as
ALatLng
import
com.amap.api.maps.model.Poi
import
com.amap.api.maps.model.Poi
import
com.amap.api.navi.AMapNavi
import
com.amap.api.navi.AMapNavi
import
com.amap.api.navi.model.AMapCalcRouteResult
import
com.amap.api.navi.model.AMapCalcRouteResult
...
@@ -12,7 +12,7 @@ import com.cusc.map.map2d.UserCtx
...
@@ -12,7 +12,7 @@ import com.cusc.map.map2d.UserCtx
import
com.cusc.map.map2d.cdata.DriverRouteBean
import
com.cusc.map.map2d.cdata.DriverRouteBean
import
com.cusc.map.map2d.cdata.WayPoi
import
com.cusc.map.map2d.cdata.WayPoi
import
com.cusc.map.map2d.inters.MyAMapNaviListener
import
com.cusc.map.map2d.inters.MyAMapNaviListener
import
com.cusc.map.map2d.cdata.LatLng
M
import
com.cusc.map.map2d.cdata.LatLng
import
com.cusc.map.map2d.inters.OnDriveRoute
import
com.cusc.map.map2d.inters.OnDriveRoute
import
com.cusc.map.ui.MapReadyView
import
com.cusc.map.ui.MapReadyView
...
@@ -47,9 +47,9 @@ class AmapRoutePlans {
...
@@ -47,9 +47,9 @@ class AmapRoutePlans {
* @param mapReadView 地图对象
* @param mapReadView 地图对象
*/
*/
fun
drivingPathPlanning
(
fun
drivingPathPlanning
(
starPoint
:
LatLng
M
,
starPoint
:
com
.
cusc
.
map
.
map2d
.
cdata
.
LatLng
,
startName
:
String
=
"当前位置"
,
startName
:
String
=
"当前位置"
,
endPoint
:
LatLng
M
,
endPoint
:
com
.
cusc
.
map
.
map2d
.
cdata
.
LatLng
,
endName
:
String
=
""
,
endName
:
String
=
""
,
ways
:
List
<
WayPoi
>,
ways
:
List
<
WayPoi
>,
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
...
@@ -70,7 +70,7 @@ class AmapRoutePlans {
...
@@ -70,7 +70,7 @@ class AmapRoutePlans {
poiList
.
add
(
poiList
.
add
(
Poi
(
Poi
(
wpoi
.
passName
,
wpoi
.
passName
,
LatLng
(
wpoi
.
passPoint
!!
.
lat
,
wpoi
.
passPoint
!!
.
lng
),
A
LatLng
(
wpoi
.
passPoint
!!
.
lat
,
wpoi
.
passPoint
!!
.
lng
),
""
""
)
)
)
)
...
...
mapapi/src/main/java/com/cusc/map/map2d/cdata/LatLng
M
.kt
→
mapapi/src/main/java/com/cusc/map/map2d/cdata/LatLng.kt
View file @
ea79dc91
...
@@ -3,9 +3,9 @@ package com.cusc.map.map2d.cdata
...
@@ -3,9 +3,9 @@ package com.cusc.map.map2d.cdata
import
android.os.Parcelable
import
android.os.Parcelable
import
kotlinx.parcelize.Parcelize
import
kotlinx.parcelize.Parcelize
/**
经
纬度*/
/**纬度
,经
*/
@Parcelize
@Parcelize
data class
LatLng
M
data class
LatLng
(
(
var
lat
:
Double
=
0.0
,
var
lat
:
Double
=
0.0
,
var
lng
:
Double
=
0.0
var
lng
:
Double
=
0.0
...
...
mapapi/src/main/java/com/cusc/map/map2d/cdata/Marker
M
.kt
→
mapapi/src/main/java/com/cusc/map/map2d/cdata/Marker.kt
View file @
ea79dc91
...
@@ -4,7 +4,7 @@ import com.minedata.minenavi.map.Marker
...
@@ -4,7 +4,7 @@ import com.minedata.minenavi.map.Marker
import
com.amap.api.maps.model.Marker
as
AMarker
import
com.amap.api.maps.model.Marker
as
AMarker
/**返回的mark*/
/**返回的mark*/
object
Marker
M
{
object
Marker
{
/**四维mark*/
/**四维mark*/
var
maker
:
Marker
?
=
null
var
maker
:
Marker
?
=
null
...
...
mapapi/src/main/java/com/cusc/map/map2d/cdata/WayPoi.kt
View file @
ea79dc91
...
@@ -7,7 +7,7 @@ import kotlinx.parcelize.Parcelize
...
@@ -7,7 +7,7 @@ import kotlinx.parcelize.Parcelize
@Parcelize
@Parcelize
data class
WayPoi
(
data class
WayPoi
(
/**途经点名坐标*/
/**途经点名坐标*/
var
passPoint
:
LatLng
M
,
var
passPoint
:
LatLng
,
/**经点名字*/
/**经点名字*/
var
passName
:
String
var
passName
:
String
)
:
Parcelable
)
:
Parcelable
...
...
mapapi/src/main/java/com/cusc/map/map2d/inters/On
MS
PoiSearchLis.kt
→
mapapi/src/main/java/com/cusc/map/map2d/inters/OnPoiSearchLis.kt
View file @
ea79dc91
...
@@ -5,7 +5,7 @@ import com.cusc.map.map2d.cdata.PoiSearchRes
...
@@ -5,7 +5,7 @@ import com.cusc.map.map2d.cdata.PoiSearchRes
/**
/**
* POI搜素回调
* POI搜素回调
*/
*/
interface
On
MS
PoiSearchLis
{
interface
OnPoiSearchLis
{
/**
/**
* 搜索返回
* 搜索返回
* @param poiList 返回列表
* @param poiList 返回列表
...
...
mapapi/src/main/java/com/cusc/map/map2d/mine/MineDrawInMap.kt
View file @
ea79dc91
...
@@ -2,18 +2,16 @@ package com.cusc.map.map2d.mine
...
@@ -2,18 +2,16 @@ package com.cusc.map.map2d.mine
import
android.graphics.BitmapFactory
import
android.graphics.BitmapFactory
import
androidx.core.graphics.toColorInt
import
androidx.core.graphics.toColorInt
import
com.minedata.minenavi.map.CircleOptions
import
com.minedata.minenavi.map.CircleOptions
as
FCircleOptions
import
com.minedata.minenavi.map.MarkerOptions
import
com.minedata.minenavi.map.MarkerOptions
import
com.minedata.minenavi.map.PolygonOptions
as
M
PolygonOptions
import
com.minedata.minenavi.map.PolygonOptions
as
F
PolygonOptions
import
com.minedata.minenavi.map.PolylineOptions
as
M
PolylineOptions
import
com.minedata.minenavi.map.PolylineOptions
as
F
PolylineOptions
import
com.minedata.minenavi.mapdal.LatLng
import
com.minedata.minenavi.mapdal.LatLng
as
FLatLng
import
com.cusc.map.R
import
com.cusc.map.R
import
com.cusc.map.map2d.UserCtx
import
com.cusc.map.map2d.UserCtx
import
com.cusc.map.map2d.CircleOptionsM
import
com.cusc.map.map2d.CircleOptions
import
com.cusc.map.map2d.PolygonOptions
import
com.cusc.map.map2d.cdata.LatLng
import
com.cusc.map.map2d.PolylineOptions
import
com.cusc.map.map2d.cdata.Marker
import
com.cusc.map.map2d.cdata.LatLngM
import
com.cusc.map.map2d.cdata.MarkerM
import
com.cusc.map.map2d.cdata.MapOverlay
import
com.cusc.map.map2d.cdata.MapOverlay
import
com.cusc.map.ui.MapReadyView
import
com.cusc.map.ui.MapReadyView
...
@@ -34,18 +32,18 @@ internal object MineDrawInMap {
...
@@ -34,18 +32,18 @@ internal object MineDrawInMap {
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
lat
:
Double
,
lat
:
Double
,
lng
:
Double
lng
:
Double
):
Marker
M
{
):
Marker
{
var
context
=
UserCtx
.
Companion
.
instance
.
mContext
var
context
=
UserCtx
.
Companion
.
instance
.
mContext
// 根据不同的地图类型绘制标记点
// 根据不同的地图类型绘制标记点
val
icon
=
BitmapFactory
.
decodeResource
(
context
?.
resources
,
R
.
drawable
.
market_loc
)
val
icon
=
BitmapFactory
.
decodeResource
(
context
?.
resources
,
R
.
drawable
.
market_loc
)
val
latLng
=
LatLng
(
lat
,
lng
)
val
latLng
=
F
LatLng
(
lat
,
lng
)
var
options
=
MarkerOptions
()
var
options
=
MarkerOptions
()
.
bitmap
(
icon
)
.
bitmap
(
icon
)
// 位置坐标
// 位置坐标
.
position
(
latLng
)
.
position
(
latLng
)
var
maker
=
mapReadView
?.
mMineMap
?.
addMarker
(
options
)
var
maker
=
mapReadView
?.
mMineMap
?.
addMarker
(
options
)
Marker
M
.
maker
=
maker
Marker
.
maker
=
maker
return
Marker
M
return
Marker
}
}
...
@@ -57,14 +55,14 @@ internal object MineDrawInMap {
...
@@ -57,14 +55,14 @@ internal object MineDrawInMap {
*/
*/
fun
drawPolyline
(
fun
drawPolyline
(
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
LatLng
M
>,
msLatLng
:
List
<
com.cusc.map.map2d.cdata.
LatLng
>,
msPolylineOptions
:
com
.
cusc
.
map
.
map2d
.
PolylineOptions
msPolylineOptions
:
com
.
cusc
.
map
.
map2d
.
PolylineOptions
):
MapOverlay
{
):
MapOverlay
{
// 绘制自定义地图的线
// 绘制自定义地图的线
var
latLngs
=
msLatLng
.
map
{
var
latLngs
=
msLatLng
.
map
{
LatLng
(
it
.
lat
,
it
.
lng
)
F
LatLng
(
it
.
lat
,
it
.
lng
)
}
}
var
options
=
M
PolylineOptions
()
var
options
=
F
PolylineOptions
()
// 添加顶点坐标
// 添加顶点坐标
.
addAll
(
latLngs
)
.
addAll
(
latLngs
)
.
width
(
msPolylineOptions
.
width
)
.
width
(
msPolylineOptions
.
width
)
...
@@ -85,12 +83,12 @@ internal object MineDrawInMap {
...
@@ -85,12 +83,12 @@ internal object MineDrawInMap {
*/
*/
fun
drawCircle
(
fun
drawCircle
(
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
center
:
LatLng
M
,
center
:
LatLng
,
msCircleOptions
:
CircleOptions
M
?
msCircleOptions
:
CircleOptions
?
):
MapOverlay
{
):
MapOverlay
{
// 根据地图类型绘制不同类型的圆形
// 根据地图类型绘制不同类型的圆形
var
latLng
=
LatLng
(
center
.
lat
,
center
.
lng
)
var
latLng
=
F
LatLng
(
center
.
lat
,
center
.
lng
)
val
options
=
CircleOptions
()
val
options
=
F
CircleOptions
()
.
center
(
latLng
)
.
center
(
latLng
)
.
radius
(
msCircleOptions
?.
radius
?:
100f
)
.
radius
(
msCircleOptions
?.
radius
?:
100f
)
.
fillColor
(
msCircleOptions
?.
fillColor
?:
"#50FF0000"
.
toColorInt
())
.
fillColor
(
msCircleOptions
?.
fillColor
?:
"#50FF0000"
.
toColorInt
())
...
@@ -109,14 +107,14 @@ internal object MineDrawInMap {
...
@@ -109,14 +107,14 @@ internal object MineDrawInMap {
*/
*/
fun
drawPolygon
(
fun
drawPolygon
(
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
LatLng
M
>,
msLatLng
:
List
<
com.cusc.map.map2d.cdata.
LatLng
>,
msPolygonOptions
:
com
.
cusc
.
map
.
map2d
.
PolygonOptions
msPolygonOptions
:
com
.
cusc
.
map
.
map2d
.
PolygonOptions
):
MapOverlay
{
):
MapOverlay
{
var
latLngs
=
msLatLng
.
map
{
var
latLngs
=
msLatLng
.
map
{
LatLng
(
it
.
lat
,
it
.
lng
)
F
LatLng
(
it
.
lat
,
it
.
lng
)
}
}
// 声明 多边形参数对象
// 声明 多边形参数对象
val
polygonOptions
=
M
PolygonOptions
().
apply
{
val
polygonOptions
=
F
PolygonOptions
().
apply
{
addAll
(
latLngs
)
addAll
(
latLngs
)
fillColor
(
msPolygonOptions
.
fillColor
)
fillColor
(
msPolygonOptions
.
fillColor
)
strokeWidth
(
msPolygonOptions
.
strokeWidth
)
strokeWidth
(
msPolygonOptions
.
strokeWidth
)
...
...
mapapi/src/main/java/com/cusc/map/map2d/mine/MineNai.kt
View file @
ea79dc91
...
@@ -7,7 +7,7 @@ import com.minedata.minenavi.map.Model
...
@@ -7,7 +7,7 @@ import com.minedata.minenavi.map.Model
import
com.minedata.minenavi.map.ModelOptions
import
com.minedata.minenavi.map.ModelOptions
import
com.minedata.minenavi.map.Overlay
import
com.minedata.minenavi.map.Overlay
import
com.minedata.minenavi.mapdal.DataPreference
import
com.minedata.minenavi.mapdal.DataPreference
import
com.minedata.minenavi.mapdal.LatLng
import
com.minedata.minenavi.mapdal.LatLng
as
FLatLng
import
com.minedata.minenavi.navi.GuidanceText
import
com.minedata.minenavi.navi.GuidanceText
import
com.minedata.minenavi.navi.NaviProgressData
import
com.minedata.minenavi.navi.NaviProgressData
import
com.minedata.minenavi.navi.NaviSession
import
com.minedata.minenavi.navi.NaviSession
...
@@ -23,7 +23,7 @@ import com.cusc.map.map2d.UserCtx
...
@@ -23,7 +23,7 @@ import com.cusc.map.map2d.UserCtx
import
com.cusc.map.map2d.cdata.WayPoi
import
com.cusc.map.map2d.cdata.WayPoi
import
com.cusc.map.map2d.inters.MyMineNaviListener
import
com.cusc.map.map2d.inters.MyMineNaviListener
import
com.cusc.map.map2d.inters.OnNaviPresenterListener
import
com.cusc.map.map2d.inters.OnNaviPresenterListener
import
com.cusc.map.map2d.cdata.LatLng
M
import
com.cusc.map.map2d.cdata.LatLng
import
com.cusc.map.ui.MapReadyView
import
com.cusc.map.ui.MapReadyView
import
com.cusc.map.ui.MineNaiDirActivity
import
com.cusc.map.ui.MineNaiDirActivity
...
@@ -77,14 +77,14 @@ object MineNai {
...
@@ -77,14 +77,14 @@ object MineNai {
fun
startSimNavi
(
fun
startSimNavi
(
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
starPoint
:
LatLng
M
,
starPoint
:
com
.
cusc
.
map
.
map2d
.
cdata
.
LatLng
,
routeBase
:
RouteBase
?,
routeBase
:
RouteBase
?,
onNaviPresenterListener
:
OnNaviPresenterListener
?
onNaviPresenterListener
:
OnNaviPresenterListener
?
)
{
)
{
if
(
routeBase
!=
null
)
{
if
(
routeBase
!=
null
)
{
addNaviListener
(
onNaviPresenterListener
)
addNaviListener
(
onNaviPresenterListener
)
mMineMap
=
mapReadView
?.
mMineMap
mMineMap
=
mapReadView
?.
mMineMap
val
point
=
Tools
.
latLngToPoint
(
LatLng
(
starPoint
.
lat
,
starPoint
.
lng
))
val
point
=
Tools
.
latLngToPoint
(
F
LatLng
(
starPoint
.
lat
,
starPoint
.
lng
))
drawNavingCar
(
point
)
drawNavingCar
(
point
)
NaviSpeaker
.
stop
()
NaviSpeaker
.
stop
()
mNaviSession
?.
takeRouteQuietly
(
routeBase
)
mNaviSession
?.
takeRouteQuietly
(
routeBase
)
...
@@ -99,9 +99,9 @@ object MineNai {
...
@@ -99,9 +99,9 @@ object MineNai {
* 直接跳转页面开启导航
* 直接跳转页面开启导航
*/
*/
fun
startNaviDirect
(
fun
startNaviDirect
(
starPoint
:
LatLng
M
,
starPoint
:
com
.
cusc
.
map
.
map2d
.
cdata
.
LatLng
,
startName
:
String
=
"当前位置"
,
startName
:
String
=
"当前位置"
,
endPoint
:
LatLng
M
,
endPoint
:
com
.
cusc
.
map
.
map2d
.
cdata
.
LatLng
,
endName
:
String
=
""
,
endName
:
String
=
""
,
ways
:
List
<
WayPoi
>
ways
:
List
<
WayPoi
>
)
{
)
{
...
@@ -119,7 +119,7 @@ object MineNai {
...
@@ -119,7 +119,7 @@ object MineNai {
*/
*/
fun
startNaviFormRouteBase
(
fun
startNaviFormRouteBase
(
routeBase
:
RouteBase
?,
routeBase
:
RouteBase
?,
mStartPoint
:
LatLng
M
,
mStartPoint
:
LatLng
,
mapReadView
:
MapReadyView
?
mapReadView
:
MapReadyView
?
)
{
)
{
// mMineMap = mapReadView?.mMineMap
// mMineMap = mapReadView?.mMineMap
...
@@ -128,7 +128,7 @@ object MineNai {
...
@@ -128,7 +128,7 @@ object MineNai {
mMineMap
=
mapReadView
?.
mMineMap
mMineMap
=
mapReadView
?.
mMineMap
// mNaviSession?.removeMineNaviListeners()
// mNaviSession?.removeMineNaviListeners()
// mNaviSession?.addMineNaviListener(myMineNaviListener)
// mNaviSession?.addMineNaviListener(myMineNaviListener)
val
starPoint
=
Tools
.
latLngToPoint
(
LatLng
(
mStartPoint
.
lat
,
mStartPoint
.
lng
))
val
starPoint
=
Tools
.
latLngToPoint
(
F
LatLng
(
mStartPoint
.
lat
,
mStartPoint
.
lng
))
drawNavingCar
(
starPoint
)
drawNavingCar
(
starPoint
)
mNaviSession
?.
takeRoute
(
routeBase
)
mNaviSession
?.
takeRoute
(
routeBase
)
}
}
...
...
mapapi/src/main/java/com/cusc/map/map2d/mine/MineNaiParams.kt
View file @
ea79dc91
...
@@ -2,7 +2,7 @@ package com.cusc.map.map2d.mine
...
@@ -2,7 +2,7 @@ package com.cusc.map.map2d.mine
import
android.os.Parcelable
import
android.os.Parcelable
import
com.cusc.map.map2d.cdata.WayPoi
import
com.cusc.map.map2d.cdata.WayPoi
import
com.cusc.map.map2d.cdata.LatLng
M
import
com.cusc.map.map2d.cdata.LatLng
import
kotlinx.parcelize.Parcelize
import
kotlinx.parcelize.Parcelize
/**
/**
...
@@ -10,9 +10,9 @@ import kotlinx.parcelize.Parcelize
...
@@ -10,9 +10,9 @@ import kotlinx.parcelize.Parcelize
*/
*/
@Parcelize
@Parcelize
data class
MineNaiParams
(
data class
MineNaiParams
(
val
starPoint
:
LatLng
M
,
val
starPoint
:
LatLng
,
val
startName
:
String
,
val
startName
:
String
,
val
endPoint
:
LatLng
M
,
val
endPoint
:
LatLng
,
val
endName
:
String
,
val
endName
:
String
,
val
ways
:
List
<
WayPoi
>
val
ways
:
List
<
WayPoi
>
)
:
Parcelable
)
:
Parcelable
\ No newline at end of file
mapapi/src/main/java/com/cusc/map/map2d/mine/MinePoiSearch.kt
View file @
ea79dc91
...
@@ -8,7 +8,7 @@ import com.minedata.minenavi.poiquery.SearchErrorCode
...
@@ -8,7 +8,7 @@ import com.minedata.minenavi.poiquery.SearchErrorCode
import
com.minedata.minenavi.poiquery.SortType
import
com.minedata.minenavi.poiquery.SortType
import
com.cusc.map.map2d.UserCtx
import
com.cusc.map.map2d.UserCtx
import
com.cusc.map.map2d.cdata.PoiSearchRes
import
com.cusc.map.map2d.cdata.PoiSearchRes
import
com.cusc.map.map2d.inters.On
MS
PoiSearchLis
import
com.cusc.map.map2d.inters.OnPoiSearchLis
/**
/**
* 四维Poi搜索相关
* 四维Poi搜索相关
...
@@ -16,7 +16,7 @@ import com.cusc.map.map2d.inters.OnMSPoiSearchLis
...
@@ -16,7 +16,7 @@ import com.cusc.map.map2d.inters.OnMSPoiSearchLis
object
MinePoiSearch
:
PoiSearch
.
OnPoiSearchListener
{
object
MinePoiSearch
:
PoiSearch
.
OnPoiSearchListener
{
private
var
onMSPoiSearchLis
:
On
MS
PoiSearchLis
?
=
null
private
var
onMSPoiSearchLis
:
OnPoiSearchLis
?
=
null
/**关键字搜索
/**关键字搜索
...
@@ -30,7 +30,7 @@ object MinePoiSearch : PoiSearch.OnPoiSearchListener {
...
@@ -30,7 +30,7 @@ object MinePoiSearch : PoiSearch.OnPoiSearchListener {
lat
:
Double
=
41.80196
,
lat
:
Double
=
41.80196
,
lng
:
Double
=
123.43326
,
lng
:
Double
=
123.43326
,
adCode
:
String
,
adCode
:
String
,
onMSPoiSearchLis
:
On
MS
PoiSearchLis
onMSPoiSearchLis
:
OnPoiSearchLis
)
{
)
{
this
.
onMSPoiSearchLis
=
onMSPoiSearchLis
this
.
onMSPoiSearchLis
=
onMSPoiSearchLis
var
context
=
UserCtx
.
Companion
.
instance
.
mContext
var
context
=
UserCtx
.
Companion
.
instance
.
mContext
...
@@ -65,7 +65,7 @@ object MinePoiSearch : PoiSearch.OnPoiSearchListener {
...
@@ -65,7 +65,7 @@ object MinePoiSearch : PoiSearch.OnPoiSearchListener {
lat
:
Double
,
lat
:
Double
,
lng
:
Double
,
lng
:
Double
,
radios
:
Int
,
radios
:
Int
,
onMSPoiSearchLis
:
On
MS
PoiSearchLis
onMSPoiSearchLis
:
OnPoiSearchLis
)
{
)
{
this
.
onMSPoiSearchLis
=
onMSPoiSearchLis
this
.
onMSPoiSearchLis
=
onMSPoiSearchLis
var
context
=
UserCtx
.
Companion
.
instance
.
mContext
var
context
=
UserCtx
.
Companion
.
instance
.
mContext
...
...
mapapi/src/main/java/com/cusc/map/map2d/mine/MineRoutePlans.kt
View file @
ea79dc91
...
@@ -5,7 +5,7 @@ import android.graphics.Rect
...
@@ -5,7 +5,7 @@ import android.graphics.Rect
import
com.minedata.minenavi.map.Route
import
com.minedata.minenavi.map.Route
import
com.minedata.minenavi.map.RouteOptions
import
com.minedata.minenavi.map.RouteOptions
import
com.minedata.minenavi.mapdal.DataPreference
import
com.minedata.minenavi.mapdal.DataPreference
import
com.minedata.minenavi.mapdal.LatLng
import
com.minedata.minenavi.mapdal.LatLng
as
FLatLng
import
com.minedata.minenavi.mapdal.PoiFavorite
import
com.minedata.minenavi.mapdal.PoiFavorite
import
com.minedata.minenavi.navi.NaviSession
import
com.minedata.minenavi.navi.NaviSession
import
com.minedata.minenavi.navi.RouteBase
import
com.minedata.minenavi.navi.RouteBase
...
@@ -16,7 +16,7 @@ import com.minedata.minenavi.util.Tools
...
@@ -16,7 +16,7 @@ import com.minedata.minenavi.util.Tools
import
com.cusc.map.map2d.cdata.DriverRouteBean
import
com.cusc.map.map2d.cdata.DriverRouteBean
import
com.cusc.map.map2d.cdata.WayPoi
import
com.cusc.map.map2d.cdata.WayPoi
import
com.cusc.map.map2d.inters.MyMineNaviListener
import
com.cusc.map.map2d.inters.MyMineNaviListener
import
com.cusc.map.map2d.cdata.LatLng
M
import
com.cusc.map.map2d.cdata.LatLng
import
com.cusc.map.map2d.inters.OnDriveRoute
import
com.cusc.map.map2d.inters.OnDriveRoute
import
com.cusc.map.ui.MapReadyView
import
com.cusc.map.ui.MapReadyView
import
com.cusc.map.utils.DisplayUtil
import
com.cusc.map.utils.DisplayUtil
...
@@ -58,9 +58,9 @@ object MineRoutePlans {
...
@@ -58,9 +58,9 @@ object MineRoutePlans {
* @param onDriveRoute 路径规划结果回调
* @param onDriveRoute 路径规划结果回调
*/
*/
fun
drivingPathPlanning
(
fun
drivingPathPlanning
(
starPoint
:
LatLng
M
,
starPoint
:
com
.
cusc
.
map
.
map2d
.
cdata
.
LatLng
,
startName
:
String
=
"当前位置"
,
startName
:
String
=
"当前位置"
,
endPoint
:
LatLng
M
,
endPoint
:
com
.
cusc
.
map
.
map2d
.
cdata
.
LatLng
,
endName
:
String
=
""
,
endName
:
String
=
""
,
ways
:
List
<
WayPoi
>,
ways
:
List
<
WayPoi
>,
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
...
@@ -75,15 +75,15 @@ object MineRoutePlans {
...
@@ -75,15 +75,15 @@ object MineRoutePlans {
mNaviSession
?.
setDataPreference
(
DataPreference
.
preferOnline
)
mNaviSession
?.
setDataPreference
(
DataPreference
.
preferOnline
)
mNaviSession
?.
addMineNaviListener
(
planiListener
)
mNaviSession
?.
addMineNaviListener
(
planiListener
)
mStartPoint
=
Tools
.
latLngToPoint
(
LatLng
(
starPoint
.
lat
,
starPoint
.
lng
))
mStartPoint
=
Tools
.
latLngToPoint
(
F
LatLng
(
starPoint
.
lat
,
starPoint
.
lng
))
val
endPoint
=
Tools
.
latLngToPoint
(
LatLng
(
endPoint
.
lat
,
endPoint
.
lng
))
val
endPoint
=
Tools
.
latLngToPoint
(
F
LatLng
(
endPoint
.
lat
,
endPoint
.
lng
))
var
startName
=
startName
var
startName
=
startName
var
endName
=
endName
var
endName
=
endName
var
wayPoints
=
mutableListOf
<
PoiFavorite
>()
var
wayPoints
=
mutableListOf
<
PoiFavorite
>()
if
(
ways
.
count
()
>
0
)
{
if
(
ways
.
count
()
>
0
)
{
ways
.
forEach
{
wpoi
->
ways
.
forEach
{
wpoi
->
var
passPoint
=
var
passPoint
=
Tools
.
latLngToPoint
(
LatLng
(
wpoi
.
passPoint
!!
.
lat
,
wpoi
.
passPoint
!!
.
lng
))
Tools
.
latLngToPoint
(
F
LatLng
(
wpoi
.
passPoint
!!
.
lat
,
wpoi
.
passPoint
!!
.
lng
))
wayPoints
.
add
(
PoiFavorite
(
passPoint
,
wpoi
.
passName
))
wayPoints
.
add
(
PoiFavorite
(
passPoint
,
wpoi
.
passName
))
}
}
}
}
...
...
Prev
1
2
3
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