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
app/src/main/java/com/sd/demo/MainActivity.kt
View file @
a05e954e
...
...
@@ -131,7 +131,7 @@ class MainActivity : AppCompatActivity() {
* @param type MINE=四维 AMAP=高德
*/
fun
initMap
(
type
:
MAP_TYPE
=
MAP_TYPE
.
MINE
)
{
MSDKInitializer
.
initialize
Map
(
this
,
type
,
object
:
OnSdkInitCb
{
MSDKInitializer
.
initialize
(
this
,
type
,
object
:
OnSdkInitCb
{
override
fun
onInitSuccess
()
{
println
(
"--------onMapInitSuccess"
)
}
...
...
app/src/main/java/com/sd/demo/ui/DisplayMapActivity.kt
View file @
a05e954e
...
...
@@ -11,18 +11,18 @@ class DisplayMapActivity : AppCompatActivity() {
private
lateinit
var
binding
:
ActivityDisplayMapBinding
var
mapReadView
:
MapReadyView
?
=
null
//
var mapReadView: MapReadyView? = null
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
binding
=
ActivityDisplayMapBinding
.
inflate
(
layoutInflater
)
setContentView
(
binding
.
root
)
binding
.
mapMultiView
.
addMapRenderCallback
(
object
:
OnMapReadyLis
{
override
fun
onMapReady
(
mapReadyView
:
MapReadyView
)
{
this
@DisplayMapActivity
.
mapReadView
=
mapReadyView
}
})
//
binding.mapMultiView.addMapRenderCallback(object : OnMapReadyLis {
//
override fun onMapReady(mapReadyView: MapReadyView) {
//
this@DisplayMapActivity.mapReadView = mapReadyView
//
}
//
})
}
}
\ No newline at end of file
app/src/main/java/com/sd/demo/ui/ShowCarOnlineActivity.kt
View file @
a05e954e
...
...
@@ -4,11 +4,10 @@ import android.os.Bundle
import
androidx.activity.enableEdgeToEdge
import
androidx.appcompat.app.AppCompatActivity
import
com.sd.api.maps.cdata.MSLatLng
import
com.sd.api.location.MSLoc
Bean
import
com.sd.api.location.MSLoc
Cb
import
com.sd.api.core.MShowMainCarModel
import
com.sd.api.ui.MapReadyView
import
com.sd.api.location.OnMsGpsLoc
import
com.sd.api.factorys.MapCoreApi
import
com.sd.api.ui.MapMultiView.OnMapReadyLis
import
com.sd.demo.databinding.ActivityShowCarOnlineBinding
...
...
@@ -53,7 +52,7 @@ class ShowCarOnlineActivity : AppCompatActivity() {
//设置定位回调
mapCoreApi
.
startLoc
(
object
:
OnMsGpsLoc
{
override
fun
onMsGpsLoc
(
mSLocBean
:
MSLoc
Bean
)
{
override
fun
onMsGpsLoc
(
mSLocBean
:
MSLoc
Cb
)
{
//在这里改变小车的位置
}
...
...
app/src/main/java/com/sd/demo/ui/TDriveRouteActivity.kt
View file @
a05e954e
...
...
@@ -11,7 +11,6 @@ import com.minedata.minenavi.navi.TmcSections
import
com.sd.api.maps.cdata.MSLatLng
import
com.sd.api.bean.WayPoi
import
com.sd.api.ui.MapReadyView
import
com.sd.api.factorys.MapCoreApi
import
com.sd.api.intfaces.OnNaviPresenterListener
import
com.sd.api.ui.MapMultiView.OnMapReadyLis
import
com.sd.demo.databinding.ActivityTdriveRouteBinding
...
...
app/src/main/java/com/sd/demo/ui/TGpsActivity.kt
View file @
a05e954e
...
...
@@ -2,7 +2,7 @@ package com.sd.demo.ui
import
android.os.Bundle
import
androidx.appcompat.app.AppCompatActivity
import
com.sd.api.location.MSLoc
Bean
import
com.sd.api.location.MSLoc
Cb
import
com.sd.api.location.MSLocation
import
com.sd.api.location.OnMsGpsLoc
import
com.sd.api.maps.DrawInMap
...
...
@@ -42,7 +42,7 @@ class TGpsActivity : AppCompatActivity() {
//开启定位
MSLocation
.
startLoc
(
object
:
OnMsGpsLoc
{
override
fun
onMsGpsLoc
(
mSLocBean
:
MSLoc
Bean
)
{
override
fun
onMsGpsLoc
(
mSLocBean
:
MSLoc
Cb
)
{
println
(
"---------mSLocBean = ${mSLocBean}"
)
lat
=
mSLocBean
.
lat
lng
=
mSLocBean
.
lng
...
...
app/src/main/java/com/sd/demo/ui/THighMapActivity.kt
View file @
a05e954e
...
...
@@ -4,7 +4,6 @@ import android.os.Bundle
import
androidx.activity.enableEdgeToEdge
import
androidx.appcompat.app.AppCompatActivity
import
com.sd.api.ui.MapReadyView
import
com.sd.api.factorys.MapCoreApi
import
com.sd.api.ui.MapMultiView.OnMapReadyLis
import
com.sd.demo.databinding.ActivityHighMapBinding
...
...
app/src/main/java/com/sd/demo/ui/TPoiSearchActivity.kt
View file @
a05e954e
...
...
@@ -5,7 +5,6 @@ import androidx.appcompat.app.AppCompatActivity
import
com.sd.api.maps.cdata.PoiSearchRes
import
com.sd.api.ui.MapReadyView
import
com.sd.api.maps.inters.OnMSPoiSearchLis
import
com.sd.api.factorys.MapCoreApi
import
com.sd.api.maps.MSPoi
import
com.sd.api.ui.MapMultiView.OnMapReadyLis
import
com.sd.demo.adapter.PoiAdapter
...
...
app/src/main/res/layout/activity_display_map.xml
View file @
a05e954e
...
...
@@ -6,7 +6,19 @@
<com.sd.api.ui.MapMultiView
android:id=
"@+id/mapMultiView"
android:layout_width=
"
match_parent
"
android:layout_height=
"
match_parent
"
/>
android:layout_width=
"
300dp
"
android:layout_height=
"
300dp
"
/>
<!-- <ImageView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="10dp"-->
<!-- android:src="#784125"/>-->
<com.sd.api.ui.MapMultiView
android:id=
"@+id/mapMultiView2"
android:layout_width=
"200dp"
android:layout_height=
"300dp"
/>
<!-- <com.sd.api.ui.MapMultiView-->
<!-- android:id="@+id/mapMultiView3"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="300dp" />-->
</LinearLayout>
\ No newline at end of file
mapapi/src/main/java/com/sd/api/MSDKInitializer.kt
View file @
a05e954e
...
...
@@ -47,13 +47,13 @@ object MSDKInitializer {
private
var
onSdkInitCb
:
OnSdkInitCb
?
=
null
/**
* 初始化
地图SDK
* 初始化
引擎
*
* @param context 应用上下文,用于SDK初始化
* @param map_type 地图类型,指定要初始化的地图类型
* @param onSdkInitCb SDK初始化回调接口,用于通知初始化结果
*/
fun
initialize
Map
(
context
:
Context
,
map_type
:
MAP_TYPE
,
onSdkInitCb
:
OnSdkInitCb
)
{
fun
initialize
(
context
:
Context
,
map_type
:
MAP_TYPE
,
onSdkInitCb
:
OnSdkInitCb
)
{
// 保存初始化回调接口
this
.
onSdkInitCb
=
onSdkInitCb
// 设置用户上下文信息
...
...
mapapi/src/main/java/com/sd/api/core/basic/amap/AmapToggleLayers.kt
deleted
100644 → 0
View file @
aff5465d
package
com.sd.api.core.basic.amap
import
com.amap.api.maps.AMap
import
com.sd.api.ui.MapReadyView
/**
*高德切换底图图层
*/
object
AmapToggleLayers
{
fun
toggleLayers
(
mapReadView
:
MapReadyView
?,
type
:
Int
)
{
when
(
type
)
{
1
->
{
mapReadView
?.
aMap
?.
setMapType
(
AMap
.
MAP_TYPE_NORMAL
)
}
2
->
{
mapReadView
?.
aMap
?.
setMapType
(
AMap
.
MAP_TYPE_SATELLITE
)
}
}
}
}
\ No newline at end of file
mapapi/src/main/java/com/sd/api/core/basic/mine/MimeGestures.kt
deleted
100644 → 0
View file @
aff5465d
package
com.sd.api.core.basic.mine
import
com.sd.api.ui.MapReadyView
/**
* 四维手势交互
*/
object
MimeGestures
{
//
// /***缩放**/
// fun setZoomGesturesEnabled(mapReadView: MapReadyView,enable: Boolean) {
// when (MSDKInitializer.getMapType()) {
// MAP_TYPE.MINE -> {
// mapReadView.fMapView?.zoomView.is
// }
//
// MAP_TYPE.AMAP -> {
// mapReadView.amap?.uiSettings?.setZoomGesturesEnabled(enable)
// }
// }
// }
/**
* 设置地图旋转手势是否可用
* @param mapReadView 地图准备就绪视图对象
* @param enable 是否启用旋转手势功能
*/
fun
setRotateGesturesEnabled
(
mapReadView
:
MapReadyView
?,
enable
:
Boolean
)
{
// 根据不同的地图类型设置对应的旋转手势可用状态
mapReadView
?.
fMapView
?.
uiSettings
?.
isRotateGesturesEnabled
=
enable
}
/**
* 设置地图倾斜手势功能的启用状态
* @param mapReadView 地图准备就绪视图对象
* @param enable 是否启用倾斜手势功能,true为启用,false为禁用
* */
fun
setTiltGesturesEnabled
(
mapReadView
:
MapReadyView
?,
enable
:
Boolean
)
{
// 根据不同的地图类型设置对应的倾斜手势功能
mapReadView
?.
fMapView
?.
uiSettings
?.
isTiltGesturesEnabled
=
enable
}
}
\ No newline at end of file
mapapi/src/main/java/com/sd/api/core/basic/mine/MineToggleLayers.kt
deleted
100644 → 0
View file @
aff5465d
package
com.sd.api.core.basic.mine
import
com.minedata.minenavi.map.MineMap
import
com.minedata.minenavi.mapdal.CoordType
import
com.sd.api.ui.MapReadyView
/**
*四维切换底图图层
*/
object
MineToggleLayers
{
fun
toggleLayers
(
mapReadView
:
MapReadyView
?,
type
:
Int
)
{
when
(
type
)
{
1
->
{
switch2D
(
mapReadView
?.
mMineMap
)
}
2
->
{
switchSatelliteLayer
(
mapReadView
?.
mMineMap
)
}
}
}
private
fun
switch2D
(
mMineMap
:
MineMap
?)
{
//切换为2D平面图
mMineMap
?.
setElevation
(
90f
)
mMineMap
?.
setStyleClass
(
"DEFAULT"
)
mMineMap
?.
enableSatelliteLayer
(
false
)
}
private
fun
switchSatelliteLayer
(
mMineMap
:
MineMap
?)
{
//切换为卫星图
mMineMap
?.
setSatelliteImageType
(
MineMap
.
SatelliteImageSource
.
bing
,
CoordType
.
GCJ02
)
mMineMap
?.
setStyleClass
(
"SATELLITE"
)
mMineMap
?.
enableSatelliteLayer
(
true
)
}
}
\ No newline at end of file
mapapi/src/main/java/com/sd/api/factorys/AbsMapCore.kt
deleted
100644 → 0
View file @
aff5465d
package
com.sd.api.factorys
import
com.sd.api.maps.cdata.MSLatLng
import
com.sd.api.bean.WayPoi
import
com.sd.api.ui.MapReadyView
import
com.sd.api.maps.cdata.MSMarker
import
com.sd.api.maps.cdata.MSOverlay
import
com.sd.api.core.basic.OnDriveRoute
import
com.sd.api.maps.inters.OnMSPoiSearchLis
import
com.sd.api.location.OnMsGpsLoc
import
com.sd.api.intfaces.OnNaviPresenterListener
/**接口实现抽象**/
abstract
class
AbsMapCore
:
IMapBasic
,
IMapBusin
{
/**基础接口实现抽象**/
var
iMapBasic
=
MapFactory
.
createBasic
()
/**业务接口实现抽象**/
var
iMapBusin
=
MapFactory
.
createBusin
()
//-------------------------基础接口实现抽象----------------------------------
override
fun
toggleLayers
(
mapReadView
:
MapReadyView
?,
type
:
Int
)
{
iMapBasic
.
toggleLayers
(
mapReadView
,
type
)
}
override
fun
setLocationStyle
(
mapReadView
:
MapReadyView
?,
type
:
Int
)
{
iMapBasic
.
setLocationStyle
(
mapReadView
,
type
)
}
override
fun
setRotateGesturesEnabled
(
mapReadView
:
MapReadyView
?,
enable
:
Boolean
)
{
iMapBasic
.
setRotateGesturesEnabled
(
mapReadView
,
enable
)
}
override
fun
setTiltGesturesEnabled
(
mapReadView
:
MapReadyView
?,
enable
:
Boolean
)
{
iMapBasic
.
setTiltGesturesEnabled
(
mapReadView
,
enable
)
}
override
fun
setMapCenter
(
mapReadView
:
MapReadyView
?,
lat
:
Double
,
lng
:
Double
)
{
iMapBasic
.
setMapCenter
(
mapReadView
,
lat
,
lng
)
}
override
fun
setMapZoom
(
mapReadView
:
MapReadyView
?,
zoom
:
Float
)
{
iMapBasic
.
setMapZoom
(
mapReadView
,
zoom
)
}
override
fun
drawMarket
(
mapReadView
:
MapReadyView
?,
lat
:
Double
,
lng
:
Double
):
MSMarker
{
return
iMapBasic
.
drawMarket
(
mapReadView
,
lat
,
lng
)
}
override
fun
drawPolyline
(
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
MSLatLng
>,
fcolor
:
Int
,
width
:
Float
,
isDotted
:
Boolean
):
MSOverlay
{
return
iMapBasic
.
drawPolyline
(
mapReadView
,
msLatLng
,
fcolor
,
width
,
isDotted
)
}
override
fun
drawCircle
(
mapReadView
:
MapReadyView
?,
lat
:
Double
,
lng
:
Double
,
radius
:
Float
,
fillColor
:
Int
,
strokeColor
:
Int
,
strokeWidth
:
Float
):
MSOverlay
{
return
iMapBasic
.
drawCircle
(
mapReadView
,
lat
,
lng
,
radius
,
fillColor
,
strokeColor
,
strokeWidth
)
}
override
fun
drawPolygon
(
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
MSLatLng
>,
dLine
:
Boolean
,
fillColor
:
Int
,
strokeWidth
:
Float
,
strokeColor
:
Int
):
MSOverlay
{
return
iMapBasic
.
drawPolygon
(
mapReadView
,
msLatLng
,
dLine
,
fillColor
,
strokeWidth
,
strokeColor
)
}
override
fun
startPoiSearch
(
keyWord
:
String
,
lat
:
Double
,
lng
:
Double
,
onMSPoiSearchLis
:
OnMSPoiSearchLis
)
{
iMapBasic
.
startPoiSearch
(
keyWord
,
lat
,
lng
,
onMSPoiSearchLis
)
}
override
fun
startPoiSearchBound
(
keyWord
:
String
,
lat
:
Double
,
lng
:
Double
,
radios
:
Int
,
onMSPoiSearchLis
:
OnMSPoiSearchLis
)
{
iMapBasic
.
startPoiSearchBound
(
keyWord
,
lat
,
lng
,
radios
,
onMSPoiSearchLis
)
}
override
fun
startLoc
(
onMsGpsLoc
:
OnMsGpsLoc
)
{
iMapBasic
.
startLoc
(
onMsGpsLoc
)
}
override
fun
stopLoc
()
{
iMapBasic
.
stopLoc
()
}
override
fun
cleansLoc
()
{
iMapBasic
.
cleansLoc
()
}
override
fun
drivingPathPlanning
(
starPoint
:
MSLatLng
,
startName
:
String
,
endPoint
:
MSLatLng
,
endName
:
String
,
ways
:
List
<
WayPoi
>,
mapReadView
:
MapReadyView
?,
onDriveRoute
:
OnDriveRoute
?
)
{
iMapBasic
.
drivingPathPlanning
(
starPoint
,
startName
,
endPoint
,
endName
,
ways
,
mapReadView
,
onDriveRoute
)
}
override
fun
startNavi
(
mapReadView
:
MapReadyView
?,
navType
:
Int
,
starPoint
:
MSLatLng
,
startName
:
String
,
endPoint
:
MSLatLng
,
endName
:
String
,
ways
:
List
<
WayPoi
>,
onNaviPresenterListener
:
OnNaviPresenterListener
?
)
{
iMapBasic
.
startNavi
(
mapReadView
,
navType
,
starPoint
,
startName
,
endPoint
,
endName
,
ways
,
onNaviPresenterListener
)
}
//-------------------------基础接口实现抽象----------------------------------
}
\ No newline at end of file
mapapi/src/main/java/com/sd/api/factorys/AmapBasic.kt
deleted
100644 → 0
View file @
aff5465d
package
com.sd.api.factorys
import
com.sd.api.maps.cdata.MSLatLng
import
com.sd.api.bean.WayPoi
import
com.sd.api.ui.MapReadyView
import
com.sd.api.maps.cdata.MSMarker
import
com.sd.api.maps.cdata.MSOverlay
import
com.sd.api.core.basic.OnDriveRoute
import
com.sd.api.maps.inters.OnMSPoiSearchLis
import
com.sd.api.location.OnMsGpsLoc
import
com.sd.api.maps.amap.AmapDrawInMap
import
com.sd.api.maps.amap.AmapGestures
import
com.sd.api.core.basic.amap.AmapGpsLocation
import
com.sd.api.maps.amap.AmapLocationStyle
import
com.sd.api.maps.amap.AmapMethodAdv
import
com.sd.api.core.basic.amap.AmapNai
import
com.sd.api.maps.amap.AmapPoiSearch
import
com.sd.api.core.basic.amap.AmapRoutePlans
import
com.sd.api.core.basic.amap.AmapToggleLayers
import
com.sd.api.intfaces.OnNaviPresenterListener
/**
* 高德基础实现
* IBasicMap
*/
class
AmapBasic
:
IMapBasic
{
override
fun
toggleLayers
(
mapReadView
:
MapReadyView
?,
type
:
Int
)
{
AmapToggleLayers
.
toggleLayers
(
mapReadView
,
type
)
}
override
fun
setLocationStyle
(
mapReadView
:
MapReadyView
?,
type
:
Int
)
{
AmapLocationStyle
.
setLocationStyle
(
mapReadView
,
type
)
}
override
fun
setRotateGesturesEnabled
(
mapReadView
:
MapReadyView
?,
enable
:
Boolean
)
{
AmapGestures
.
setRotateGesturesEnabled
(
mapReadView
,
enable
)
}
override
fun
setTiltGesturesEnabled
(
mapReadView
:
MapReadyView
?,
enable
:
Boolean
)
{
AmapGestures
.
setTiltGesturesEnabled
(
mapReadView
,
enable
)
}
override
fun
setMapCenter
(
mapReadView
:
MapReadyView
?,
lat
:
Double
,
lng
:
Double
)
{
AmapMethodAdv
.
setMapCenter
(
mapReadView
,
lat
,
lng
)
}
override
fun
setMapZoom
(
mapReadView
:
MapReadyView
?,
zoom
:
Float
)
{
AmapMethodAdv
.
setMapZoom
(
mapReadView
,
zoom
)
}
override
fun
drawMarket
(
mapReadView
:
MapReadyView
?,
lat
:
Double
,
lng
:
Double
):
MSMarker
{
return
AmapDrawInMap
.
drawMarket
(
mapReadView
,
lat
,
lng
)
}
override
fun
drawPolyline
(
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
MSLatLng
>,
fcolor
:
Int
,
width
:
Float
,
isDotted
:
Boolean
):
MSOverlay
{
return
AmapDrawInMap
.
drawPolyline
(
mapReadView
,
msLatLng
,
fcolor
,
width
,
isDotted
)
}
override
fun
drawCircle
(
mapReadView
:
MapReadyView
?,
lat
:
Double
,
lng
:
Double
,
radius
:
Float
,
fillColor
:
Int
,
strokeColor
:
Int
,
strokeWidth
:
Float
):
MSOverlay
{
return
AmapDrawInMap
.
drawCircle
(
mapReadView
,
lat
,
lng
,
radius
,
fillColor
,
strokeColor
,
strokeWidth
)
}
override
fun
drawPolygon
(
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
MSLatLng
>,
dLine
:
Boolean
,
fillColor
:
Int
,
strokeWidth
:
Float
,
strokeColor
:
Int
):
MSOverlay
{
return
AmapDrawInMap
.
drawPolygon
(
mapReadView
,
msLatLng
,
dLine
,
fillColor
,
strokeWidth
,
strokeColor
)
}
override
fun
startPoiSearch
(
keyWord
:
String
,
lat
:
Double
,
lng
:
Double
,
onMSPoiSearchLis
:
OnMSPoiSearchLis
)
{
AmapPoiSearch
.
startPoiSearch
(
keyWord
,
lat
,
lng
,
onMSPoiSearchLis
)
}
override
fun
startPoiSearchBound
(
keyWord
:
String
,
lat
:
Double
,
lng
:
Double
,
radios
:
Int
,
onMSPoiSearchLis
:
OnMSPoiSearchLis
)
{
AmapPoiSearch
.
startPoiSearchBound
(
keyWord
,
lat
,
lng
,
radios
,
onMSPoiSearchLis
)
}
override
fun
startLoc
(
onMsGpsLoc
:
OnMsGpsLoc
)
{
AmapGpsLocation
.
instance
.
starLoc
(
onMsGpsLoc
)
}
override
fun
stopLoc
()
{
AmapGpsLocation
.
instance
.
stopLoc
()
}
override
fun
cleansLoc
()
{
AmapGpsLocation
.
instance
.
cleansLoc
()
}
override
fun
drivingPathPlanning
(
starPoint
:
MSLatLng
,
startName
:
String
,
endPoint
:
MSLatLng
,
endName
:
String
,
ways
:
List
<
WayPoi
>,
mapReadView
:
MapReadyView
?,
onDriveRoute
:
OnDriveRoute
?
)
{
AmapRoutePlans
.
instance
.
drivingPathPlanning
(
starPoint
,
startName
,
endPoint
,
endName
,
ways
,
mapReadView
,
onDriveRoute
)
}
override
fun
startNavi
(
mapReadView
:
MapReadyView
?,
navType
:
Int
,
starPoint
:
MSLatLng
,
startName
:
String
,
endPoint
:
MSLatLng
,
endName
:
String
,
ways
:
List
<
WayPoi
>,
onNaviPresenterListener
:
OnNaviPresenterListener
?
)
{
if
(
navType
==
1
)
{
// throw NoSuchMethodException("高德导航暂不支持自己实现回调")
AmapNai
.
startPlanNavi
(
starPoint
,
startName
,
endPoint
,
endName
,
ways
)
}
else
if
(
navType
==
2
)
{
AmapNai
.
startNavi
(
starPoint
,
startName
,
endPoint
,
endName
,
ways
)
}
}
companion
object
{
val
amapBasic
:
AmapBasic
by
lazy
{
AmapBasic
()
}
}
}
\ No newline at end of file
mapapi/src/main/java/com/sd/api/factorys/IMapBasic.kt
deleted
100644 → 0
View file @
aff5465d
package
com.sd.api.factorys
import
androidx.core.graphics.toColorInt
import
com.sd.api.maps.cdata.MSLatLng
import
com.sd.api.bean.WayPoi
import
com.sd.api.ui.MapReadyView
import
com.sd.api.maps.MSLocStyle
import
com.sd.api.maps.cdata.MSMarker
import
com.sd.api.maps.cdata.MSOverlay
import
com.sd.api.core.basic.OnDriveRoute
import
com.sd.api.maps.inters.OnMSPoiSearchLis
import
com.sd.api.location.OnMsGpsLoc
import
com.sd.api.intfaces.OnNaviPresenterListener
/**
* 基础接口
*/
interface
IMapBasic
{
/**
* 切换地图图层
* @param mapReadView 地图准备就绪视图对象
* @param type 1=普通 2=卫星
*/
fun
toggleLayers
(
mapReadView
:
MapReadyView
?,
type
:
Int
)
/**
* 设置定位蓝点样式
* @param mapReadView 地图准备就绪视图对象
* @param type 定位类型,默认为LOCATION_TYPE_LOCATION_ROTATE,表示连续定位并旋转视角
*/
fun
setLocationStyle
(
mapReadView
:
MapReadyView
?,
type
:
Int
=
MSLocStyle
.
LOCATION_TYPE_LOCATION_ROTATE
)
/**
* 设置地图旋转手势是否可用
* @param mapReadView 地图准备就绪视图对象
* @param enable 是否启用旋转手势功能
*/
fun
setRotateGesturesEnabled
(
mapReadView
:
MapReadyView
?,
enable
:
Boolean
)
/**
* 设置地图倾斜手势功能的启用状态
* @param mapReadView 地图准备就绪视图对象
* @param enable 是否启用倾斜手势功能,true为启用,false为禁用
* */
fun
setTiltGesturesEnabled
(
mapReadView
:
MapReadyView
?,
enable
:
Boolean
)
/**
* 改变地图中心点
* @param mapReadView 地图准备就绪的视图对象
* @param lat 纬度
* @param lng 经度
* **/
fun
setMapCenter
(
mapReadView
:
MapReadyView
?,
lat
:
Double
,
lng
:
Double
)
/**
* 改变地图缩放级别
* @param mapReadView 地图准备就绪的视图对象
* @param zoom 缩放级别,值越小站得越高,默认值为11f
* */
fun
setMapZoom
(
mapReadView
:
MapReadyView
?,
zoom
:
Float
=
11f
)
/**
* 绘制 marker 点
* @param mapReadView 地图准备就绪的视图对象
* @param lat 纬度坐标
* @param lng 经度坐标
* @return MSMarker 标记点对象
*/
fun
drawMarket
(
mapReadView
:
MapReadyView
?,
lat
:
Double
,
lng
:
Double
):
MSMarker
/**
* 绘制线
* @param mapReadView 地图加载返回
* @param msLatLng 坐标点集合
* @param width 线宽度,默认为10f
* @param fcolor 线颜色
* @param isDotted 是否为虚线,默认为false
* @return MSOverlay 覆盖物对象
*/
fun
drawPolyline
(
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
MSLatLng
>,
fcolor
:
Int
,
width
:
Float
,
isDotted
:
Boolean
=
false
):
MSOverlay
/**绘制圆形
* @param mapReadView 地图准备就绪视图对象
* @param lat 维度
* @param lng 经度
* @param radius 半径(米)
* @param fillColor 填充颜色,默认为半透明红色
* @param strokeColor 边框颜色,默认为半透明蓝色
* @param strokeWidth 边框宽度,默认为15f
* @return MSOverlay 返回覆盖物对象
*/
fun
drawCircle
(
mapReadView
:
MapReadyView
?,
lat
:
Double
,
lng
:
Double
,
radius
:
Float
,
fillColor
:
Int
=
"#50FF0000"
.
toColorInt
(),
strokeColor
:
Int
=
"#500000FF"
.
toColorInt
(),
strokeWidth
:
Float
=
15f
):
MSOverlay
/***
* 绘制多边形
* @param msLatLng 添加多边形顶点坐标集合
* @param dLine 是否虚线
* @param fillColor 填充颜色
* @param strokeWidth 边框宽度
* @param strokeColor 边框颜色
* ****/
fun
drawPolygon
(
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
MSLatLng
>,
dLine
:
Boolean
=
false
,
fillColor
:
Int
=
"#10FF00FF"
.
toColorInt
(),
strokeWidth
:
Float
=
5f
,
strokeColor
:
Int
=
"#50FF00FF"
.
toColorInt
()
):
MSOverlay
/**关键字搜索
* @param keyWord 关键字
* @param lat 当期维度
* @param lng 当期经度
* @param onMSPoiSearchLis 搜索回调
*/
fun
startPoiSearch
(
keyWord
:
String
,
lat
:
Double
,
lng
:
Double
,
onMSPoiSearchLis
:
OnMSPoiSearchLis
)
/**周边搜索
* @param keyWord 关键字
* @param lat 当前维度
* @param lng 当前经度
* @param radios 搜索半径(单位 米)
* @param onMSPoiSearchLis 回调
*/
fun
startPoiSearchBound
(
keyWord
:
String
,
lat
:
Double
,
lng
:
Double
,
radios
:
Int
,
onMSPoiSearchLis
:
OnMSPoiSearchLis
)
/**
* 开启定位
* 设置GPS定位回调监听器
* @param onMsGpsLoc GPS定位回调监听器实例
*/
fun
startLoc
(
onMsGpsLoc
:
OnMsGpsLoc
)
/**停止定位*/
fun
stopLoc
()
/**清理定位资源**/
fun
cleansLoc
()
/**驾车路径规划
* @param starPoint 起点坐标
* @param startName 起点名称
* @param endPoint 终点坐标
* @param endName 终点名称(高德可不传)
* @param ways 途经点集合
* @param mapReadView 地图对象
* @param onDriveRoute 路径规划结果回调
*/
fun
drivingPathPlanning
(
starPoint
:
MSLatLng
,
startName
:
String
=
"当前位置"
,
endPoint
:
MSLatLng
,
endName
:
String
=
""
,
ways
:
List
<
WayPoi
>,
mapReadView
:
MapReadyView
?,
onDriveRoute
:
OnDriveRoute
?
)
/**
* 开始导航
* @param navType 1=自己实现回调 2=直接调用导航组件
* @param starPoint 起点坐标
* @param startName 起点名称
* @param endPoint 终点坐标
* @param endName 终点名称
* @param ways 途经点集合
* @param onNaviPresenterListener 四维导航监听回调
*/
fun
startNavi
(
mapReadView
:
MapReadyView
?,
navType
:
Int
,
starPoint
:
MSLatLng
,
startName
:
String
=
"当前位置"
,
endPoint
:
MSLatLng
,
endName
:
String
=
""
,
ways
:
List
<
WayPoi
>,
onNaviPresenterListener
:
OnNaviPresenterListener
?
)
}
\ No newline at end of file
mapapi/src/main/java/com/sd/api/factorys/IMapBusin.kt
deleted
100644 → 0
View file @
aff5465d
package
com.sd.api.factorys
/**
* 业务接口
*/
interface
IMapBusin
{
}
\ No newline at end of file
mapapi/src/main/java/com/sd/api/factorys/IMapFactory.kt
deleted
100644 → 0
View file @
aff5465d
package
com.sd.api.factorys
interface
IMapFactory
{
fun
createBasic
():
IMapBasic
fun
createBusin
():
IMapBusin
}
\ No newline at end of file
mapapi/src/main/java/com/sd/api/factorys/MapCoreApi.kt
deleted
100644 → 0
View file @
aff5465d
package
com.sd.api.factorys
class
MapCoreApi
:
AbsMapCore
()
{
companion
object
{
val
mapCoreApi
:
MapCoreApi
by
lazy
{
MapCoreApi
()
}
}
}
\ No newline at end of file
mapapi/src/main/java/com/sd/api/factorys/MapFactory.kt
deleted
100644 → 0
View file @
aff5465d
package
com.sd.api.factorys
import
com.sd.api.MAP_TYPE
import
com.sd.api.MSDKInitializer
/**地图工厂**/
internal
object
MapFactory
{
/**创建基础接口**/
fun
createBasic
():
IMapBasic
{
when
(
MSDKInitializer
.
getMapType
())
{
MAP_TYPE
.
MINE
->
{
return
MineBasic
.
mineBasic
}
MAP_TYPE
.
AMAP
->
{
return
AmapBasic
.
amapBasic
}
}
}
/**创建业务接口**/
fun
createBusin
():
IMapBusin
?
{
// when (MSDKInitializer.getMapType()) {
// MAP_TYPE.MINE -> {
// return MineBasic.mineBasic
// }
//
// MAP_TYPE.AMAP -> {
// return AmapBasic.amapBasic
// }
// }
return
null
}
}
\ No newline at end of file
mapapi/src/main/java/com/sd/api/factorys/MineBasic.kt
deleted
100644 → 0
View file @
aff5465d
package
com.sd.api.factorys
import
com.sd.api.maps.cdata.MSLatLng
import
com.sd.api.bean.WayPoi
import
com.sd.api.ui.MapReadyView
import
com.sd.api.maps.cdata.MSMarker
import
com.sd.api.maps.cdata.MSOverlay
import
com.sd.api.core.basic.OnDriveRoute
import
com.sd.api.maps.inters.OnMSPoiSearchLis
import
com.sd.api.location.OnMsGpsLoc
import
com.sd.api.core.basic.mine.MimeGestures
import
com.sd.api.core.basic.mine.MineDrawInMap
import
com.sd.api.location.MineGpsLocation
import
com.sd.api.maps.mine.MineLocationStyle
import
com.sd.api.maps.mine.MineMethodAdv
import
com.sd.api.core.basic.mine.MineNai
import
com.sd.api.maps.mine.MinePoiSearch
import
com.sd.api.core.basic.mine.MineRoutePlans
import
com.sd.api.core.basic.mine.MineToggleLayers
import
com.sd.api.intfaces.OnNaviPresenterListener
/**
* 四维基础地图实现
*/
class
MineBasic
:
IMapBasic
{
override
fun
toggleLayers
(
mapReadView
:
MapReadyView
?,
type
:
Int
)
{
MineToggleLayers
.
toggleLayers
(
mapReadView
,
type
)
}
override
fun
setLocationStyle
(
mapReadView
:
MapReadyView
?,
type
:
Int
)
{
MineLocationStyle
.
setLocationStyle
(
mapReadView
,
type
)
}
override
fun
setRotateGesturesEnabled
(
mapReadView
:
MapReadyView
?,
enable
:
Boolean
)
{
MimeGestures
.
setRotateGesturesEnabled
(
mapReadView
,
enable
)
}
override
fun
setTiltGesturesEnabled
(
mapReadView
:
MapReadyView
?,
enable
:
Boolean
)
{
MimeGestures
.
setTiltGesturesEnabled
(
mapReadView
,
enable
)
}
override
fun
setMapCenter
(
mapReadView
:
MapReadyView
?,
lat
:
Double
,
lng
:
Double
)
{
MineMethodAdv
.
setMapCenter
(
mapReadView
,
lat
,
lng
)
}
override
fun
setMapZoom
(
mapReadView
:
MapReadyView
?,
zoom
:
Float
)
{
MineMethodAdv
.
setMapZoom
(
mapReadView
,
zoom
)
}
override
fun
drawMarket
(
mapReadView
:
MapReadyView
?,
lat
:
Double
,
lng
:
Double
):
MSMarker
{
return
MineDrawInMap
.
drawMarket
(
mapReadView
,
lat
,
lng
)
}
override
fun
drawPolyline
(
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
MSLatLng
>,
fcolor
:
Int
,
width
:
Float
,
isDotted
:
Boolean
):
MSOverlay
{
return
MineDrawInMap
.
drawPolyline
(
mapReadView
,
msLatLng
,
fcolor
,
0
,
width
,
isDotted
)
}
override
fun
drawCircle
(
mapReadView
:
MapReadyView
?,
lat
:
Double
,
lng
:
Double
,
radius
:
Float
,
fillColor
:
Int
,
strokeColor
:
Int
,
strokeWidth
:
Float
):
MSOverlay
{
return
MineDrawInMap
.
drawCircle
(
mapReadView
,
lat
,
lng
,
radius
,
fillColor
,
strokeColor
,
strokeWidth
)
}
override
fun
drawPolygon
(
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
MSLatLng
>,
dLine
:
Boolean
,
fillColor
:
Int
,
strokeWidth
:
Float
,
strokeColor
:
Int
):
MSOverlay
{
return
MineDrawInMap
.
drawPolygon
(
mapReadView
,
msLatLng
,
dLine
,
fillColor
,
strokeWidth
,
strokeColor
)
}
override
fun
startPoiSearch
(
keyWord
:
String
,
lat
:
Double
,
lng
:
Double
,
onMSPoiSearchLis
:
OnMSPoiSearchLis
)
{
MinePoiSearch
.
startPoiSearch
(
keyWord
,
lat
,
lng
,
onMSPoiSearchLis
)
}
override
fun
startPoiSearchBound
(
keyWord
:
String
,
lat
:
Double
,
lng
:
Double
,
radios
:
Int
,
onMSPoiSearchLis
:
OnMSPoiSearchLis
)
{
MinePoiSearch
.
startPoiSearchBound
(
keyWord
,
lat
,
lng
,
radios
,
onMSPoiSearchLis
)
}
override
fun
startLoc
(
onMsGpsLoc
:
OnMsGpsLoc
)
{
MineGpsLocation
.
starLoc
(
onMsGpsLoc
)
}
override
fun
stopLoc
()
{
MineGpsLocation
.
stopLoc
()
}
override
fun
cleansLoc
()
{
MineGpsLocation
.
cleansLoc
()
}
override
fun
drivingPathPlanning
(
starPoint
:
MSLatLng
,
startName
:
String
,
endPoint
:
MSLatLng
,
endName
:
String
,
ways
:
List
<
WayPoi
>,
mapReadView
:
MapReadyView
?,
onDriveRoute
:
OnDriveRoute
?
)
{
MineRoutePlans
.
drivingPathPlanning
(
starPoint
,
startName
,
endPoint
,
endName
,
ways
,
mapReadView
,
onDriveRoute
)
}
override
fun
startNavi
(
mapReadView
:
MapReadyView
?,
navType
:
Int
,
starPoint
:
MSLatLng
,
startName
:
String
,
endPoint
:
MSLatLng
,
endName
:
String
,
ways
:
List
<
WayPoi
>,
onNaviPresenterListener
:
OnNaviPresenterListener
?
)
{
if
(
navType
==
1
)
{
//用户自己实现接口
MineNai
.
startNavi
(
mapReadView
,
onNaviPresenterListener
)
}
else
if
(
navType
==
2
)
{
//直接到写好的页面
MineNai
.
startNaviDirect
(
starPoint
,
startName
,
endPoint
,
endName
,
ways
)
}
}
companion
object
{
val
mineBasic
:
MineBasic
by
lazy
{
MineBasic
()
}
}
}
\ No newline at end of file
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