[m2][3.0.0]新增画站点的接口
This commit is contained in:
@@ -215,6 +215,25 @@ class OverMapView @JvmOverloads constructor(
|
||||
siteMarkerList = mAMap!!.addMarkers(markerOptionsList, false)
|
||||
}
|
||||
|
||||
@MainThread
|
||||
fun drawSiteMarkers(
|
||||
siteMarkers: List<SiteMarkerBean>?,
|
||||
) {
|
||||
if (siteMarkers.isNullOrEmpty()) return
|
||||
clearSiteMarkers()
|
||||
val markerOptionsList = ArrayList<MarkerOptions>()
|
||||
for (siteMarkerBean in siteMarkers) {
|
||||
val markerOption = MarkerOptions()
|
||||
markerOption.position(siteMarkerBean.latLng)
|
||||
markerOption.anchor(siteMarkerBean.anchorX, siteMarkerBean.anchorY)
|
||||
markerOption.icon(
|
||||
BitmapDescriptorFactory.fromBitmap(siteMarkerBean.bitmap)
|
||||
)
|
||||
markerOptionsList.add(markerOption)
|
||||
}
|
||||
siteMarkerList = mAMap!!.addMarkers(markerOptionsList, false)
|
||||
}
|
||||
|
||||
@MainThread
|
||||
fun clearSiteMarkers() {
|
||||
if (siteMarkerList != null) {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.mogo.eagle.core.function.view
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import com.amap.api.maps.model.LatLng
|
||||
|
||||
data class SiteMarkerBean(var latLng: LatLng, var bitmap: Bitmap, var anchorX: Float, var anchorY: Float)
|
||||
Reference in New Issue
Block a user