diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt index 7470a9932c..9e1bbe7601 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt @@ -71,6 +71,10 @@ class OverMapView @JvmOverloads constructor( private var resetDrawableMarginRight: Int = -1 private var resetDrawableMarginBottom: Int = -1 private var isClearArrived: Boolean = false + private var leftPadding: Int = 100 + private var topPadding: Int = 100 + private var rightPadding: Int = 100 + private var bottomPadding: Int = 100 private var mMapView: TextureMapView? = null private var mAMap: AMap? = null @@ -136,6 +140,10 @@ class OverMapView @JvmOverloads constructor( AutoSizeUtils.dp2px(context, 40f) ) isClearArrived = typedArray.getBoolean(R.styleable.OverMapView_isClearArrived, false) + leftPadding = typedArray.getInt(R.styleable.OverMapView_leftPadding, 100) + topPadding = typedArray.getInt(R.styleable.OverMapView_topPadding, 100) + rightPadding = typedArray.getInt(R.styleable.OverMapView_rightPadding, 100) + bottomPadding = typedArray.getInt(R.styleable.OverMapView_bottomPadding, 100) typedArray.recycle() initView(context) } catch (e: Exception) { @@ -559,10 +567,10 @@ class OverMapView @JvmOverloads constructor( mAMap!!.moveCamera( CameraUpdateFactory.newLatLngBoundsRect( boundsBuilder.build(), - 100, - 100, - 100, - 100 + leftPadding, + rightPadding, + topPadding, + bottomPadding ) ) mAMap!!.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)) diff --git a/core/function-impl/mogo-core-function-map/src/main/res/values/attrs.xml b/core/function-impl/mogo-core-function-map/src/main/res/values/attrs.xml index 0d3349fc35..15a5585362 100644 --- a/core/function-impl/mogo-core-function-map/src/main/res/values/attrs.xml +++ b/core/function-impl/mogo-core-function-map/src/main/res/values/attrs.xml @@ -24,5 +24,10 @@ + + + + + \ No newline at end of file