Commit 42135beb authored by p x's avatar p x
Browse files

迁移基础功能

parent 6b587c56
package com.sd.maplibrary.core.basic.mine
import com.minedata.minenavi.mapdal.PoiItem
import com.minedata.minenavi.poiquery.LatLonPoint
import com.minedata.minenavi.poiquery.PoiResult
import com.minedata.minenavi.poiquery.PoiSearch
import com.minedata.minenavi.poiquery.SearchErrorCode
import com.minedata.minenavi.poiquery.SortType
import com.sd.maplibrary.UserCtx
import com.sd.maplibrary.bean.PoiSearchRes
import com.sd.maplibrary.core.basic.OnMSPoiSearchLis
/**
* 四维Poi搜索相关
**/
object MinePoiSearch : PoiSearch.OnPoiSearchListener {
private var onMSPoiSearchLis: OnMSPoiSearchLis? = null
/**关键字搜索
* @param keyWord 关键字
* @param lat 当期维度
* @param lng 当期经度
* @param onMSPoiSearchLis 搜索回调
*/
fun startPoiSearch(
keyWord: String,
lat: Double = 41.80196,
lng: Double = 123.43326,
onMSPoiSearchLis: OnMSPoiSearchLis
) {
this.onMSPoiSearchLis = onMSPoiSearchLis
var context = UserCtx.instance.mContext
val poiSearch = PoiSearch(context)
poiSearch.setOnPoiSearchListener(this)
val query = PoiSearch.Query(keyWord, "", "").apply {
// 设置查询位置点
location = LatLonPoint(lat, lng)
// 限制严格按照设置城市搜索
setCityLimit(false)
// 设置排序方式为热度排序
setSortType(SortType.SORT_TYPE_HIT)
// 返回父子关系
requireSubPois(true)
pageNum = 0
setPageSize(20)// 设置每页最多返回多少条poiitem
}
poiSearch.query = query
poiSearch.searchPOIAsyn()
}
/**周边搜索
* @param keyWord 关键字
* @param lat 当前维度
* @param lng 当前经度
* @param radios 搜索半径(单位 米)
* @param onMSPoiSearchLis 回调
*/
fun startPoiSearchBound(
keyWord: String,
lat: Double,
lng: Double,
radios: Int,
onMSPoiSearchLis: OnMSPoiSearchLis
) {
this.onMSPoiSearchLis = onMSPoiSearchLis
var context = UserCtx.instance.mContext
val poiSearch = PoiSearch(context)
poiSearch.setOnPoiSearchListener(this)
// 第一个参数表示搜索中心点, 第二个参数表示搜索半径
val bound = PoiSearch.SearchBound(LatLonPoint(lat, lng), radios)
poiSearch.setBound(bound)
// 第一个参数表示搜索关键字(可传空字符串),
// 第二个参数表示 POI 搜索类型,不同类型用|分割,
// 第三个参数表示 POI 搜索城市编码
val query = PoiSearch.Query(keyWord, "", "").apply {
// 设置查询位置点
location = LatLonPoint(lat, lng)
// 限制严格按照设置城市搜索
setCityLimit(true)
// 设置排序方式为热度排序
setSortType(SortType.SORT_TYPE_HIT)
// 返回父子关系
requireSubPois(true)
pageNum = 0
setPageSize(20)// 设置每页最多返回多少条poiitem
}
poiSearch.query = query
poiSearch.searchPOIAsyn()
}
//---------------------------------四维POI 返回 -------------------------------
override fun onPoiItemSearched(p0: PoiItem?, p1: Int) {
var b = 0
}
override fun onPoiSearched(result: PoiResult?, rCode: Int) {
if (rCode == SearchErrorCode.none) {
var temps = result?.getPois()
var poiList = temps!!.map { pos ->
PoiSearchRes().apply {
lat = pos.location.latitude
lng = pos.location.longitude
title = pos.title
snippet = pos.snippet
cityName = pos.cityName
//这里为0 因为不是范围搜索
distance = pos.distance
adCode = pos.adCode
}
}
onMSPoiSearchLis?.onPoiLis(poiList)
} else {
onMSPoiSearchLis?.onPoiLis(listOf())
}
}
}
\ No newline at end of file
package com.sd.maplibrary.factorys
import com.sd.maplibrary.bean.MSLatLng
import com.sd.maplibrary.bean.WayPoi
import com.sd.maplibrary.core.MapReadyView
import com.sd.maplibrary.core.basic.MSMarker
import com.sd.maplibrary.core.basic.MSOverlay
import com.sd.maplibrary.core.basic.OnMSPoiSearchLis
import com.sd.maplibrary.core.basic.OnMsGpsLoc
/**接口实现抽象**/
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>,
width: Float,
fcolor: Int,
isDotted: Boolean
): MSOverlay {
return iMapBasic.drawPolyline(mapReadView, msLatLng, width, fcolor, 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?
) {
iMapBasic.drivingPathPlanning(starPoint, startName, endPoint, endName, ways, mapReadView)
}
}
\ No newline at end of file
......@@ -3,6 +3,16 @@ package com.sd.maplibrary.factorys
import com.sd.maplibrary.bean.MSLatLng
import com.sd.maplibrary.bean.WayPoi
import com.sd.maplibrary.core.MapReadyView
import com.sd.maplibrary.core.basic.MSMarker
import com.sd.maplibrary.core.basic.MSOverlay
import com.sd.maplibrary.core.basic.OnMSPoiSearchLis
import com.sd.maplibrary.core.basic.OnMsGpsLoc
import com.sd.maplibrary.core.basic.amap.AmapDrawInMap
import com.sd.maplibrary.core.basic.amap.AmapGestures
import com.sd.maplibrary.core.basic.amap.AmapGpsLocation
import com.sd.maplibrary.core.basic.amap.AmapLocationStyle
import com.sd.maplibrary.core.basic.amap.AmapMethodAdv
import com.sd.maplibrary.core.basic.amap.AmapPoiSearch
import com.sd.maplibrary.core.basic.amap.AmapRoutePlans
import com.sd.maplibrary.core.basic.amap.AmapToggleLayers
......@@ -10,11 +20,131 @@ import com.sd.maplibrary.core.basic.amap.AmapToggleLayers
* 高德基础实现
* IBasicMap
*/
class AmapBasic: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>,
width: Float,
fcolor: Int,
isDotted: Boolean
): MSOverlay {
return AmapDrawInMap.drawPolyline(mapReadView, msLatLng, width, fcolor, 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,
......@@ -23,10 +153,17 @@ class AmapBasic:IBasicMap {
ways: List<WayPoi>,
mapReadView: MapReadyView?
) {
AmapRoutePlans.drivingPathPlanning(starPoint, startName, endPoint, endName, ways, mapReadView)
AmapRoutePlans.drivingPathPlanning(
starPoint,
startName,
endPoint,
endName,
ways,
mapReadView
)
}
companion object {
val amapBasic:AmapBasic by lazy { AmapBasic() }
val amapBasic: AmapBasic by lazy { AmapBasic() }
}
}
\ No newline at end of file
package com.sd.maplibrary.factorys
import com.sd.maplibrary.bean.MSLatLng
import com.sd.maplibrary.bean.WayPoi
import com.sd.maplibrary.core.MapReadyView
/**
* 基础接口
*/
interface IBasicMap {
/**
* 切换地图图层
* @param mapReadView 地图准备就绪视图对象
* @param type 1=普通 2=卫星
*/
fun toggleLayers(mapReadView: MapReadyView?, type: Int)
/**驾车路径规划
* @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
)
}
\ No newline at end of file
package com.sd.maplibrary.factorys
/**
* 高精地图接口
*/
interface IHIghMap {
}
\ No newline at end of file
package com.sd.maplibrary.factorys
/**
* AVP场景下的高精接口
*/
interface IHighAvpMap {
}
\ No newline at end of file
package com.sd.maplibrary.factorys
import androidx.core.graphics.toColorInt
import com.amap.api.location.AMapLocationClient
import com.sd.maplibrary.bean.MSLatLng
import com.sd.maplibrary.bean.WayPoi
import com.sd.maplibrary.core.MapReadyView
import com.sd.maplibrary.core.basic.MSLocStyle
import com.sd.maplibrary.core.basic.MSMarker
import com.sd.maplibrary.core.basic.MSOverlay
import com.sd.maplibrary.core.basic.OnMSPoiSearchLis
import com.sd.maplibrary.core.basic.OnMsGpsLoc
/**
* 基础接口
*/
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>,
width: Float = 10f,
fcolor: Int,
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
)
}
\ No newline at end of file
package com.sd.maplibrary.factorys
/**
* 局部地图
* 业务接口
*/
interface ICarRoadMap {
interface IMapBusin {
}
\ No newline at end of file
......@@ -2,11 +2,8 @@ package com.sd.maplibrary.factorys
interface IMapFactory {
fun createBasic():IBasicMap
fun createBasic():IMapBasic
fun createHigh():IHIghMap
fun createHighAVp():IHighAvpMap
fun createCarRoad():ICarRoadMap
fun createBusin():IMapBusin
}
\ No newline at end of file
package com.sd.maplibrary.factorys
class MapCoreApi: AbsMapCore() {
companion object {
val mapCoreApi:MapCoreApi by lazy { MapCoreApi() }
}
}
\ No newline at end of file
......@@ -3,10 +3,11 @@ package com.sd.maplibrary.factorys
import com.sd.maplibrary.MAP_TYPE
import com.sd.maplibrary.MSDKInitializer
/***地图工厂**/
object MapFactory : IMapFactory {
/**地图工厂**/
internal object MapFactory {
override fun createBasic(): IBasicMap {
/**创建基础接口**/
fun createBasic(): IMapBasic {
when (MSDKInitializer.getMapType()) {
MAP_TYPE.MINE -> {
return MineBasic.mineBasic
......@@ -18,16 +19,18 @@ object MapFactory : IMapFactory {
}
}
override fun createHigh(): IHIghMap {
TODO("Not yet implemented")
}
override fun createHighAVp(): IHighAvpMap {
TODO("Not yet implemented")
}
override fun createCarRoad(): ICarRoadMap {
TODO("Not yet implemented")
/**创建业务接口**/
fun createBusin(): IMapBusin? {
// when (MSDKInitializer.getMapType()) {
// MAP_TYPE.MINE -> {
// return MineBasic.mineBasic
// }
//
// MAP_TYPE.AMAP -> {
// return AmapBasic.amapBasic
// }
// }
return null
}
......
......@@ -3,17 +3,149 @@ package com.sd.maplibrary.factorys
import com.sd.maplibrary.bean.MSLatLng
import com.sd.maplibrary.bean.WayPoi
import com.sd.maplibrary.core.MapReadyView
import com.sd.maplibrary.core.basic.MSMarker
import com.sd.maplibrary.core.basic.MSOverlay
import com.sd.maplibrary.core.basic.OnMSPoiSearchLis
import com.sd.maplibrary.core.basic.OnMsGpsLoc
import com.sd.maplibrary.core.basic.mine.MimeGestures
import com.sd.maplibrary.core.basic.mine.MineDrawInMap
import com.sd.maplibrary.core.basic.mine.MineGpsLocation
import com.sd.maplibrary.core.basic.mine.MineLocationStyle
import com.sd.maplibrary.core.basic.mine.MineMethodAdv
import com.sd.maplibrary.core.basic.mine.MinePoiSearch
import com.sd.maplibrary.core.basic.mine.MineRoutePlans
import com.sd.maplibrary.core.basic.mine.MineToggleLayers
/**
* 四维基础地图实现
*/
class MineBasic : IBasicMap {
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>,
width: Float,
fcolor: Int,
isDotted: Boolean
): MSOverlay {
return MineDrawInMap.drawPolyline(mapReadView, msLatLng, width, fcolor, 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,
......@@ -22,12 +154,17 @@ class MineBasic : IBasicMap {
ways: List<WayPoi>,
mapReadView: MapReadyView?
) {
MineRoutePlans.drivingPathPlanning(starPoint, startName, endPoint, endName, ways, mapReadView)
MineRoutePlans.drivingPathPlanning(
starPoint,
startName,
endPoint,
endName,
ways,
mapReadView
)
}
companion object {
val mineBasic: MineBasic by lazy { MineBasic() }
}
......
package com.sd.maplibrary.tests
abstract class AbsMap : IMap{
}
\ No newline at end of file
package com.sd.maplibrary.tests
interface IMap {
fun getMap(): Int
}
\ No newline at end of file
package com.sd.maplibrary.vms
import androidx.lifecycle.ViewModel
import com.sd.maplibrary.core.MSLocationStyle
import com.sd.maplibrary.core.MapReadyView
class MainVM: ViewModel() {
//显示定位蓝点
fun showMyLocLandian(mapReadView: MapReadyView?){
MSLocationStyle.setLocationStyle(mapReadView)
// MSLocationStyle.setLocationStyle(mapReadView)
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment