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
ab228446
Commit
ab228446
authored
Jan 06, 2026
by
p x
Browse files
更改类名
parent
a8779687
Changes
20
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/sd/demo/MainActivity.kt
View file @
ab228446
...
...
@@ -134,7 +134,6 @@ class MainActivity : AppCompatActivity() {
/**
* Init map
*
* @param type MINE=四维 AMAP=高德
*/
fun
initMap
(
type
:
MAP_TYPE
=
MAP_TYPE
.
MINE
)
{
...
...
app/src/main/java/com/sd/demo/ui/TLineActivity.kt
View file @
ab228446
...
...
@@ -8,7 +8,7 @@ import com.cusc.map.map2d.DelDrawInMap
import
com.cusc.map.map2d.cdata.MapOverlay
import
com.cusc.map.map2d.DrawInMap
import
com.cusc.map.map2d.MethodAdv
import
com.cusc.map.map2d.
Ms
PolylineOptions
import
com.cusc.map.map2d.PolylineOptions
import
com.cusc.map.ui.MapView.OnMapReadyLis
import
com.sd.demo.databinding.ActivityTlineBinding
...
...
@@ -44,12 +44,12 @@ class TLineActivity : AppCompatActivity() {
binding
.
bt1
.
setOnClickListener
{
//绘制一条线 //画实线
var
m
sL
atLng
=
listOf
<
LatLngM
>(
var
matLng
=
listOf
<
LatLngM
>(
LatLngM
(
39.999391
,
116.135972
),
LatLngM
(
39.898323
,
116.057694
),
LatLngM
(
39.900430
,
116.265061
),
LatLngM
(
39.955192
,
116.140092
)
)
var
msP
olylineOptions
=
Ms
PolylineOptions
()
mSOverlay
=
DrawInMap
.
drawPolyline
(
m
sL
atLng
,
msP
olylineOptions
)
var
p
olylineOptions
=
PolylineOptions
()
mSOverlay
=
DrawInMap
.
drawPolyline
(
matLng
,
p
olylineOptions
)
}
binding
.
bt2
.
setOnClickListener
{
//画虚线
...
...
@@ -58,7 +58,7 @@ class TLineActivity : AppCompatActivity() {
LatLngM
(
39.900230
,
116.265062
),
LatLngM
(
39.951192
,
116.140090
)
)
//绘制线选项
var
msPolylineOptions
=
Ms
PolylineOptions
().
apply
{
var
msPolylineOptions
=
PolylineOptions
().
apply
{
isDotted
=
true
//是否虚线
}
mSOverlay2
=
DrawInMap
.
drawPolyline
(
msLatLng
,
msPolylineOptions
)
...
...
app/src/main/java/com/sd/demo/ui/TPoiSearchActivity.kt
View file @
ab228446
...
...
@@ -56,25 +56,27 @@ class TPoiSearchActivity : AppCompatActivity() {
}
//poi搜索
/**poi关键字搜索
* @param keyword 关键字
* ***/
fun
testPoiSearch
(
keyword
:
String
)
{
//poi关键字搜索
PoiSearch
.
startPoiSearch
(
keyword
,
//关键字
41.80196
,
123.43326
,
"110115"
,
"110115"
,
//行政区编码必传
object
:
OnMSPoiSearchLis
{
override
fun
onPoiLis
(
poiList
:
List
<
PoiSearchRes
>
)
{
//自定义适配器展示列表
//
自定义适配器展示列表
poiAdapter
.
submitList
(
poiList
)
}
})
}
/
/poi
范围搜索
/
***
范围搜索
**/
fun
testPoiSearchBound
(
keyword
:
String
)
{
//poi 范围搜索
PoiSearch
.
startPoiSearchBound
(
...
...
app/src/main/java/com/sd/demo/ui/TPolygonActivity.kt
View file @
ab228446
...
...
@@ -8,7 +8,7 @@ import com.cusc.map.map2d.DelDrawInMap
import
com.cusc.map.map2d.cdata.MapOverlay
import
com.cusc.map.map2d.DrawInMap
import
com.cusc.map.map2d.MethodAdv
import
com.cusc.map.map2d.
Ms
PolygonOptions
import
com.cusc.map.map2d.PolygonOptions
import
com.cusc.map.ui.MapView.OnMapReadyLis
import
com.sd.demo.databinding.ActivityTpolygonBinding
...
...
@@ -39,11 +39,11 @@ class TPolygonActivity : AppCompatActivity() {
LatLngM
(
39.904430
,
116.265061
),
LatLngM
(
39.950192
,
116.140002
)
)
//构造面参数
var
msPolygonOptions
=
Ms
PolygonOptions
().
apply
{
var
msPolygonOptions
=
PolygonOptions
().
apply
{
dLine
=
true
}
mSOverlay
=
DrawInMap
.
drawPolygon
(
mspLatLng
,
msPolygonOptions
)
//移动地图中心点
MethodAdv
.
setMapCenter
(
39.993391
,
116.135272
)
}
})
...
...
app/src/main/res/layout/activity_tpoi_search.xml
View file @
ab228446
...
...
@@ -42,7 +42,7 @@
android:id=
"@+id/et1"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"5000"
/>
android:text=
"5000"
/>
<Button
...
...
@@ -57,13 +57,13 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<!--基础底图-->
<com.cusc.map.ui.MapView
android:id=
"@+id/MapView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
<!--用户自定义列表-->
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/poi_list"
android:layout_width=
"match_parent"
...
...
mapapi/build.gradle.kts
View file @
ab228446
...
...
@@ -56,7 +56,7 @@ android {
// val versionName = config.versionName
// val formatter = DateTimeFormatter.ofPattern("yyyy_MM_dd_HHmm")
// val createTime = LocalDateTime.now().format(formatter)
outputFileName
=
"
map_
cusc_${version}.aar"
outputFileName
=
"cusc
_map
_${version}.aar"
}
}
}
...
...
@@ -101,7 +101,7 @@ dependencies {
dokka
{
dokkaPublications
.
javadoc
{
moduleName
.
set
(
"
mapsdk
"
)
moduleName
.
set
(
"
CuscMapSDK
"
)
// moduleVersion.set(project.version.toString())
description
=
"Android 地图SDK"
// Standard output directory for HTML documentation
...
...
@@ -124,7 +124,7 @@ dokka {
suppress
.
set
(
true
)
//suppress = true:完全禁用匹配包的文档生成
}
perPackageOption
{
matchingRegex
.
set
(
".*core.*|.*fragments.*|.*scenario\\.mine.*|
.*tests.*|
overlay"
)
matchingRegex
.
set
(
".*core.*|.*fragments.*|.*scenario\\.mine.*|overlay"
)
suppress
.
set
(
true
)
//suppress = true:完全禁用匹配包的文档生成
}
perPackageOption
{
...
...
mapapi/src/main/java/com/cusc/map/fragments/ForeMapFragment.kt
View file @
ab228446
...
...
@@ -27,7 +27,7 @@ import com.cusc.map.ui.MapReadyView
//private const val ARG_PARAM2 = "param2"
/**
*四维地图容器
*四维
二维
地图容器
*/
class
ForeMapFragment
:
Fragment
()
{
// private var param1: String? = null
...
...
mapapi/src/main/java/com/cusc/map/fragments/PartRoadFragment.kt
View file @
ab228446
...
...
@@ -45,6 +45,7 @@ class PartRoadFragment : Fragment() {
}
private
fun
initView
()
{
//初始化四维局部图SDK
carRoadVM
.
webViewClient
=
CarAndRoadWebViewClient
(
binding
.
roadWebview
)
carRoadVM
.
webViewClient
?.
run
{
setDebugLogging
(
true
)
...
...
mapapi/src/main/java/com/cusc/map/fragments/UnityFragment.kt
View file @
ab228446
...
...
@@ -77,6 +77,7 @@ class UnityFragment : Fragment(), IUnityPlayerLifecycleEvents {
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
//创建四维Unity SDK里的实例
mUnityPlayer
=
UnityPlayer
(
requireContext
(),
this
)
}
...
...
mapapi/src/main/java/com/cusc/map/location/MineGpsLocation.kt
View file @
ab228446
...
...
@@ -54,7 +54,7 @@ internal object MineGpsLocation {
}
//---------------四维回调---------------
//---------------四维
定位
回调---------------
private
var
mineLocationListener
=
object
:
MineLocationListener
{
override
fun
onSimLocationChanged
(
location
:
MineLocation
?)
{
}
...
...
mapapi/src/main/java/com/cusc/map/map2d/DrawInMap.kt
View file @
ab228446
...
...
@@ -8,7 +8,7 @@ import com.cusc.map.map2d.cdata.MapOverlay
import
com.cusc.map.map2d.mine.MineDrawInMap
/**绘制线选项**/
class
Ms
PolylineOptions
{
class
PolylineOptions
{
/***填充颜色**/
var
fcolor
=
"#000000"
.
toColorInt
()
...
...
@@ -39,7 +39,7 @@ class CircleOptionsM {
}
/**绘制一个面选项**/
class
Ms
PolygonOptions
{
class
PolygonOptions
{
/***填充颜色**/
var
fillColor
=
"#10FF00FF"
.
toColorInt
()
...
...
@@ -88,7 +88,7 @@ object DrawInMap : MsOperationParent() {
* @return MSOverlay 覆盖物对象
*/
fun
drawPolyline
(
msLatLng
:
List
<
LatLngM
>,
msPolylineOptions
:
Ms
PolylineOptions
msLatLng
:
List
<
LatLngM
>,
msPolylineOptions
:
PolylineOptions
):
MapOverlay
{
val
mapReadView
=
getMapReadView
()
when
(
MapSdkInit
.
getMapType
())
{
...
...
@@ -142,7 +142,7 @@ object DrawInMap : MsOperationParent() {
*/
fun
drawPolygon
(
msLatLng
:
List
<
LatLngM
>,
msPolygonOptions
:
Ms
PolygonOptions
msPolygonOptions
:
PolygonOptions
):
MapOverlay
{
val
mapReadView
=
getMapReadView
()
when
(
MapSdkInit
.
getMapType
())
{
...
...
mapapi/src/main/java/com/cusc/map/map2d/MapSdkInit.kt
View file @
ab228446
...
...
@@ -112,7 +112,7 @@ object MapSdkInit {
if
(
UserCtx
.
instance
.
wmtsUrl
.
isEmpty
()
==
false
)
{
SDKInitializer
.
setStyleUrl
(
MineMap
.
UrlType
.
satellite
,
UserCtx
.
instance
.
wmtsUrl
)
}
// 执行SDK初始化
// 执行
四维
SDK初始化
SDKInitializer
.
initialize
(
ctx
,
object
:
InitListener
{
override
fun
onInitSuccess
()
{
onSdkInitCb
?.
onInitSuccess
()
...
...
mapapi/src/main/java/com/cusc/map/map2d/MsOperationParent.kt
View file @
ab228446
...
...
@@ -4,7 +4,7 @@ import com.cusc.map.ui.MapReadyView
import
com.cusc.map.utils.ToastHelper
//地图操作父类
internal
open
class
MsOperationParent
{
open
class
MsOperationParent
{
fun
getMapReadView
():
MapReadyView
?
{
if
(
UserCtx
.
instance
.
mContext
==
null
)
{
return
null
...
...
mapapi/src/main/java/com/cusc/map/map2d/amap/AmapDrawInMap.kt
View file @
ab228446
...
...
@@ -6,13 +6,13 @@ import com.amap.api.maps.model.BitmapDescriptorFactory
import
com.amap.api.maps.model.CircleOptions
import
com.amap.api.maps.model.LatLng
import
com.amap.api.maps.model.MarkerOptions
import
com.amap.api.maps.model.PolygonOptions
import
com.amap.api.maps.model.PolylineOptions
import
com.amap.api.maps.model.PolygonOptions
as
APolygonOptions
import
com.amap.api.maps.model.PolylineOptions
as
APolylineOptions
import
com.cusc.map.R
import
com.cusc.map.map2d.UserCtx
import
com.cusc.map.map2d.CircleOptionsM
import
com.cusc.map.map2d.
Ms
PolygonOptions
import
com.cusc.map.map2d.
Ms
PolylineOptions
import
com.cusc.map.map2d.PolygonOptions
import
com.cusc.map.map2d.PolylineOptions
import
com.cusc.map.map2d.cdata.LatLngM
import
com.cusc.map.ui.MapReadyView
import
com.cusc.map.map2d.cdata.MapOverlay
...
...
@@ -65,13 +65,13 @@ object AmapDrawInMap {
fun
drawPolyline
(
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
LatLngM
>,
msPolylineOptions
:
Ms
PolylineOptions
msPolylineOptions
:
com
.
cusc
.
map
.
map2d
.
PolylineOptions
):
MapOverlay
{
// 绘制高德地图的线
var
latLngs
=
msLatLng
.
map
{
LatLng
(
it
.
lat
,
it
.
lng
)
}
val
aOption
=
PolylineOptions
().
addAll
(
latLngs
)
val
aOption
=
A
PolylineOptions
().
addAll
(
latLngs
)
.
width
(
msPolylineOptions
.
width
)
.
color
(
msPolylineOptions
.
fcolor
)
.
setDottedLine
(
msPolylineOptions
.
isDotted
)
...
...
@@ -113,12 +113,12 @@ object AmapDrawInMap {
fun
drawPolygon
(
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
LatLngM
>,
msPolygonOptions
:
Ms
PolygonOptions
msPolygonOptions
:
com
.
cusc
.
map
.
map2d
.
PolygonOptions
):
MapOverlay
{
var
latLngs
=
msLatLng
.
map
{
LatLng
(
it
.
lat
,
it
.
lng
)
}
val
aPolygonOptions
=
PolygonOptions
().
apply
{
val
aPolygonOptions
=
A
PolygonOptions
().
apply
{
addAll
(
latLngs
)
fillColor
(
msPolygonOptions
.
fillColor
)
strokeWidth
(
msPolygonOptions
.
strokeWidth
)
...
...
mapapi/src/main/java/com/cusc/map/map2d/mine/MineDrawInMap.kt
View file @
ab228446
...
...
@@ -4,14 +4,14 @@ import android.graphics.BitmapFactory
import
androidx.core.graphics.toColorInt
import
com.minedata.minenavi.map.CircleOptions
import
com.minedata.minenavi.map.MarkerOptions
import
com.minedata.minenavi.map.PolygonOptions
import
com.minedata.minenavi.map.PolylineOptions
import
com.minedata.minenavi.map.PolygonOptions
as
MPolygonOptions
import
com.minedata.minenavi.map.PolylineOptions
as
MPolylineOptions
import
com.minedata.minenavi.mapdal.LatLng
import
com.cusc.map.R
import
com.cusc.map.map2d.UserCtx
import
com.cusc.map.map2d.CircleOptionsM
import
com.cusc.map.map2d.
Ms
PolygonOptions
import
com.cusc.map.map2d.
Ms
PolylineOptions
import
com.cusc.map.map2d.PolygonOptions
import
com.cusc.map.map2d.PolylineOptions
import
com.cusc.map.map2d.cdata.LatLngM
import
com.cusc.map.map2d.cdata.MarkerM
import
com.cusc.map.map2d.cdata.MapOverlay
...
...
@@ -24,7 +24,7 @@ internal object MineDrawInMap {
/**
* 绘制 marker 点
*
四维
绘制 marker 点
* @param mapReadView 地图准备就绪的视图对象
* @param lat 纬度坐标
* @param lng 经度坐标
...
...
@@ -50,7 +50,7 @@ internal object MineDrawInMap {
/**
* 绘制线
*
四维
绘制线
* @param mapReadView 地图加载返回
* @param msLatLng 坐标点集合
* @param msPolylineOptions 绘制线选项
...
...
@@ -58,13 +58,13 @@ internal object MineDrawInMap {
fun
drawPolyline
(
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
LatLngM
>,
msPolylineOptions
:
Ms
PolylineOptions
msPolylineOptions
:
com
.
cusc
.
map
.
map2d
.
PolylineOptions
):
MapOverlay
{
// 绘制自定义地图的线
var
latLngs
=
msLatLng
.
map
{
LatLng
(
it
.
lat
,
it
.
lng
)
}
var
options
=
PolylineOptions
()
var
options
=
M
PolylineOptions
()
// 添加顶点坐标
.
addAll
(
latLngs
)
.
width
(
msPolylineOptions
.
width
)
...
...
@@ -77,7 +77,7 @@ internal object MineDrawInMap {
}
/**绘制圆形
/**
四维
绘制圆形
* @param mapReadView 地图准备就绪视图对象
* @param center 中心点坐标
* @param msCircleOptions 绘制圆形选项
...
...
@@ -110,13 +110,13 @@ internal object MineDrawInMap {
fun
drawPolygon
(
mapReadView
:
MapReadyView
?,
msLatLng
:
List
<
LatLngM
>,
msPolygonOptions
:
Ms
PolygonOptions
msPolygonOptions
:
com
.
cusc
.
map
.
map2d
.
PolygonOptions
):
MapOverlay
{
var
latLngs
=
msLatLng
.
map
{
LatLng
(
it
.
lat
,
it
.
lng
)
}
// 声明 多边形参数对象
val
polygonOptions
=
PolygonOptions
().
apply
{
val
polygonOptions
=
M
PolygonOptions
().
apply
{
addAll
(
latLngs
)
fillColor
(
msPolygonOptions
.
fillColor
)
strokeWidth
(
msPolygonOptions
.
strokeWidth
)
...
...
mapapi/src/main/java/com/cusc/map/map2d/mine/MineGestures.kt
View file @
ab228446
...
...
@@ -24,7 +24,7 @@ internal object MineGestures {
/**
* 设置地图旋转手势是否可用
*
四维
设置地图旋转手势是否可用
* @param mapReadView 地图准备就绪视图对象
* @param enable 是否启用旋转手势功能
*/
...
...
@@ -35,7 +35,7 @@ internal object MineGestures {
/**
* 设置地图倾斜手势功能的启用状态
*
四维
设置地图倾斜手势功能的启用状态
* @param mapReadView 地图准备就绪视图对象
* @param enable 是否启用倾斜手势功能,true为启用,false为禁用
* */
...
...
mapapi/src/main/java/com/cusc/map/map2d/mine/MineLayers.kt
View file @
ab228446
...
...
@@ -23,14 +23,14 @@ internal object MineLayers {
private
fun
switch2D
(
mMineMap
:
MineMap
?)
{
//切换为2D平面图
//
四维
切换为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
)
...
...
mapapi/src/main/java/com/cusc/map/tests/AbsMap.kt
deleted
100644 → 0
View file @
a8779687
package
com.cusc.map.tests
abstract
class
AbsMap
:
IMap
{
}
\ No newline at end of file
mapapi/src/main/java/com/cusc/map/tests/IMap.kt
deleted
100644 → 0
View file @
a8779687
package
com.cusc.map.tests
interface
IMap
{
fun
getMap
():
Int
}
\ No newline at end of file
mapapi/src/main/java/com/cusc/map/ui/MapView.kt
View file @
ab228446
...
...
@@ -42,10 +42,10 @@ class MapView : LinearLayout {
private
lateinit
var
binding
:
MultiViewBinding
//四维
在线
地图
//四维
二维
地图
private
val
foreMapFragment
by
lazy
{
ForeMapFragment
.
newInstance
()
}
//四维
高精
地图
//四维
三维
地图
private
val
unityFragment
by
lazy
{
UnityFragment
.
newInstance
()
}
//四维局部地图
...
...
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