[map-sdk] 同步地图SDK 3.4.0.1
This commit is contained in:
@@ -86,8 +86,8 @@ public class LaneMarkTools {
|
||||
{
|
||||
Panel_Image_Scale = scale;
|
||||
|
||||
PANEL_IMAGE_WIDTH = (int) (screenWidth/4.0 * Panel_Image_Scale);
|
||||
PANEL_IMAGE_HEIGHT = (int) (screenHeight/3.0 * Panel_Image_Scale);
|
||||
PANEL_IMAGE_WIDTH = (int) (screenWidth/4 * Panel_Image_Scale);
|
||||
PANEL_IMAGE_HEIGHT = (int) (screenHeight/3 * Panel_Image_Scale);
|
||||
LANE_PANELBORDER_MARGIN = (int) (5 * Panel_Image_Scale);
|
||||
LANE_PANELBORDER_RADIAN = (int) (10 * Panel_Image_Scale);
|
||||
|
||||
@@ -154,12 +154,12 @@ public class LaneMarkTools {
|
||||
paint.setColor(Color.GREEN);
|
||||
paint.setAntiAlias(true);
|
||||
Path path = new Path();
|
||||
path.moveTo(ARROW_IMAGE_WIDTH / 2.0f, 0);
|
||||
path.lineTo(ARROW_IMAGE_WIDTH, ARROW_IMAGE_HEIGHT / 2.0f);
|
||||
path.lineTo(ARROW_IMAGE_WIDTH, ARROW_IMAGE_HEIGHT / 2.0f + ARROW_THICKNESS);
|
||||
path.lineTo(ARROW_IMAGE_WIDTH / 2.0f, ARROW_THICKNESS);
|
||||
path.lineTo(0, ARROW_IMAGE_HEIGHT / 2.0f + ARROW_THICKNESS);
|
||||
path.lineTo(0, ARROW_IMAGE_HEIGHT / 2.0f);
|
||||
path.moveTo(ARROW_IMAGE_WIDTH / 2, 0);
|
||||
path.lineTo(ARROW_IMAGE_WIDTH, ARROW_IMAGE_HEIGHT / 2);
|
||||
path.lineTo(ARROW_IMAGE_WIDTH, ARROW_IMAGE_HEIGHT / 2 + ARROW_THICKNESS);
|
||||
path.lineTo(ARROW_IMAGE_WIDTH / 2, ARROW_THICKNESS);
|
||||
path.lineTo(0, ARROW_IMAGE_HEIGHT / 2 + ARROW_THICKNESS);
|
||||
path.lineTo(0, ARROW_IMAGE_HEIGHT / 2);
|
||||
path.close();
|
||||
canvas.drawPath(path, paint);
|
||||
BitmapInfo info = new BitmapInfo();
|
||||
@@ -186,7 +186,7 @@ public class LaneMarkTools {
|
||||
paint.setColor(Color.GREEN);
|
||||
paint.setAntiAlias(true);
|
||||
Path path = new Path();
|
||||
path.moveTo(TRIANGLE_IMAGE_WIDTH / 2.0f, 0);
|
||||
path.moveTo(TRIANGLE_IMAGE_WIDTH / 2, 0);
|
||||
path.lineTo(TRIANGLE_IMAGE_WIDTH, TRIANGLE_IMAGE_HEIGHT);
|
||||
path.lineTo(0, TRIANGLE_IMAGE_HEIGHT);
|
||||
path.close();
|
||||
@@ -289,8 +289,8 @@ public class LaneMarkTools {
|
||||
paint.setStyle(Style.STROKE);
|
||||
paint.setStrokeWidth(ARC_GOTO_SECTION_WIDTH);
|
||||
paint.setAntiAlias(true);
|
||||
float arcGotoSectionPositionX = (LANE_WIDTH - ARC_RADIUS * 2.0f) / 2.0f;
|
||||
float arcGotoSectionPositionY = LANE_HEIGHT / 3.0f;
|
||||
float arcGotoSectionPositionX = (LANE_WIDTH - ARC_RADIUS * 2) / 2;
|
||||
float arcGotoSectionPositionY = LANE_HEIGHT / 3;
|
||||
canvas.drawLine(arcGotoSectionPositionX, arcGotoSectionPositionY,
|
||||
arcGotoSectionPositionX, arcGotoSectionPositionY + ARC_INTO_SECTION_HEIGHT,
|
||||
paint);
|
||||
@@ -320,14 +320,14 @@ public class LaneMarkTools {
|
||||
paint.setStrokeWidth(ARC_GOTO_SECTION_WIDTH);
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
float arcGotoSectionPositionX = (LANE_WIDTH - ARC_RADIUS * 2.0f) / 2.0f;
|
||||
float arcGotoSectionPositionY = LANE_HEIGHT / 3.0f;
|
||||
float arcGotoSectionPositionX = (LANE_WIDTH - ARC_RADIUS * 2) / 2;
|
||||
float arcGotoSectionPositionY = LANE_HEIGHT / 3;
|
||||
canvas.drawLine(arcGotoSectionPositionX, arcGotoSectionPositionY,
|
||||
arcGotoSectionPositionX, arcGotoSectionPositionY + ARC_GOTO_SECTION_HEIGHT,
|
||||
paint);
|
||||
|
||||
float arcIntoSectionPositionX = arcGotoSectionPositionX + ARC_RADIUS * 2;
|
||||
float arcIntoSectionPositionY = LANE_HEIGHT / 3.0f;
|
||||
float arcIntoSectionPositionY = LANE_HEIGHT / 3;
|
||||
canvas.drawLine(arcIntoSectionPositionX, arcIntoSectionPositionY,
|
||||
arcIntoSectionPositionX, arcIntoSectionPositionY + ARC_INTO_SECTION_HEIGHT,
|
||||
paint);
|
||||
@@ -348,7 +348,7 @@ public class LaneMarkTools {
|
||||
canvas.save();
|
||||
canvas.translate(translationX, translationY);
|
||||
canvas.rotate(180);
|
||||
canvas.drawBitmap(arrowImage, -(arrowImage.getWidth() / 2.0f),0, paint);
|
||||
canvas.drawBitmap(arrowImage, -(arrowImage.getWidth() / 2),0, paint);
|
||||
canvas.restore();
|
||||
|
||||
BitmapInfo info = new BitmapInfo();
|
||||
@@ -378,7 +378,7 @@ public class LaneMarkTools {
|
||||
paint.setStrokeWidth(STRAIGHT_SECTION_WIDTH);
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
Bitmap arrowImage = getRenderArrowImage(isW != AHEAD_BIT_MASK).bitmap;
|
||||
Bitmap arrowImage = getRenderArrowImage(isW == AHEAD_BIT_MASK ? false : true).bitmap;
|
||||
int arrowPositionX = (LANE_WIDTH - arrowImage.getWidth()) / 2;
|
||||
int arrowPositionY = (LANE_HEIGHT - ARROW_THICKNESS - STRAIGHT_SECTION_HEIGHT) / 2;
|
||||
canvas.drawBitmap(arrowImage, arrowPositionX, arrowPositionY, paint);
|
||||
@@ -429,13 +429,13 @@ public class LaneMarkTools {
|
||||
|
||||
canvas.drawPath(path, paint);
|
||||
|
||||
Bitmap arrowImage = getRenderArrowImage(isW != LEFT_TWO_BIT_MASK).bitmap;
|
||||
Bitmap arrowImage = getRenderArrowImage(isW == LEFT_TWO_BIT_MASK ? false : true).bitmap;
|
||||
int translationX = endX - ARROW_THICKNESS;
|
||||
int translationY = endY;
|
||||
canvas.save();
|
||||
canvas.translate(translationX, translationY);
|
||||
canvas.rotate(-90);
|
||||
canvas.drawBitmap(arrowImage, -(arrowImage.getWidth() / 2.0f), 0, paint);
|
||||
canvas.drawBitmap(arrowImage, -(arrowImage.getWidth() / 2), 0, paint);
|
||||
canvas.restore();
|
||||
|
||||
BitmapInfo info = new BitmapInfo();
|
||||
@@ -479,13 +479,13 @@ public class LaneMarkTools {
|
||||
|
||||
canvas.drawPath(path, paint);
|
||||
|
||||
Bitmap arrowImage = getRenderArrowImage(isW != RIGHT_TWO_BIT_MASK).bitmap;
|
||||
Bitmap arrowImage = getRenderArrowImage(isW == RIGHT_TWO_BIT_MASK ? false : true).bitmap;
|
||||
int translationX = endX + ARROW_THICKNESS;
|
||||
int translationY = endY;
|
||||
canvas.save();
|
||||
canvas.translate(translationX, translationY);
|
||||
canvas.rotate(90);
|
||||
canvas.drawBitmap(arrowImage, -(arrowImage.getWidth() / 2.0f), 0, paint);
|
||||
canvas.drawBitmap(arrowImage, -(arrowImage.getWidth() / 2), 0, paint);
|
||||
canvas.restore();
|
||||
|
||||
BitmapInfo info = new BitmapInfo();
|
||||
@@ -707,8 +707,8 @@ public class LaneMarkTools {
|
||||
paint.setStrokeWidth(RIGHT_TURN_VERTICAL_SECTION_WIDTH);
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
float startX = LANE_WIDTH / 3.0f;
|
||||
float startY = LANE_HEIGHT - LANE_HEIGHT / 4.0f;
|
||||
float startX = LANE_WIDTH / 3;
|
||||
float startY = LANE_HEIGHT - LANE_HEIGHT / 4;
|
||||
float endX = startX;
|
||||
float endY = startY - RIGHT_TURN_VERTICAL_SECTION_HEIGHT;
|
||||
|
||||
@@ -717,20 +717,20 @@ public class LaneMarkTools {
|
||||
paint.setStyle(Style.FILL);
|
||||
|
||||
Path path = new Path();
|
||||
path.moveTo(endX - RIGHT_TURN_VERTICAL_SECTION_WIDTH / 2.0f, endY);
|
||||
path.lineTo(endX - RIGHT_TURN_VERTICAL_SECTION_WIDTH / 2.0f, endY + RIGHT_FRONT_TURN_SLOPE_THICKNESS);
|
||||
path.lineTo(endX - RIGHT_TURN_VERTICAL_SECTION_WIDTH / 2.0f + RIGHT_FRONT_TURN_SLOPE_WIDTH, endY);
|
||||
path.lineTo(endX - RIGHT_TURN_VERTICAL_SECTION_WIDTH / 2.0f + RIGHT_FRONT_TURN_SLOPE_WIDTH, endY - RIGHT_FRONT_TURN_SLOPE_THICKNESS);
|
||||
path.moveTo(endX - RIGHT_TURN_VERTICAL_SECTION_WIDTH / 2, endY);
|
||||
path.lineTo(endX - RIGHT_TURN_VERTICAL_SECTION_WIDTH / 2, endY + RIGHT_FRONT_TURN_SLOPE_THICKNESS);
|
||||
path.lineTo(endX - RIGHT_TURN_VERTICAL_SECTION_WIDTH / 2 + RIGHT_FRONT_TURN_SLOPE_WIDTH, endY);
|
||||
path.lineTo(endX - RIGHT_TURN_VERTICAL_SECTION_WIDTH / 2 + RIGHT_FRONT_TURN_SLOPE_WIDTH, endY - RIGHT_FRONT_TURN_SLOPE_THICKNESS);
|
||||
|
||||
canvas.drawPath(path, paint);
|
||||
|
||||
Bitmap triangleImage = getRenderTriangleImage(isW).bitmap;
|
||||
float translationX = endX - RIGHT_TURN_VERTICAL_SECTION_WIDTH / 2.0f + RIGHT_FRONT_TURN_SLOPE_WIDTH + TRIANGLE_IMAGE_HEIGHT;
|
||||
float translationY = endY - RIGHT_FRONT_TURN_SLOPE_THICKNESS / 2.0f;
|
||||
float translationX = endX - RIGHT_TURN_VERTICAL_SECTION_WIDTH / 2 + RIGHT_FRONT_TURN_SLOPE_WIDTH + TRIANGLE_IMAGE_HEIGHT;
|
||||
float translationY = endY - RIGHT_FRONT_TURN_SLOPE_THICKNESS / 2;
|
||||
canvas.save();
|
||||
canvas.translate(translationX, translationY);
|
||||
canvas.rotate(90);
|
||||
canvas.drawBitmap(triangleImage, -(triangleImage.getWidth() / 2.0f), 0, paint);
|
||||
canvas.drawBitmap(triangleImage, -(triangleImage.getWidth() / 2), 0, paint);
|
||||
canvas.restore();
|
||||
|
||||
BitmapInfo info = new BitmapInfo();
|
||||
@@ -769,10 +769,10 @@ public class LaneMarkTools {
|
||||
paint.setStyle(Style.FILL);
|
||||
|
||||
Path path = new Path();
|
||||
path.moveTo(endX + LEFT_TURN_VERTICAL_SECTION_WIDTH / 2.0f, endY);
|
||||
path.lineTo(endX + LEFT_TURN_VERTICAL_SECTION_WIDTH / 2.0f, endY + LEFT_FRONT_TURN_SLOPE_THICKNESS);
|
||||
path.lineTo(endX + LEFT_TURN_VERTICAL_SECTION_WIDTH / 2.0f - LEFT_FRONT_TURN_SLOPE_WIDTH, endY);
|
||||
path.lineTo(endX + LEFT_TURN_VERTICAL_SECTION_WIDTH / 2.0f - LEFT_FRONT_TURN_SLOPE_WIDTH, endY - LEFT_FRONT_TURN_SLOPE_THICKNESS);
|
||||
path.moveTo(endX + LEFT_TURN_VERTICAL_SECTION_WIDTH / 2, endY);
|
||||
path.lineTo(endX + LEFT_TURN_VERTICAL_SECTION_WIDTH / 2, endY + LEFT_FRONT_TURN_SLOPE_THICKNESS);
|
||||
path.lineTo(endX + LEFT_TURN_VERTICAL_SECTION_WIDTH / 2 - LEFT_FRONT_TURN_SLOPE_WIDTH, endY);
|
||||
path.lineTo(endX + LEFT_TURN_VERTICAL_SECTION_WIDTH / 2 - LEFT_FRONT_TURN_SLOPE_WIDTH, endY - LEFT_FRONT_TURN_SLOPE_THICKNESS);
|
||||
|
||||
canvas.drawPath(path, paint);
|
||||
|
||||
@@ -782,7 +782,7 @@ public class LaneMarkTools {
|
||||
canvas.save();
|
||||
canvas.translate(translationX, translationY);
|
||||
canvas.rotate(-90);
|
||||
canvas.drawBitmap(triangleImage, -(triangleImage.getWidth() / 2.0f), 0, paint);
|
||||
canvas.drawBitmap(triangleImage, -(triangleImage.getWidth() / 2), 0, paint);
|
||||
canvas.restore();
|
||||
BitmapInfo info = new BitmapInfo();
|
||||
info.bitmap = bitmap;
|
||||
@@ -807,8 +807,8 @@ public class LaneMarkTools {
|
||||
paint.setStrokeWidth(LEFT_TURN_VERTICAL_SECTION_WIDTH);
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
Bitmap leftFrontTurnLaneArrow = getRenderLeftFrontTurnLaneArrow(isW != LEFT_TWO_BIT_MASK).bitmap;
|
||||
Bitmap UTurnLaneArrow = getRenderUTurnLaneArrow(isW != UTURN_BIT_MASK).bitmap;
|
||||
Bitmap leftFrontTurnLaneArrow = getRenderLeftFrontTurnLaneArrow(isW == LEFT_TWO_BIT_MASK?false : true).bitmap;
|
||||
Bitmap UTurnLaneArrow = getRenderUTurnLaneArrow(isW == UTURN_BIT_MASK?false : true).bitmap;
|
||||
|
||||
int translationX = 0;
|
||||
int translationY = LANE_HEIGHT / 4;
|
||||
@@ -864,8 +864,8 @@ public class LaneMarkTools {
|
||||
|
||||
Bitmap bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
Bitmap UTurnLaneArrow = getRenderUTurnLaneArrow(isW != UTURN_BIT_MASK).bitmap;
|
||||
Bitmap rightFrontTurnLaneArrow = getRenderRightFrontTurnLaneArrow(isW != RIGHT_TWO_BIT_MASK).bitmap;
|
||||
Bitmap UTurnLaneArrow = getRenderUTurnLaneArrow(isW == UTURN_BIT_MASK ? false : true).bitmap;
|
||||
Bitmap rightFrontTurnLaneArrow = getRenderRightFrontTurnLaneArrow(isW == RIGHT_TWO_BIT_MASK ? false : true).bitmap;
|
||||
Paint paint = new Paint();
|
||||
paint.setColor(Color.WHITE);
|
||||
paint.setStyle(Style.STROKE);
|
||||
@@ -873,7 +873,7 @@ public class LaneMarkTools {
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
float translationX = -ARC_RADIUS;
|
||||
float translationY = LANE_HEIGHT / 4.0f;
|
||||
float translationY = LANE_HEIGHT / 4;
|
||||
canvas.save();
|
||||
if(isW != UTURN_BIT_MASK)
|
||||
{
|
||||
@@ -884,8 +884,8 @@ public class LaneMarkTools {
|
||||
|
||||
if(isW != RIGHT_TWO_BIT_MASK)
|
||||
{
|
||||
translationX = RIGHT_FRONT_TURN_SLOPE_WIDTH / 2.0f;
|
||||
translationY = -(LANE_HEIGHT / 8.0f);
|
||||
translationX = RIGHT_FRONT_TURN_SLOPE_WIDTH / 2;
|
||||
translationY = -(LANE_HEIGHT / 8);
|
||||
canvas.translate(translationX, translationY);
|
||||
canvas.drawBitmap(rightFrontTurnLaneArrow, 0, 0, paint);
|
||||
canvas.translate(-translationX, -translationY);
|
||||
@@ -894,15 +894,15 @@ public class LaneMarkTools {
|
||||
if(isW == UTURN_BIT_MASK)
|
||||
{
|
||||
translationX = -ARC_RADIUS;
|
||||
translationY = LANE_HEIGHT / 4.0f;
|
||||
translationY = LANE_HEIGHT / 4;
|
||||
canvas.translate(translationX, translationY);
|
||||
canvas.drawBitmap(UTurnLaneArrow, 0, 0, paint);
|
||||
canvas.translate(-translationX, -translationY);
|
||||
}
|
||||
else if(isW == RIGHT_TWO_BIT_MASK)
|
||||
{
|
||||
translationX = RIGHT_FRONT_TURN_SLOPE_WIDTH / 2.0f;
|
||||
translationY = -(LANE_HEIGHT / 8.0f);
|
||||
translationX = RIGHT_FRONT_TURN_SLOPE_WIDTH / 2;
|
||||
translationY = -(LANE_HEIGHT / 8);
|
||||
canvas.translate(translationX, translationY);
|
||||
canvas.drawBitmap(rightFrontTurnLaneArrow, 0, 0, paint);
|
||||
canvas.translate(-translationX, -translationY);
|
||||
@@ -918,7 +918,7 @@ public class LaneMarkTools {
|
||||
return info;
|
||||
}
|
||||
|
||||
//直行 + 左转 + 右转
|
||||
//直行 + 左转 + 右转ֱ<EFBFBD><EFBFBD> + <20><>ת + <20><>ת
|
||||
public BitmapInfo getRenderStraightAddLeftRightTurnLaneArrow(int isW)
|
||||
{
|
||||
int width = LANE_WIDTH;
|
||||
@@ -934,8 +934,8 @@ public class LaneMarkTools {
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
Bitmap straightLaneArrow = getRenderStraightLaneArrow(isW).bitmap;
|
||||
Bitmap leftFrontTurnArrow = getRenderLeftFrontTurnLaneArrow(isW != LEFT_TWO_BIT_MASK).bitmap;
|
||||
Bitmap RightFrontTurnArrow = getRenderRightFrontTurnLaneArrow(isW != RIGHT_TWO_BIT_MASK).bitmap;
|
||||
Bitmap leftFrontTurnArrow = getRenderLeftFrontTurnLaneArrow(isW == LEFT_TWO_BIT_MASK ? false : true).bitmap;
|
||||
Bitmap RightFrontTurnArrow = getRenderRightFrontTurnLaneArrow(isW == RIGHT_TWO_BIT_MASK ? false : true).bitmap;
|
||||
int translationX = -(LEFT_FRONT_TURN_SLOPE_WIDTH / 2);
|
||||
int translationY = LANE_HEIGHT / 6;
|
||||
canvas.save();
|
||||
@@ -1015,7 +1015,7 @@ public class LaneMarkTools {
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
Bitmap straightLaneArrow = getRenderStraightLaneArrow(type).bitmap;
|
||||
Bitmap UTurnLaneArrow = getRenderUTurnLaneArrow(type != UTURN_BIT_MASK).bitmap;
|
||||
Bitmap UTurnLaneArrow = getRenderUTurnLaneArrow(type == UTURN_BIT_MASK ? false : true).bitmap;
|
||||
|
||||
int translationX = -ARC_RADIUS;
|
||||
int translationY = LANE_HEIGHT / 4;
|
||||
@@ -1228,7 +1228,7 @@ public class LaneMarkTools {
|
||||
}else if(mark.isUTurn)
|
||||
{
|
||||
//获取 "调头" 车道箭头图元
|
||||
bitmap = getRenderUTurnLaneArrow(highType != UTURN_BIT_MASK);
|
||||
bitmap = getRenderUTurnLaneArrow(highType == UTURN_BIT_MASK ? false : true);
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
|
||||
@@ -530,7 +530,7 @@ class MapEngine {
|
||||
}
|
||||
}
|
||||
|
||||
fun setHDTypeVisibile(type: IntArray?) {
|
||||
fun setHDTypeVisible(type: IntArray?) {
|
||||
if (mObj != 0L) {
|
||||
setHDTypeVisibileJni(mObj, type)
|
||||
}
|
||||
@@ -821,10 +821,16 @@ class MapEngine {
|
||||
} else false
|
||||
}
|
||||
|
||||
fun updateBatchAnchorPositon(dataStr: String): Boolean {
|
||||
return if (mObj != 0L) {
|
||||
updateBatchAnchorPositonJni(mObj, dataStr)
|
||||
} else false
|
||||
// fun updateBatchAnchorPositon(dataStr: String): Boolean {
|
||||
// return if (mObj != 0L) {
|
||||
// updateBatchAnchorPositonJni(mObj, dataStr)
|
||||
// } else false
|
||||
// }
|
||||
|
||||
fun updateBatchAnchorPositon(data: ByteArray?): Boolean{
|
||||
return if(mObj != 0L){
|
||||
updateBatchAnchorPositonJni(mObj,data);
|
||||
}else false
|
||||
}
|
||||
|
||||
fun setAnchorFlash(id: String, colorType: Int, color: String, time: Float, angle: Float) {
|
||||
@@ -1534,7 +1540,9 @@ class MapEngine {
|
||||
private external fun isAnchorDynamicMovingJni(obj: Long, anchorID: String): Boolean
|
||||
|
||||
//批量更新
|
||||
private external fun updateBatchAnchorPositonJni(obj: Long, dataStr: String): Boolean
|
||||
// private external fun updateBatchAnchorPositonJni(obj: Long, dataStr: String): Boolean
|
||||
|
||||
private external fun updateBatchAnchorPositonJni(obj: Long, data: ByteArray?): Boolean
|
||||
|
||||
private external fun setAnchorFlashJni(
|
||||
obj: Long,
|
||||
|
||||
@@ -5,7 +5,10 @@ import android.graphics.Bitmap
|
||||
import android.graphics.Point
|
||||
import android.opengl.GLException
|
||||
import android.opengl.GLSurfaceView
|
||||
import android.os.*
|
||||
import android.os.Build
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Message
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import android.view.GestureDetector
|
||||
@@ -29,10 +32,9 @@ import com.zhidaoauto.map.sdk.open.MapAutoApi
|
||||
import com.zhidaoauto.map.sdk.open.abs.IRenderData
|
||||
import com.zhidaoauto.map.sdk.open.abs.marker.OnMarkerDragListener
|
||||
import com.zhidaoauto.map.sdk.open.abs.view.IMapStyleParams
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerInfo
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools
|
||||
import com.zhidaoauto.map.sdk.open.common.tools.MapTools
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.Marker
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.MarkerOptions
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
@@ -142,42 +144,38 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
// 耗时专用协程
|
||||
private val mDemaningScope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||
|
||||
private var mHandler:Handler
|
||||
init {
|
||||
val mapViewThread = HandlerThread("mapViewDrawer")
|
||||
mapViewThread.start()
|
||||
mHandler = object : Handler(mapViewThread.looper) {
|
||||
override fun handleMessage(msg: Message) {
|
||||
when (msg.what) {
|
||||
ZOOM_CHANGE -> mMapController?.dispatchZoomChanged(msg.obj as Float)
|
||||
// ROTATE_CHANGE ->mMapController?.dispatchRotationAngleChanged((msg.obj as Float))
|
||||
// DAngle_CHANGE -> mMapController?.dispatchDAngleChanged()
|
||||
// FOCUS_CHANGE -> mMapController?.dispatchFocusChanged()
|
||||
RENDER_CHANGE -> {
|
||||
mEventController?.dispatchRenderListener(msg.arg1)
|
||||
}
|
||||
RENDER_COMPLETE -> {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "mapop--load render complete-start")
|
||||
}
|
||||
// CommonEventController.instance?.dispatchCameraChangeFinishListener(CommonController.instance.mapAutoView?.getMapAutoViewHelper()?.getCameraPosition() ?: null)
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "mapop--load render complete-end")
|
||||
}
|
||||
}
|
||||
LOAD_COMPLETE -> {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "mapop--load complete-start")
|
||||
}
|
||||
mEventController?.dispatchMapLoadedListener()
|
||||
}
|
||||
|
||||
INIT_COMPLETE -> {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "mapop--init complete-start")
|
||||
}
|
||||
mEventController?.dispatchMapLoadedInitListener()
|
||||
private val mHandler: Handler = object : Handler(Looper.getMainLooper()) {
|
||||
override fun handleMessage(msg: Message) {
|
||||
when (msg.what) {
|
||||
ZOOM_CHANGE -> mMapController?.dispatchZoomChanged(msg.obj as Float)
|
||||
ROTATE_CHANGE ->mMapController?.dispatchRotationAngleChanged((msg.obj as Float))
|
||||
DAngle_CHANGE -> mMapController?.dispatchDAngleChanged(msg.obj as Float)
|
||||
FOCUS_CHANGE -> mMapController?.dispatchFocusChanged()
|
||||
RENDER_CHANGE -> {
|
||||
mEventController?.dispatchRenderListener(msg.arg1)
|
||||
}
|
||||
RENDER_COMPLETE -> {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "mapop--load render complete-start")
|
||||
}
|
||||
// CommonEventController.instance?.dispatchCameraChangeFinishListener(CommonController.instance.mapAutoView?.getMapAutoViewHelper()?.getCameraPosition() ?: null)
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "mapop--load render complete-end")
|
||||
}
|
||||
}
|
||||
LOAD_COMPLETE -> {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "mapop--load complete-start")
|
||||
}
|
||||
mEventController?.dispatchMapLoadedListener()
|
||||
}
|
||||
|
||||
INIT_COMPLETE -> {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "mapop--init complete-start")
|
||||
}
|
||||
mEventController?.dispatchMapLoadedInitListener()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -337,8 +335,8 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
|
||||
private var x = 0.0
|
||||
private var y = 0.0
|
||||
private fun jsonToObj(json: String?): MarkerInfo? {
|
||||
return JSON.parseObject(json, MarkerInfo::class.java)
|
||||
private fun jsonToObj(json: String?): com.zhidaoauto.map.sdk.open.renders.marker.MarkerInfo? {
|
||||
return JSON.parseObject(json, com.zhidaoauto.map.sdk.open.renders.marker.MarkerInfo::class.java)
|
||||
}
|
||||
|
||||
private var isTouchingFlag = false
|
||||
@@ -720,9 +718,9 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
}
|
||||
mMapEngine.setIsEnableShadow(mMapStyleParams.isShadowEnable())
|
||||
loadOverCallbak()
|
||||
// if(mMapStyleParams.getHDVisibileArray().isNotEmpty()){
|
||||
// mMapEngine.setHDTypeVisibile(mMapStyleParams.getHDVisibileArray())
|
||||
// }
|
||||
if(mMapStyleParams.getHDVisibileArray().isNotEmpty()){
|
||||
mMapEngine.setHDTypeVisible(mMapStyleParams.getHDVisibileArray())
|
||||
}
|
||||
//默认锁车模式
|
||||
mMapEngine.setLockSelfCar(true)
|
||||
mMapController?.setMapStyle(styleMode)
|
||||
@@ -751,6 +749,8 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
if(mMapStyleParams.isSkyBoxEnable()) {
|
||||
mMapController?.setSkyBoxMode()
|
||||
}
|
||||
isFling = false
|
||||
isRotate = false
|
||||
mSurfaceCreated.set(true)
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "mapop-surfaceop--selfop--onSurfaceCreated:${mSurfaceCreated}")
|
||||
@@ -857,7 +857,8 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
val markerInfo = jsonToObj(resultInfo)
|
||||
|
||||
if (markerInfo != null) {
|
||||
val marker: Marker = Marker(MarkerOptions(markerInfo.id,null).setGps(true).position(
|
||||
val marker: Marker = Marker(
|
||||
MarkerOptions(markerInfo.id,null).setGps(true).position(
|
||||
LonLatPoint(markerInfo.lon, markerInfo.lat)
|
||||
).setAssInfo(markerInfo.assInfo),mMapController,mMarkerCall)
|
||||
lastClickMarker?.let {
|
||||
@@ -1083,13 +1084,13 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
private var isScroll = true
|
||||
|
||||
//可以斜滑
|
||||
private var isFling = false
|
||||
private var isFling = true
|
||||
|
||||
//可以旋转
|
||||
private var isRotate = false
|
||||
private var isRotate = true
|
||||
|
||||
//可以缩放
|
||||
private var isCanZoom = false
|
||||
private var isCanZoom = true
|
||||
|
||||
private var isVr = true
|
||||
|
||||
@@ -1151,16 +1152,10 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
}
|
||||
|
||||
fun onMapFocusChanging() {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "mapop--onMapFocusChanging")
|
||||
}
|
||||
mHandler.sendEmptyMessage(FOCUS_CHANGE)
|
||||
}
|
||||
|
||||
fun onMapZoomChanging(zoomIndex: Float) {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "mapop--onMapZoomChanging--:${zoomIndex}")
|
||||
}
|
||||
val msg = Message.obtain()
|
||||
msg.what = ZOOM_CHANGE
|
||||
msg.obj = zoomIndex
|
||||
@@ -1168,9 +1163,6 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
}
|
||||
|
||||
fun onMapRAngleChanging(angle:Float) {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "mapop--onMapRAngleChanging:${angle}")
|
||||
}
|
||||
val msg = Message.obtain()
|
||||
msg.what = ROTATE_CHANGE
|
||||
msg.obj = angle
|
||||
@@ -1178,9 +1170,6 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
}
|
||||
|
||||
fun onMapDAngleChanging(angle:Float) {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "mapop--onMapDAngleChanging:${angle}")
|
||||
}
|
||||
val msg = Message.obtain()
|
||||
msg.what = DAngle_CHANGE
|
||||
msg.obj = angle
|
||||
@@ -1276,9 +1265,9 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
}
|
||||
|
||||
private fun renderDataCallback(data: String) {
|
||||
if(DEBUG){
|
||||
Log.d("renderDataCallback", "renderDataCallback:$data")
|
||||
}
|
||||
// if(DEBUG){
|
||||
// Log.d("renderDataCallback", "renderDataCallback:$data")
|
||||
// }
|
||||
renderDataCall?.renderDataResult(data)
|
||||
}
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ import com.zhidaoauto.map.sdk.open.abs.OnRoadSideFenceRegionListener
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnRoamStatusListener
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnScrollListener
|
||||
import com.zhidaoauto.map.sdk.open.abs.log.ILog
|
||||
import com.zhidaoauto.map.sdk.open.camera.CameraPosition
|
||||
import com.zhidaoauto.map.sdk.open.location.MogoLocation
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker
|
||||
import com.zhidaoauto.map.sdk.open.marker.OnMarkClickListener
|
||||
import com.zhidaoauto.map.sdk.open.logics.camera.CameraPosition
|
||||
import com.zhidaoauto.map.sdk.open.logics.location.MogoLocation
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.Marker
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.OnMarkClickListener
|
||||
|
||||
interface IEventController {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.zhidaoauto.map.sdk.inner.abs
|
||||
|
||||
import com.zhidaoauto.map.sdk.open.location.MyLocationStyle
|
||||
import com.zhidaoauto.map.sdk.open.logics.location.MyLocationStyle
|
||||
|
||||
interface ILocationView {
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@ import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
import com.zhidaoauto.map.sdk.inner.element.MapCoordinate
|
||||
import com.zhidaoauto.map.sdk.inner.use.Clerk
|
||||
import com.zhidaoauto.map.sdk.open.abs.view.IMapStyleParams
|
||||
import com.zhidaoauto.map.sdk.open.circle.CircleController
|
||||
import com.zhidaoauto.map.sdk.open.circle.CircleOptions
|
||||
import com.zhidaoauto.map.sdk.open.deadzone.DeadZone
|
||||
import com.zhidaoauto.map.sdk.open.deadzone.DeadZoneOptions
|
||||
import com.zhidaoauto.map.sdk.open.poyline.Polyline
|
||||
import com.zhidaoauto.map.sdk.open.poyline.PolylineOptions
|
||||
import com.zhidaoauto.map.sdk.open.weather.WeatherResult
|
||||
import com.zhidaoauto.map.sdk.open.logics.circle.CircleController
|
||||
import com.zhidaoauto.map.sdk.open.logics.circle.CircleOptions
|
||||
import com.zhidaoauto.map.sdk.open.logics.deadzone.DeadZone
|
||||
import com.zhidaoauto.map.sdk.open.logics.deadzone.DeadZoneOptions
|
||||
import com.zhidaoauto.map.sdk.open.renders.poyline.Polyline
|
||||
import com.zhidaoauto.map.sdk.open.renders.poyline.PolylineOptions
|
||||
import com.zhidaoauto.map.sdk.open.logics.weather.WeatherResult
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
|
||||
interface IMapController {
|
||||
@@ -405,7 +405,9 @@ interface IMapController {
|
||||
fun isAnchorDynamicMoving(anchorID: String): Boolean
|
||||
|
||||
//批量更新
|
||||
fun updateBatchAnchorPositon(dataStr: String): Boolean
|
||||
// fun updateBatchAnchorPositon(dataStr: String): Boolean
|
||||
|
||||
fun updateBatchAnchorPositon(data: ByteArray?): Boolean
|
||||
|
||||
fun setAnchorFlash(id: String, colorType: Int, color: String, time: Float, angle: Float)
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ package com.zhidaoauto.map.sdk.inner.abs
|
||||
import android.graphics.Rect
|
||||
import com.zhidaoauto.map.sdk.inner.marker.IInfoViewClick
|
||||
import com.zhidaoauto.map.sdk.open.abs.marker.OnMarkerDragListener
|
||||
import com.zhidaoauto.map.sdk.open.marker.OnAnimationListener
|
||||
import com.zhidaoauto.map.sdk.open.marker.OnInfoWindowClickListener
|
||||
import com.zhidaoauto.map.sdk.open.marker.OnMarkClickListener
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.OnAnimationListener
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.OnInfoWindowClickListener
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.OnMarkClickListener
|
||||
|
||||
interface IMarkerCall {
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.zhidaoauto.map.sdk.inner.abs
|
||||
|
||||
import com.zhidaoauto.map.sdk.open.abs.marker.InfoWindowAdapter
|
||||
import com.zhidaoauto.map.sdk.open.marker.BatchMarkerOptions
|
||||
import com.zhidaoauto.map.sdk.open.marker.CarInfo
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions
|
||||
import com.zhidaoauto.map.sdk.open.marker.MultiPointController
|
||||
import com.zhidaoauto.map.sdk.open.marker.MultiPointOverlayOptions
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.BatchMarkerOptions
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.CarInfo
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.Marker
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.MarkerOptions
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.MultiPointController
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.MultiPointOverlayOptions
|
||||
|
||||
interface IMarkerController {
|
||||
|
||||
@@ -27,7 +27,7 @@ interface IMarkerController {
|
||||
/**
|
||||
* 批量更新他车
|
||||
*/
|
||||
fun updateBatchMarkerPositon(batchMarkerOptions: BatchMarkerOptions)
|
||||
fun updateBatchMarkerPositon(batchMarkerOptions: com.zhidaoauto.map.sdk.open.renders.marker.BatchMarkerOptions)
|
||||
//根据车辆类型预添加车辆模型
|
||||
fun addPreVehicleModel(type:Int,modelRes:Int):String?
|
||||
//添加普通模型
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.zhidaoauto.map.sdk.inner.abs
|
||||
|
||||
import com.zhidaoauto.map.sdk.open.nav.NavPoi
|
||||
import com.zhidaoauto.map.sdk.open.nav.abs.NaviListener
|
||||
import com.zhidaoauto.map.sdk.open.nav.model.NaviPath
|
||||
import com.zhidaoauto.map.sdk.open.nav.model.NaviSetting
|
||||
import com.zhidaoauto.map.sdk.open.logics.nav.NavPoi
|
||||
import com.zhidaoauto.map.sdk.open.logics.nav.abs.NaviListener
|
||||
import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviPath
|
||||
import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviSetting
|
||||
|
||||
interface INaviController {
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.zhidaoauto.map.sdk.inner.abs
|
||||
|
||||
interface IWeatherController {
|
||||
|
||||
fun destory()
|
||||
|
||||
fun setWeahterEnable(enable:Boolean)
|
||||
|
||||
fun updateLocation(lon:Double,lat:Double)
|
||||
}
|
||||
@@ -39,10 +39,8 @@ public class PayloadEncoder {
|
||||
switch (typeName) {
|
||||
case "com.autonavi.nge.map.LonLat":
|
||||
LonLat lonLat = (LonLat) value;
|
||||
if(lonLat != null){
|
||||
buffer.writeDouble(lonLat.getLon());
|
||||
buffer.writeDouble(lonLat.getLat());
|
||||
}
|
||||
buffer.writeDouble(lonLat.getLon());
|
||||
buffer.writeDouble(lonLat.getLat());
|
||||
break;
|
||||
case "java.lang.Boolean":
|
||||
case "kotlin.Boolean":
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.zhidaoauto.map.sdk.open.city
|
||||
package com.zhidaoauto.map.sdk.inner.cloud.city
|
||||
|
||||
import android.util.Log
|
||||
import com.zhidao.map.net.api.Result
|
||||
import com.zhidaoauto.map.sdk.inner.CompileConfig
|
||||
import com.zhidaoauto.map.sdk.inner.controller.CommonController
|
||||
import com.zhidaoauto.map.sdk.open.logics.city.CityCodeInfo
|
||||
import com.zhidaoauto.map.sdk.open.logics.city.CityCodeResult
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.zhidaoauto.map.sdk.open.city
|
||||
package com.zhidaoauto.map.sdk.inner.cloud.city
|
||||
|
||||
import com.zhidao.map.net.api.BaseRepository
|
||||
import com.zhidao.map.net.api.Result
|
||||
import com.zhidaoauto.map.sdk.open.net.CityCodeRetrofitClient
|
||||
import com.zhidaoauto.map.sdk.inner.cloud.net.CityCodeRetrofitClient
|
||||
import com.zhidaoauto.map.sdk.open.logics.city.CityCodeInfo
|
||||
|
||||
|
||||
class CityCodeRepository: BaseRepository() {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.navi
|
||||
package com.zhidaoauto.map.sdk.inner.cloud.navi
|
||||
|
||||
import com.zhidao.map.net.api.Result
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.zhidaoauto.map.sdk.open.navi
|
||||
package com.zhidaoauto.map.sdk.inner.cloud.navi
|
||||
|
||||
import com.zhidao.map.net.api.BaseRepository
|
||||
import com.zhidao.map.net.api.Result
|
||||
import com.zhidaoauto.map.sdk.open.net.NavRetrofitClient
|
||||
import com.zhidaoauto.map.sdk.inner.cloud.net.NavRetrofitClient
|
||||
import com.zhidaoauto.map.sdk.open.logics.navi.NaviResponse
|
||||
|
||||
class NaviRepository: BaseRepository() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.net
|
||||
package com.zhidaoauto.map.sdk.inner.cloud.net
|
||||
|
||||
|
||||
import android.util.Log
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.zhidaoauto.map.sdk.open.net
|
||||
package com.zhidaoauto.map.sdk.inner.cloud.net
|
||||
|
||||
import com.zhidao.map.net.api.BaseResponse
|
||||
import com.zhidaoauto.map.sdk.open.city.CityCodeInfo
|
||||
import com.zhidaoauto.map.sdk.open.logics.city.CityCodeInfo
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Query
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.net
|
||||
package com.zhidaoauto.map.sdk.inner.cloud.net
|
||||
|
||||
|
||||
import android.util.Log
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.zhidaoauto.map.sdk.open.net
|
||||
package com.zhidaoauto.map.sdk.inner.cloud.net
|
||||
|
||||
|
||||
import com.zhidao.map.net.api.BaseResponse
|
||||
import com.zhidaoauto.map.sdk.open.navi.NaviResponse
|
||||
import com.zhidaoauto.map.sdk.open.logics.navi.NaviResponse
|
||||
import retrofit2.http.*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.net
|
||||
package com.zhidaoauto.map.sdk.inner.cloud.net
|
||||
|
||||
|
||||
import android.util.Log
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.zhidaoauto.map.sdk.open.net
|
||||
package com.zhidaoauto.map.sdk.inner.cloud.net
|
||||
|
||||
import com.zhidao.map.net.api.BaseResponse
|
||||
import com.zhidaoauto.map.sdk.open.weather.WeatherInfo
|
||||
import com.zhidaoauto.map.sdk.open.logics.weather.WeatherInfo
|
||||
import retrofit2.http.FieldMap
|
||||
import retrofit2.http.FormUrlEncoded
|
||||
import retrofit2.http.POST
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.zhidaoauto.map.sdk.open.weather
|
||||
package com.zhidaoauto.map.sdk.inner.cloud.weather
|
||||
|
||||
import android.util.Log
|
||||
import com.zhidao.map.net.api.Result
|
||||
import com.zhidaoauto.map.sdk.inner.CompileConfig
|
||||
import com.zhidaoauto.map.sdk.inner.controller.CommonController
|
||||
import com.zhidaoauto.map.sdk.open.logics.weather.WeatherInfo
|
||||
import com.zhidaoauto.map.sdk.open.logics.weather.WeatherResult
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.zhidaoauto.map.sdk.open.weather
|
||||
package com.zhidaoauto.map.sdk.inner.cloud.weather
|
||||
|
||||
import com.zhidao.map.net.api.BaseRepository
|
||||
import com.zhidao.map.net.api.Result
|
||||
import com.zhidaoauto.map.sdk.open.net.WeatherRetrofitClient
|
||||
import com.zhidaoauto.map.sdk.inner.cloud.net.WeatherRetrofitClient
|
||||
import com.zhidaoauto.map.sdk.open.logics.weather.WeatherInfo
|
||||
|
||||
|
||||
class WeatherRepository: BaseRepository() {
|
||||
@@ -139,7 +139,6 @@ object ConstantExt {
|
||||
const val MAP_STYLE_VR_ZOOM_VAL_SKYBOX = 0.8f//缩放
|
||||
const val MAP_STYLE_VR_EYE_HEIGHT_SKYBOX = 12f//高度
|
||||
const val MAP_STYLE_VR_ANIMATE_TIME_SKYBOX = 1500
|
||||
|
||||
//默认尾灯不亮
|
||||
const val SELF_CAR_DEFAULT = 0
|
||||
//尾灯左黄
|
||||
@@ -177,7 +176,7 @@ object ConstantExt {
|
||||
|
||||
//设置天空盒
|
||||
const val FOG = "fog"
|
||||
const val SKYBOX = "skybox"
|
||||
const val SKYBOX = "skyboxView"
|
||||
const val ROADTEXSIZE = "roadTexSize"
|
||||
const val ROAD = "roadUseTex"
|
||||
const val PLANE = "planeUseTex"
|
||||
|
||||
@@ -2,9 +2,10 @@ package com.zhidaoauto.map.sdk.inner.common
|
||||
|
||||
import com.zhidaoauto.map.sdk.open.NavParams
|
||||
|
||||
|
||||
object NavHelper {
|
||||
|
||||
var mNavParams:NavParams = NavParams.init()
|
||||
var mNavParams: NavParams = NavParams.init()
|
||||
|
||||
fun init(navParams: NavParams){
|
||||
mNavParams = navParams
|
||||
|
||||
@@ -22,10 +22,10 @@ import com.zhidaoauto.map.sdk.open.abs.OnRoadSideFenceRegionListener
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnRoamStatusListener
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnScrollListener
|
||||
import com.zhidaoauto.map.sdk.open.abs.log.ILog
|
||||
import com.zhidaoauto.map.sdk.open.camera.CameraPosition
|
||||
import com.zhidaoauto.map.sdk.open.location.MogoLocation
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker
|
||||
import com.zhidaoauto.map.sdk.open.marker.OnMarkClickListener
|
||||
import com.zhidaoauto.map.sdk.open.logics.camera.CameraPosition
|
||||
import com.zhidaoauto.map.sdk.open.logics.location.MogoLocation
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.Marker
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.OnMarkClickListener
|
||||
|
||||
class MapEventController(): IEventController {
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.location.Location;
|
||||
|
||||
import com.autonavi.nge.obj.DestObj;
|
||||
import com.autonavi.nge.obj.PoiBase;
|
||||
import com.zhidaoauto.map.sdk.open.nav.NavPoi;
|
||||
import com.zhidaoauto.map.sdk.open.logics.nav.NavPoi;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
@@ -6,13 +6,13 @@ import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class M3DCar {
|
||||
private final Context context;
|
||||
private final int redis;
|
||||
private Context context;
|
||||
private int resid;
|
||||
public byte[] totBuffer = null;
|
||||
public int totSize = 0;
|
||||
|
||||
public M3DCar(Context context, int redis) {
|
||||
this.redis = redis;
|
||||
public M3DCar(Context context, int resid) {
|
||||
this.resid = resid;
|
||||
this.context = context;
|
||||
loadData();
|
||||
}
|
||||
@@ -20,12 +20,12 @@ public class M3DCar {
|
||||
private void loadData() {
|
||||
if (null != totBuffer)
|
||||
return;
|
||||
;
|
||||
DataInputStream dis = new DataInputStream(context.getResources().openRawResource(resid));
|
||||
int curTotSize = 64 * 1024;
|
||||
totBuffer = new byte[curTotSize];
|
||||
byte[] buffer = new byte[1024];
|
||||
int size;
|
||||
try(DataInputStream dis = new DataInputStream(context.getResources().openRawResource(redis))) {
|
||||
int size = 0;
|
||||
try {
|
||||
while ((size = dis.read(buffer)) >= 0) {
|
||||
if (totSize + size > curTotSize) {
|
||||
curTotSize = (totSize + size) * 3 / 2;
|
||||
@@ -36,8 +36,8 @@ public class M3DCar {
|
||||
System.arraycopy(buffer, 0, totBuffer, totSize, size);
|
||||
totSize += size;
|
||||
}
|
||||
dis.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.zhidaoauto.map.sdk.inner.abs.IMapController
|
||||
import com.zhidaoauto.map.sdk.inner.abs.IMarkerController
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi
|
||||
import com.zhidaoauto.map.sdk.open.abs.view.IMapStyleParams
|
||||
import com.zhidaoauto.map.sdk.open.location.MyLocationStyle
|
||||
import com.zhidaoauto.map.sdk.open.logics.location.MyLocationStyle
|
||||
import io.netty.util.internal.StringUtil
|
||||
|
||||
class LocationHelper(
|
||||
|
||||
@@ -2,9 +2,9 @@ package com.zhidaoauto.map.sdk.inner.map
|
||||
|
||||
import android.graphics.Point
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
import com.zhidaoauto.map.sdk.open.camera.CameraPosition
|
||||
import com.zhidaoauto.map.sdk.open.camera.LatLngBounds
|
||||
import com.zhidaoauto.map.sdk.open.camera.MapCameraMessage
|
||||
import com.zhidaoauto.map.sdk.open.logics.camera.CameraPosition
|
||||
import com.zhidaoauto.map.sdk.open.logics.camera.LatLngBounds
|
||||
import com.zhidaoauto.map.sdk.open.logics.camera.MapCameraMessage
|
||||
|
||||
class MapCameraMessageImpl private constructor() : MapCameraMessage() {
|
||||
/* private var a: Float = 0.toFloat()
|
||||
|
||||
@@ -28,22 +28,18 @@ import com.zhidaoauto.map.sdk.inner.marker.RecycleController
|
||||
import com.zhidaoauto.map.sdk.inner.panel.PolyLineView
|
||||
import com.zhidaoauto.map.sdk.inner.road.RoadHelper
|
||||
import com.zhidaoauto.map.sdk.inner.use.Clerk
|
||||
import com.zhidaoauto.map.sdk.inner.utils.GisGeomTool
|
||||
import com.zhidaoauto.map.sdk.inner.utils.LogHelper
|
||||
import com.zhidaoauto.map.sdk.inner.utils.MathUtils
|
||||
import com.zhidaoauto.map.sdk.inner.utils.TransformUtils
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi
|
||||
import com.zhidaoauto.map.sdk.inner.utils.*
|
||||
import com.zhidaoauto.map.sdk.open.abs.IResult
|
||||
import com.zhidaoauto.map.sdk.open.abs.view.IMapStyleParams
|
||||
import com.zhidaoauto.map.sdk.open.circle.CircleController
|
||||
import com.zhidaoauto.map.sdk.open.circle.CircleOptions
|
||||
import com.zhidaoauto.map.sdk.open.deadzone.DeadZone
|
||||
import com.zhidaoauto.map.sdk.open.deadzone.DeadZoneOptions
|
||||
import com.zhidaoauto.map.sdk.open.poyline.Polyline
|
||||
import com.zhidaoauto.map.sdk.open.poyline.PolylineOptions
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools
|
||||
import com.zhidaoauto.map.sdk.open.weather.WeatherModel
|
||||
import com.zhidaoauto.map.sdk.open.weather.WeatherResult
|
||||
import com.zhidaoauto.map.sdk.open.logics.circle.CircleController
|
||||
import com.zhidaoauto.map.sdk.open.logics.circle.CircleOptions
|
||||
import com.zhidaoauto.map.sdk.open.logics.deadzone.DeadZone
|
||||
import com.zhidaoauto.map.sdk.open.logics.deadzone.DeadZoneOptions
|
||||
import com.zhidaoauto.map.sdk.open.renders.poyline.Polyline
|
||||
import com.zhidaoauto.map.sdk.open.renders.poyline.PolylineOptions
|
||||
import com.zhidaoauto.map.sdk.open.common.tools.MapTools
|
||||
import com.zhidaoauto.map.sdk.inner.cloud.weather.WeatherModel
|
||||
import com.zhidaoauto.map.sdk.open.logics.weather.WeatherResult
|
||||
import io.netty.util.internal.StringUtil
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -66,10 +62,8 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
private var mMapPerspective = MAP_PERSPECTIVE_2D
|
||||
private var isFollowCarMode = true
|
||||
private var isMapNorth = false
|
||||
@Volatile
|
||||
private var lastZoom = 16
|
||||
private var lonLat: LonLat? = null
|
||||
@Volatile
|
||||
private var isSetMapStyle = false
|
||||
private var mRoamDis = ConstantExt.ROAM_DIS_1KM
|
||||
private var mSpeed = ConstantExt.ROAM_SPEED_30
|
||||
@@ -544,8 +538,12 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
return mMapView.getMapEngine().isAnchorDynamicMoving(anchorID)
|
||||
}
|
||||
|
||||
override fun updateBatchAnchorPositon(dataStr: String): Boolean {
|
||||
return mMapView.getMapEngine().updateBatchAnchorPositon(dataStr)
|
||||
// override fun updateBatchAnchorPositon(dataStr: String): Boolean {
|
||||
// return mMapView.getMapEngine().updateBatchAnchorPositon(dataStr)
|
||||
// }
|
||||
|
||||
override fun updateBatchAnchorPositon(data: ByteArray?): Boolean {
|
||||
return mMapView.getMapEngine().updateBatchAnchorPositon(data)
|
||||
}
|
||||
|
||||
override fun setAnchorFlash(id: String, colorType: Int, color: String, time: Float, angle: Float) {
|
||||
@@ -682,9 +680,6 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
// lis.onMapStatusChangeListener(LISTENER_TYPE_ROTATE, rotateAngle.toInt())
|
||||
// }
|
||||
// }
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "styleop-dispatchRotationAngleChanged: $rotateAngle")
|
||||
}
|
||||
mEventController?.dispatchMapStatusListener(LISTENER_TYPE_ROTATE, rotateAngle)
|
||||
mEventController?.dispatchCameraChangeListener(LISTENER_TYPE_ROTATE, rotateAngle)
|
||||
}
|
||||
@@ -697,9 +692,6 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
// lis.onMapStatusChangeListener(LISTENER_TYPE_FOCUS, 0)
|
||||
// }
|
||||
// }
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "styleop-dispatchFocusChanged")
|
||||
}
|
||||
mEventController?.dispatchMapStatusListener(LISTENER_TYPE_FOCUS, 0f)
|
||||
mEventController?.dispatchCameraChangeListener(LISTENER_TYPE_FOCUS, 0f)
|
||||
}
|
||||
@@ -726,18 +718,18 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "styleop--dispatchZoomChanged: currentZoom:${currentZoom}, ${mMapView.getMapEngine().getZoomValue()}, isSetMapStyle: ${isSetMapStyle}, ${getMapStyle()}")
|
||||
}
|
||||
if(getMapStyle() >= 5 && currentZoom >= 19){
|
||||
isSetMapStyle = false
|
||||
}else if(getMapStyle() < 5 && currentZoom < 19){
|
||||
isSetMapStyle = false
|
||||
}
|
||||
if(!isSetMapStyle){
|
||||
if (currentZoom < 19 && mMapStyleParams.getStyleMode() >= MapAutoApi.MAP_STYLE_NIGHT_VR) {
|
||||
setMapStyle(MapAutoApi.MAP_STYLE_NIGHT,false)
|
||||
} else if (currentZoom >= 19 && mMapStyleParams.getStyleMode() < MapAutoApi.MAP_STYLE_NIGHT_VR) {
|
||||
setMapStyle(MapAutoApi.MAP_STYLE_NIGHT_VR,false)
|
||||
}
|
||||
}
|
||||
// if(getMapStyle() >= 5 && currentZoom >= 19){
|
||||
// isSetMapStyle = false
|
||||
// }else if(getMapStyle() < 5 && currentZoom < 19){
|
||||
// isSetMapStyle = false
|
||||
// }
|
||||
// if(!isSetMapStyle){
|
||||
// if (currentZoom < 18 && mMapStyleParams.getStyleMode() >= MapAutoApi.MAP_STYLE_NIGHT_VR) {
|
||||
// setMapStyle(MapAutoApi.MAP_STYLE_NIGHT,false)
|
||||
// } else if (currentZoom >= 18 && mMapStyleParams.getStyleMode() < MapAutoApi.MAP_STYLE_NIGHT_VR) {
|
||||
// setMapStyle(MapAutoApi.MAP_STYLE_NIGHT_VR,false)
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -837,7 +829,6 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
mMapView.getMapEngine().setRotateAngle(rotation)
|
||||
}
|
||||
|
||||
@Volatile
|
||||
var mMapStyleMode = 0
|
||||
|
||||
//设置地图风格
|
||||
@@ -977,6 +968,16 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
var lastAnimZoom = 0f
|
||||
var lastOverLookAngle = 0f
|
||||
var lastEyeHeight = 0f
|
||||
/**
|
||||
* Animates the map to a specified location with optional parameters.
|
||||
*
|
||||
* @param lon Longitude of the target location.
|
||||
* @param lat Latitude of the target location.
|
||||
* @param alt Altitude above the ground at the target location.
|
||||
* @param rotateAngle Rotation angle of the map camera. Positive values rotate the map counter-clockwise,
|
||||
* while negative values rotate it clockwise.
|
||||
* @param mDuration Duration of the animation in milliseconds.
|
||||
*/
|
||||
override fun animateTo(
|
||||
lon: Double,
|
||||
lat: Double,
|
||||
@@ -984,31 +985,30 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
rotateAngle: Float, //加是逆时针,减是顺时针
|
||||
mDuration: Int
|
||||
) {
|
||||
// Step animation to calculate perspective and eye height
|
||||
val arrays = mapAnimate.stepAnimation()
|
||||
if (DEBUG) {
|
||||
Log.d(
|
||||
TAG,
|
||||
"animaop--n:${lon},t:${lat},a:${rotateAngle},z: ${arrays[0]}, la: ${arrays[1]}, eh: ${arrays[2]}"
|
||||
)
|
||||
}
|
||||
mMapStyleParams.setVrPerspectiveMode(arrays[0])
|
||||
mMapStyleParams.setVrEyeHeight(arrays[1])
|
||||
//底层读取中心线的高度,暂时不用轨迹的高度
|
||||
// if(mMapStyleParams.getVrAngleMode()==ConstantExt.MAP_STYLE_VR_BRIDGE){
|
||||
// var fac = 100.0f/(arrays[0]*8f)/20f
|
||||
// var lookAtZ = alt + 5.0f
|
||||
// var cameraHeight = arrays[2] + lookAtZ
|
||||
// arrays[2]=cameraHeight*fac;
|
||||
// mMapView.getMapEngine().setScreenToOriginDis(lookAtZ*fac)
|
||||
// }
|
||||
if (lastAnimZoom == arrays[0] && lastOverLookAngle == arrays[1] && lastEyeHeight == arrays[2]) {
|
||||
|
||||
// Debugging information
|
||||
// if (DEBUG) {
|
||||
// Log.d(TAG, "animaop--n:${lon},t:${lat},a:${rotateAngle},z: ${arrays[0]}, la: ${arrays[1]}, eh: ${arrays[2]}")
|
||||
// }
|
||||
|
||||
// Set VR perspective mode and eye height based on animation step values
|
||||
mMapStyleParams.setVrPerspectiveMode(arrays[0])
|
||||
mMapStyleParams.setVrEyeHeight(arrays[2])
|
||||
|
||||
// Check if the animation parameters have not changed
|
||||
if (lastAnimZoom == arrays[0] && lastOverLookAngle == arrays[1] && lastEyeHeight == arrays[2]) {
|
||||
// Animate to the specified location without changing the overlook angle
|
||||
mMapView.getMapEngine()
|
||||
.animateTo(lon, lat, alt, -1f, rotateAngle, -1f, -1f, mDuration, -1f)
|
||||
} else {
|
||||
// Update last animation parameters
|
||||
lastAnimZoom = arrays[0]
|
||||
lastOverLookAngle = arrays[1]
|
||||
lastEyeHeight = arrays[2]
|
||||
|
||||
// Animate to the specified location with updated animation parameters
|
||||
mMapView.getMapEngine().animateTo(
|
||||
lon,
|
||||
lat,
|
||||
@@ -1021,7 +1021,6 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
-1f
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//设置navi的层级
|
||||
@@ -1298,7 +1297,6 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
var mLastPosition = LonLatPoint()
|
||||
var mRoamPostion = 0
|
||||
var lastViewType = ConstantExt.MAP_STYLE_VR_ANGLE_MIDDLE
|
||||
|
||||
fun enableSkybox(){
|
||||
mMapView.getMapEngine().setCfgKeyVal(ConstantExt.SKYBOX, "enable;" +
|
||||
"${ConstantExt.MAP_STYLE_VR_ANIMATE_TIME_SKYBOX}")
|
||||
@@ -1335,7 +1333,6 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
duration,
|
||||
)
|
||||
}
|
||||
|
||||
override fun setMapViewVisualAngle(type: Int) {
|
||||
mHandler.removeMessages(LOCK_CAR)
|
||||
mHandler.removeMessages(CHANGE_VIEW_ANGLE)
|
||||
@@ -1362,9 +1359,11 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
if (!mLockLocation.getLockCar() && type != ConstantExt.MAP_STYLE_VR_ROAM) {
|
||||
mLockLocation.setLockCar(true)
|
||||
}
|
||||
if(type != ConstantExt.MAP_STYLE_VR_BRIDGE){
|
||||
mMapView.getMapEngine().setCfgKeyVal(ConstantExt.BRIDGE, "disable")
|
||||
}
|
||||
|
||||
// if(type != ConstantExt.MAP_STYLE_VR_BRIDGE){
|
||||
// mMapView.getMapEngine().setCfgKeyVal(ConstantExt.BRIDGE, "disable")
|
||||
// }
|
||||
|
||||
// mMapView.setIsFarViewAngel(false)
|
||||
when (type) {
|
||||
ConstantExt.MAP_STYLE_VR_ANGLE_MIDDLE -> {
|
||||
@@ -1373,8 +1372,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
ConstantExt.MAP_STYLE_VR_OVER_LOOK_ANGLE_MIDDLE,
|
||||
ConstantExt.MAP_STYLE_VR_ZOOM_VAL_MIDDLE,
|
||||
ConstantExt.MAP_STYLE_VR_ANGLE_MIDDLE,
|
||||
-1
|
||||
)
|
||||
-1)
|
||||
}
|
||||
|
||||
ConstantExt.MAP_STYLE_VR_ANGLE_MIDDLE_XIAOBA -> {
|
||||
@@ -1383,8 +1381,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
ConstantExt.MAP_STYLE_VR_OVER_LOOK_ANGLE_MIDDLE_XIAOBA,
|
||||
ConstantExt.MAP_STYLE_VR_ZOOM_VAL_MIDDLE_XIAOBA,
|
||||
ConstantExt.MAP_STYLE_VR_ANGLE_MIDDLE_XIAOBA,
|
||||
-1
|
||||
)
|
||||
-1)
|
||||
}
|
||||
|
||||
ConstantExt.MAP_STYLE_VR_ERHAI_B2 -> {
|
||||
@@ -1399,6 +1396,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
|
||||
ConstantExt.MAP_STYLE_VR_SKY_BOX -> {
|
||||
enableSkybox()
|
||||
|
||||
}
|
||||
|
||||
ConstantExt.MAP_STYLE_VR_ANGLE_FAR -> {
|
||||
@@ -1423,6 +1421,13 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
}
|
||||
|
||||
ConstantExt.MAP_STYLE_VR_ANGLE_NEAR -> {
|
||||
disableSkybox(
|
||||
ConstantExt.MAP_STYLE_VR_EYE_HEIGHT_NEAR,
|
||||
ConstantExt.MAP_STYLE_VR_OVER_LOOK_ANGLE_NEAR,
|
||||
ConstantExt.MAP_STYLE_VR_ZOOM_VAL_NEAR,
|
||||
ConstantExt.MAP_STYLE_VR_ANGLE_NEAR,
|
||||
-1
|
||||
)
|
||||
if (lonLat != null && lonLat!!.lon != 0.0 && lonLat!!.lat != 0.0) {
|
||||
mLockLocation.setLockCar(false)
|
||||
mHandler.sendEmptyMessageDelayed(CHANGE_VIEW_ANGLE, 5000)
|
||||
@@ -1457,7 +1462,6 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
ConstantExt.MAP_STYLE_VR_ANGLE_300,
|
||||
-1
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
ConstantExt.MAP_STYLE_VR_ANGLE_TOP -> {
|
||||
@@ -1468,7 +1472,6 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
ConstantExt.MAP_STYLE_VR_ANGLE_TOP,
|
||||
-1
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
ConstantExt.MAP_STYLE_VR_ANGLE_CROSS -> {
|
||||
@@ -1479,14 +1482,26 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
ConstantExt.MAP_STYLE_VR_ANGLE_CROSS,
|
||||
-1
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
ConstantExt.MAP_STYLE_VR_ROAM -> {
|
||||
disableSkybox(
|
||||
ConstantExt.MAP_STYLE_VR_EYE_HEIGHT_MIDDLE,
|
||||
ConstantExt.MAP_STYLE_VR_OVER_LOOK_ANGLE_MIDDLE,
|
||||
ConstantExt.MAP_STYLE_VR_ZOOM_VAL_MIDDLE,
|
||||
ConstantExt.MAP_STYLE_VR_ANGLE_MIDDLE,
|
||||
-1)
|
||||
setRoamStyle()
|
||||
}
|
||||
|
||||
ConstantExt.MAP_STYLE_VR_TRANS -> {
|
||||
disableSkybox(
|
||||
ConstantExt.MAP_STYLE_VR_EYE_HEIGHT_TRANS,
|
||||
ConstantExt.MAP_STYLE_VR_OVER_LOOK_ANGLE_TRANS,
|
||||
ConstantExt.MAP_STYLE_VR_ZOOM_VAL_TRANS,
|
||||
ConstantExt.MAP_STYLE_VR_TRANS,
|
||||
-1
|
||||
)
|
||||
transJob = getDemaningScope()?.launch(Dispatchers.IO) {
|
||||
destLonLatPoint = mLockLocation.getCurrentLonLatPoint()
|
||||
destLonLatPoint?.let {
|
||||
@@ -1520,17 +1535,17 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
|
||||
}
|
||||
|
||||
ConstantExt.MAP_STYLE_VR_BRIDGE->{
|
||||
mMapView.getMapEngine().setCfgKeyVal(ConstantExt.BRIDGE, "enable")
|
||||
disableSkyboxAndInterpolation(
|
||||
ConstantExt.MAP_STYLE_VR_EYE_HEIGHT_BRIDGE,
|
||||
ConstantExt.MAP_STYLE_VR_OVER_LOOK_ANGLE_BRIDGE,
|
||||
ConstantExt.MAP_STYLE_VR_ZOOM_VAL_BRIDGE,
|
||||
ConstantExt.MAP_STYLE_VR_BRIDGE,
|
||||
-1
|
||||
)
|
||||
|
||||
}
|
||||
// ConstantExt.MAP_STYLE_VR_BRIDGE->{
|
||||
// mMapView.getMapEngine().setCfgKeyVal(ConstantExt.BRIDGE, "enable")
|
||||
// disableSkyboxAndInterpolation(
|
||||
// ConstantExt.MAP_STYLE_VR_EYE_HEIGHT_BRIDGE,
|
||||
// ConstantExt.MAP_STYLE_VR_OVER_LOOK_ANGLE_BRIDGE,
|
||||
// ConstantExt.MAP_STYLE_VR_ZOOM_VAL_BRIDGE,
|
||||
// ConstantExt.MAP_STYLE_VR_BRIDGE,
|
||||
// -1
|
||||
// )
|
||||
//
|
||||
// }
|
||||
}
|
||||
if(type != ConstantExt.MAP_STYLE_VR_ROAM) {
|
||||
mEventController?.dispatchMapViewVisualAngleChangeListener(type)
|
||||
@@ -1854,17 +1869,17 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
|
||||
|
||||
|
||||
override fun interpolation(eyeHeight: Float, angle: Float, zoomVal: Float, mode: Int, duration: Int) {
|
||||
override fun interpolation(eyeHeight: Float, overLookAngle: Float, zoomVal: Float, mode: Int, duration: Int) {
|
||||
if(System.currentTimeMillis() - mLockLocation.getLastUpdateTime() > 500
|
||||
|| mLockLocation.getLastUpdateTime() - mLockLocation.getAgainLastUpdateTime() >= 900){
|
||||
mapAnimate.setStartFrame(zoomVal, angle, eyeHeight)
|
||||
mapAnimate.setStartFrame(zoomVal, overLookAngle, eyeHeight)
|
||||
val center = mLockLocation.getCurrentLonLatPoint()
|
||||
val lon: Double = center.longitude
|
||||
val lat: Double = center.latitude
|
||||
animateTo(lon, lat, 0f,-1f, 1000)
|
||||
}else {
|
||||
|
||||
mapAnimate.executeAnim(zoomVal, eyeHeight, angle, duration)
|
||||
mapAnimate.executeAnim(zoomVal, eyeHeight, overLookAngle, duration)
|
||||
}
|
||||
|
||||
mMapStyleParams.setVrAngleMode(mode)
|
||||
@@ -2243,7 +2258,6 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
}
|
||||
|
||||
override fun setHDTypeVisible(type: IntArray?){
|
||||
mMapView.getMapEngine().setHDTypeVisibile(type)
|
||||
mMapView.getMapEngine().setHDTypeVisible(type)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.zhidaoauto.map.sdk.inner.map
|
||||
|
||||
import android.util.Log
|
||||
import com.zhidao.map.net.api.Result
|
||||
import com.zhidaoauto.map.sdk.inner.CompileConfig
|
||||
import com.zhidaoauto.map.sdk.inner.abs.IWeatherController
|
||||
import com.zhidaoauto.map.sdk.inner.cloud.weather.WeatherRepository
|
||||
import com.zhidaoauto.map.sdk.open.data.MapDataApi
|
||||
import com.zhidaoauto.map.sdk.open.logics.weather.WeatherType
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
/**
|
||||
* WeatherController class responsible for controlling weather-related functionality
|
||||
* @constructor
|
||||
* @param mapAutoView
|
||||
*/
|
||||
class WeatherController(mapAutoView: MapAutoView): IWeatherController {
|
||||
|
||||
private val mMapAutoView: MapAutoView
|
||||
|
||||
// Update interval for weather information (15 minutes)
|
||||
private val INTERVAL: Long = 15 * 60 * 1000L
|
||||
|
||||
// Set of rain weather conditions
|
||||
val rainSet = setOf("小雨", "中雨", "大雨", "暴雨", "大暴雨", "特大暴雨", "雨")
|
||||
// Set of snow weather conditions
|
||||
val snowSet = setOf("小雪", "中雪", "大雪", "暴雪", "雪")
|
||||
// Set of cloudy weather conditions
|
||||
val cloudySet = setOf("阴", "多云")
|
||||
|
||||
private val mWeatherRepository by lazy { WeatherRepository() }
|
||||
private var mLastUpdateTime: Long = 0
|
||||
private var mWeatherEnable: Boolean = true
|
||||
private var mUpdateWeatherJob: Job? = null
|
||||
private var mLocationLon: Double = 0.0
|
||||
private var mLocationLat: Double = 0.0
|
||||
|
||||
companion object {
|
||||
private const val TAG = "WeatherController"
|
||||
}
|
||||
|
||||
init {
|
||||
mMapAutoView = mapAutoView
|
||||
}
|
||||
|
||||
override fun destory() {
|
||||
mWeatherEnable = false
|
||||
mUpdateWeatherJob?.cancel()
|
||||
mUpdateWeatherJob = null
|
||||
}
|
||||
|
||||
override fun setWeahterEnable(enable:Boolean){
|
||||
mWeatherEnable = enable
|
||||
if(mWeatherEnable){
|
||||
// Enable weather updates
|
||||
updateLocation(mLocationLon, mLocationLat)
|
||||
}else{
|
||||
mUpdateWeatherJob?.cancel()
|
||||
mUpdateWeatherJob = null
|
||||
mLastUpdateTime = 0
|
||||
// Disable weather updates and set default weather
|
||||
mMapAutoView?.getMapController()?.setWeatherType(WeatherType.DEFULT.type)
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateLocation(lon:Double, lat:Double){
|
||||
if ((lon == 0.0 || lat == 0.0) || !MapDataApi.isRightLonLat(lon, lat)) {
|
||||
return;
|
||||
}
|
||||
mLocationLon = lon
|
||||
mLocationLat = lat
|
||||
|
||||
// Update weather if enabled and update interval has passed
|
||||
mWeatherEnable = mMapAutoView.getMapStyleParams()?.isWeatherEnable()?: mWeatherEnable
|
||||
if (mWeatherEnable && System.currentTimeMillis() - mLastUpdateTime > INTERVAL){
|
||||
mLastUpdateTime = System.currentTimeMillis()
|
||||
getWeatherInfo()
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch weather information based on location
|
||||
private fun getWeatherInfo(){
|
||||
mUpdateWeatherJob?.cancel()
|
||||
mUpdateWeatherJob = mMapAutoView?.getMapController()?.getScope()?.launch(Dispatchers.IO) {
|
||||
val result = mWeatherRepository.getInfo(mLocationLon, mLocationLat)
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.d(TAG, "getWeatherInfo-location:$mLocationLon, $mLocationLat-result: $result")
|
||||
}
|
||||
|
||||
if (result is Result.Success) {
|
||||
val weatherInfo = result.data
|
||||
|
||||
if(cloudySet.contains(weatherInfo.weather)) {
|
||||
mMapAutoView?.getMapController()?.setWeatherType(WeatherType.CLOUDY.type)
|
||||
}else if(snowSet.contains(weatherInfo.weather)){
|
||||
mMapAutoView?.getMapController()?.setWeatherType(WeatherType.SNOW.type)
|
||||
}else{
|
||||
mMapAutoView?.getMapController()?.setWeatherType(WeatherType.DEFULT.type)
|
||||
}
|
||||
} else {
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.d(TAG, "Failed to retrieve weather information!")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,12 +10,11 @@ import com.zhidaoauto.map.sdk.inner.CompileConfig.DEBUG
|
||||
import com.zhidaoauto.map.sdk.inner.abs.IMapController
|
||||
import com.zhidaoauto.map.sdk.inner.abs.IMarkerCall
|
||||
import com.zhidaoauto.map.sdk.open.abs.marker.OnMarkerDragListener
|
||||
import com.zhidaoauto.map.sdk.open.marker.*
|
||||
import com.zhidaoauto.map.sdk.open.tools.MD5Utils
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.*
|
||||
import com.zhidaoauto.map.sdk.open.common.tools.MD5Utils
|
||||
import com.zhidaoauto.map.sdk.open.common.tools.MapTools
|
||||
import io.netty.buffer.Unpooled
|
||||
import java.nio.charset.Charset
|
||||
import java.nio.charset.StandardCharsets
|
||||
import java.util.*
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
@@ -83,11 +82,11 @@ class MarkerNativeInterface(private val mMapController: IMapController): IMarker
|
||||
}
|
||||
|
||||
override fun addMarkerIconCache(id: Int, icon: String) {
|
||||
markerIconResourceCacheMap[id] = icon
|
||||
markerIconResourceCacheMap.put(id,icon)
|
||||
}
|
||||
|
||||
override fun getMarkerIconCache(id:Int):String?{
|
||||
return markerIconResourceCacheMap[id]
|
||||
return markerIconResourceCacheMap.get(id)
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
@@ -104,7 +103,7 @@ class MarkerNativeInterface(private val mMapController: IMapController): IMarker
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
fun clearAllMarkers(): Boolean {
|
||||
fun clearAllMarkers(): Boolean? {
|
||||
if(DEBUG){
|
||||
Log.i(TAG,"markerop--clearAllMarkers:")
|
||||
}
|
||||
@@ -122,7 +121,9 @@ class MarkerNativeInterface(private val mMapController: IMapController): IMarker
|
||||
* @param title
|
||||
*/
|
||||
fun setTitle(id: String?, title: String?) {
|
||||
|
||||
updateMarkerProperty(id!!, "title", title!!)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,7 +133,7 @@ class MarkerNativeInterface(private val mMapController: IMapController): IMarker
|
||||
* @return
|
||||
*/
|
||||
fun getTitle(id: String?): String {
|
||||
return getMarkerProperty(id!!, "title")
|
||||
return getMarkerProperty(id!!, "title")?:""
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,11 +153,11 @@ class MarkerNativeInterface(private val mMapController: IMapController): IMarker
|
||||
* @return
|
||||
*/
|
||||
fun getSnippet(id: String?): String {
|
||||
return getMarkerProperty(id!!, "snippet")
|
||||
return getMarkerProperty(id!!, "snippet")?:""
|
||||
}
|
||||
|
||||
fun isAnchorDynamicMoving(id: String): Boolean {
|
||||
return mMapController.isAnchorDynamicMoving(id)
|
||||
return mMapController.isAnchorDynamicMoving(id)?:false
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -165,12 +166,12 @@ class MarkerNativeInterface(private val mMapController: IMapController): IMarker
|
||||
* @param id
|
||||
* @param bitmapDescriptor
|
||||
*/
|
||||
fun setIcon(id: String?, bitmapDescriptor: BitmapDescriptor) {
|
||||
fun setIcon(id: String?, bitmapDescriptor: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor) {
|
||||
val markerBytes = bitmapDescriptor.getBytes()
|
||||
if(markerBytes.isEmpty()){
|
||||
return
|
||||
}
|
||||
MD5Utils.getInstance()
|
||||
MD5Utils.getInstanse()
|
||||
val markerIconName = MD5Utils.getMD5String(markerBytes)
|
||||
//缓存图片
|
||||
if (!containMarkerIcon(markerIconName)) {
|
||||
@@ -501,7 +502,7 @@ class MarkerNativeInterface(private val mMapController: IMapController): IMarker
|
||||
refreshMap()
|
||||
}
|
||||
|
||||
fun addDynamicAnchorPosition(id: String, points: List<LonLatPoint>,angle:Float, isGps:Boolean,current:Long,duration: Int) {
|
||||
fun addDynamicAnchorPostion(id: String, points: List<LonLatPoint>,angle:Float, isGps:Boolean,current:Long,duration: Int) {
|
||||
val data = MapTools.listToArray(points,!isGps)
|
||||
if(DEBUG){
|
||||
Log.i(TAG,"markerop--addDynamicAnchorPostion:${id},${points},isGps:${isGps},duration:${duration}")
|
||||
@@ -610,7 +611,7 @@ class MarkerNativeInterface(private val mMapController: IMapController): IMarker
|
||||
}
|
||||
|
||||
|
||||
//设置infoWindow的偏移量
|
||||
//设置infowindow的偏移量
|
||||
fun setInfoWindowOffset(id: String, offsetX: Int, offsetY: Int) {
|
||||
if(DEBUG){
|
||||
Log.i(TAG,"markerop--setInfoWindowOffset:${id},${offsetX},${offsetY}")
|
||||
@@ -737,7 +738,7 @@ class MarkerNativeInterface(private val mMapController: IMapController): IMarker
|
||||
mMapController.setAnchorFlash(id, colorType, color, time, angle)
|
||||
}
|
||||
|
||||
val charset: Charset = StandardCharsets.UTF_8
|
||||
val charset = Charset.forName("UTF-8")
|
||||
|
||||
private fun dealMarker(markerPtions: MarkerOptions):ByteArray?{
|
||||
val buffer = Unpooled.buffer()
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
//import com.zhidaoauto.map.sdk.open.dialog.BaseDialog
|
||||
//import com.zhidaoauto.map.sdk.open.dialog.TipDialog
|
||||
//import com.zhidaoauto.map.sdk.open.dialog.WaitDialog
|
||||
//import com.zhidaoauto.map.sdk.open.location.MogoLocation
|
||||
//import com.zhidaoauto.map.sdk.open.nav.NavInfo
|
||||
//import com.zhidaoauto.map.sdk.open.nav.NavPoi
|
||||
//import com.zhidaoauto.map.sdk.open.nav.PathPlanningStrategy
|
||||
//import com.zhidaoauto.map.sdk.open.nav.abs.NaviListener
|
||||
//import com.zhidaoauto.map.sdk.open.nav.model.*
|
||||
//import com.zhidaoauto.map.sdk.open.query.LonLatPoint
|
||||
//import com.zhidaoauto.map.sdk.open.logics.MogoLocation
|
||||
//import com.zhidaoauto.map.sdk.open.logics.nav.NavInfo
|
||||
//import com.zhidaoauto.map.sdk.open.logics.nav.NavPoi
|
||||
//import com.zhidaoauto.map.sdk.open.logics.nav.PathPlanningStrategy
|
||||
//import com.zhidaoauto.map.sdk.open.logics.nav.abs.NaviListener
|
||||
//import com.zhidaoauto.map.sdk.open.logics.nav.model.*
|
||||
//import com.zhidaoauto.map.sdk.open.logics.query.LonLatPoint
|
||||
//import kotlinx.coroutines.Dispatchers
|
||||
//import kotlinx.coroutines.Job
|
||||
//import kotlinx.coroutines.launch
|
||||
@@ -211,7 +211,7 @@
|
||||
// Log.i(TAG, "navop-msg-getTts")
|
||||
// }
|
||||
// val datas = msg.obj as ByteArray
|
||||
// currentTts = String(datas, StandardCharsets.UTF_8)
|
||||
// currentTts = String(datas, Charset.forName("utf-8"))
|
||||
// if (DEBUG) {
|
||||
// Log.i(TAG, "navop-msg-getTts:${currentTts}")
|
||||
// }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.zhidaoauto.map.sdk.inner.obj
|
||||
|
||||
import com.zhidaoauto.map.sdk.open.nav.NavInfo
|
||||
import com.zhidaoauto.map.sdk.open.logics.nav.NavInfo
|
||||
|
||||
class NavMsg {
|
||||
var msgType:Int? = null
|
||||
|
||||
@@ -23,8 +23,8 @@ public class DirectionLayer extends ImageView implements MapStatusListener {
|
||||
private static final String TAG = "DirectionLayer";
|
||||
private Drawable icon;
|
||||
private IMapController mMapController;
|
||||
private final Matrix matrix = new Matrix();
|
||||
private final Camera mCamera = new Camera();
|
||||
private Matrix matrix = new Matrix();
|
||||
private Camera mCamera = new Camera();
|
||||
|
||||
public DirectionLayer(Context context){
|
||||
super(context);
|
||||
@@ -81,14 +81,14 @@ public class DirectionLayer extends ImageView implements MapStatusListener {
|
||||
return;
|
||||
}
|
||||
canvas.save();
|
||||
canvas.translate(getWidth() / 2.0f, getHeight() / 2.0f);
|
||||
canvas.translate(getWidth() / 2, getHeight() / 2);
|
||||
// mCamera.save();
|
||||
// mCamera.rotateX(90 - mapController.getDAngle());
|
||||
// mCamera.getMatrix(matrix);
|
||||
// mCamera.restore();
|
||||
canvas.concat(matrix);
|
||||
canvas.rotate(mMapController.getMapViewRotation());
|
||||
canvas.translate(-getWidth() / 2.0f, -getHeight() / 2.0f);
|
||||
canvas.translate(-getWidth() / 2, -getHeight() / 2);
|
||||
super.onDraw(canvas);
|
||||
canvas.restore();
|
||||
postInvalidate();
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
//import com.zhidaoauto.map.sdk.inner.db.DataStorageManager
|
||||
//import com.zhidaoauto.map.sdk.inner.proxy.CommonProxy
|
||||
//import com.zhidaoauto.map.sdk.inner.utils.Constant.initRouteSetting
|
||||
//import com.zhidaoauto.map.sdk.open.nav.NavPoi
|
||||
//import com.zhidaoauto.map.sdk.open.query.LonLatPoint
|
||||
//import com.zhidaoauto.map.sdk.open.logics.nav.NavPoi
|
||||
//import com.zhidaoauto.map.sdk.open.logics.query.LonLatPoint
|
||||
//
|
||||
//class PanelRouteSet(context: Context?) :
|
||||
// Panel(context), View.OnClickListener {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
//import com.zhidaoauto.map.sdk.inner.controller.CommonController
|
||||
//import com.zhidaoauto.map.sdk.inner.utils.Constant.getDisString
|
||||
//import com.zhidaoauto.map.sdk.inner.utils.Constant.getTimeString
|
||||
//import com.zhidaoauto.map.sdk.open.nav.model.NaviPath
|
||||
//import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviPath
|
||||
//import kotlinx.android.synthetic.main.panel_route_select.view.*
|
||||
//import kotlinx.coroutines.Dispatchers
|
||||
//import kotlinx.coroutines.launch
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.zhidaoauto.map.sdk.inner.road.RoadHelper
|
||||
import com.zhidaoauto.map.sdk.inner.utils.MathUtils
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnMapChangeListener
|
||||
import com.zhidaoauto.map.sdk.open.location.MogoLocation
|
||||
import com.zhidaoauto.map.sdk.open.logics.location.MogoLocation
|
||||
import kotlinx.android.synthetic.main.panel_traffic_sign.view.iv_traffic
|
||||
import kotlin.math.abs
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ package com.zhidaoauto.map.sdk.inner.proxy
|
||||
import android.util.Log
|
||||
import com.zhidaoauto.map.sdk.inner.abs.ILonLatProxy
|
||||
import com.zhidaoauto.map.sdk.inner.common.MapHelper
|
||||
import com.zhidaoauto.map.sdk.open.exception.MapException
|
||||
import com.zhidaoauto.map.sdk.open.common.exception.MapException
|
||||
|
||||
class CommonProxy {
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ class LonLatProxy : ILonLatProxy {
|
||||
array?.let {
|
||||
lonLatPoint = LonLatPoint(it[0], it[1])
|
||||
}
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.i(TAG, "lonlatop--toOuter-before:${lonLat},after:${lonLatPoint}")
|
||||
}
|
||||
// if (CompileConfig.DEBUG) {
|
||||
// Log.i(TAG, "lonlatop--toOuter-before:${lonLat},after:${lonLatPoint}")
|
||||
// }
|
||||
return lonLatPoint
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,7 @@ class RoadResultController {
|
||||
|
||||
fun addRoadResultListener(key:String,listener:IRoadData){
|
||||
if(CompileConfig.DEBUG){
|
||||
Log.i(TAG, "roadop--addRoadResultListener:$key ")
|
||||
Log.i(TAG, "roadop--addRoadResultListener-${mRoadResultCallHashMap.size}-:$key ")
|
||||
}
|
||||
var list = mRoadResultCallHashMap.get(key)
|
||||
if(list == null){
|
||||
@@ -45,6 +45,13 @@ class RoadResultController {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun removeRoadResultListener(key:String){
|
||||
if(CompileConfig.DEBUG){
|
||||
Log.i(TAG, "roadop--removeRoadResultListener:$key ")
|
||||
}
|
||||
mRoadResultCallHashMap.remove(key)
|
||||
}
|
||||
fun removeRoadResultListenerByCanCancel(){
|
||||
if(CompileConfig.DEBUG){
|
||||
Log.i(TAG, "roadop--removeRoadResultListenerByCanCancel: ")
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
//import com.zhidaoauto.map.sdk.inner.controller.CommonController
|
||||
//import com.zhidaoauto.map.sdk.inner.proxy.CommonProxy
|
||||
//import com.zhidaoauto.map.sdk.open.abs.search.IGeocodeSearch
|
||||
//import com.zhidaoauto.map.sdk.open.query.*
|
||||
//import com.zhidaoauto.map.sdk.open.logics.query.*
|
||||
//import kotlinx.coroutines.Dispatchers
|
||||
//import kotlinx.coroutines.launch
|
||||
//import kotlinx.coroutines.withContext
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
//import com.zhidaoauto.map.sdk.inner.controller.CommonController
|
||||
//import com.zhidaoauto.map.sdk.inner.proxy.CommonProxy
|
||||
//import com.zhidaoauto.map.sdk.open.abs.search.IInputtipsSearch
|
||||
//import com.zhidaoauto.map.sdk.open.exception.MapException
|
||||
//import com.zhidaoauto.map.sdk.open.query.InputtipsListener
|
||||
//import com.zhidaoauto.map.sdk.open.query.InputtipsQuery
|
||||
//import com.zhidaoauto.map.sdk.open.query.LonLatPoint
|
||||
//import com.zhidaoauto.map.sdk.open.query.Tip
|
||||
//import com.zhidaoauto.map.sdk.open.common.MapException
|
||||
//import com.zhidaoauto.map.sdk.open.logics.query.InputtipsListener
|
||||
//import com.zhidaoauto.map.sdk.open.logics.query.InputtipsQuery
|
||||
//import com.zhidaoauto.map.sdk.open.logics.query.LonLatPoint
|
||||
//import com.zhidaoauto.map.sdk.open.logics.query.Tip
|
||||
//import kotlinx.coroutines.Dispatchers
|
||||
//import kotlinx.coroutines.launch
|
||||
//import kotlinx.coroutines.withContext
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
//import com.zhidaoauto.map.sdk.inner.controller.CommonController
|
||||
//import com.zhidaoauto.map.sdk.inner.proxy.CommonProxy
|
||||
//import com.zhidaoauto.map.sdk.open.abs.search.IPoiSearch
|
||||
//import com.zhidaoauto.map.sdk.open.query.*
|
||||
//import com.zhidaoauto.map.sdk.open.logics.query.*
|
||||
//import kotlinx.coroutines.Dispatchers
|
||||
//import kotlinx.coroutines.launch
|
||||
//import kotlinx.coroutines.withContext
|
||||
|
||||
@@ -38,8 +38,8 @@ class Clerk(private val mMapController: IMapController?) {
|
||||
}
|
||||
job?.cancel()
|
||||
job = mMapController?.getDemaningScope()?.launch(Dispatchers.IO) {
|
||||
var className = ""
|
||||
var methodName = ""
|
||||
var className: String = ""
|
||||
var methodName: String = ""
|
||||
try {
|
||||
className = Thread.currentThread().stackTrace[3].className
|
||||
methodName = Thread.currentThread().stackTrace[3].methodName
|
||||
@@ -56,8 +56,8 @@ class Clerk(private val mMapController: IMapController?) {
|
||||
}
|
||||
job?.cancel()
|
||||
job = mMapController?.getDemaningScope()?.launch(Dispatchers.IO) {
|
||||
var className = ""
|
||||
var methodName = ""
|
||||
var className: String = ""
|
||||
var methodName: String = ""
|
||||
try {
|
||||
className = Thread.currentThread().stackTrace[3].className
|
||||
methodName = Thread.currentThread().stackTrace[3].methodName
|
||||
@@ -79,7 +79,7 @@ class Clerk(private val mMapController: IMapController?) {
|
||||
if(CompileConfig.DEBUG){
|
||||
Log.i(TAG, "add: ${System.currentTimeMillis()}-$key")
|
||||
}
|
||||
var stringBuffer = cacheMap[key]
|
||||
var stringBuffer = cacheMap.get(key)
|
||||
if(stringBuffer == null){
|
||||
stringBuffer = StringBuffer()
|
||||
}
|
||||
@@ -104,9 +104,9 @@ class Clerk(private val mMapController: IMapController?) {
|
||||
val scope = mMapController?.getDemaningScope()
|
||||
if(saveJobList.size>10){
|
||||
val needDeleteSize = saveJobList.size - 5
|
||||
if(CompileConfig.DEBUG){
|
||||
Log.i(TAG, "i-cancel: $needDeleteSize")
|
||||
}
|
||||
// if(CompileConfig.DEBUG){
|
||||
// Log.i(TAG, "i-cancel: $needDeleteSize")
|
||||
// }
|
||||
var deleteIndex = 0
|
||||
val it = saveJobList.iterator()
|
||||
while(it.hasNext() && deleteIndex<needDeleteSize){
|
||||
@@ -155,34 +155,29 @@ class Clerk(private val mMapController: IMapController?) {
|
||||
uploadJob?.cancel()
|
||||
uploadJob = scope?.launch(Dispatchers.IO) {
|
||||
val path = Recorder.getLogDirectory(TAG)
|
||||
path?.let {
|
||||
val file = File(it)
|
||||
if(!file.isDirectory){
|
||||
return@launch
|
||||
val file = File(path)
|
||||
if(!file.isDirectory){
|
||||
return@launch
|
||||
}
|
||||
val firstlist = file.list()
|
||||
for(p in firstlist){
|
||||
val f = File(p)
|
||||
if(!f.isDirectory){
|
||||
break
|
||||
}
|
||||
val firstList = file.list()
|
||||
firstList?.let {
|
||||
for(p in firstList){
|
||||
val f = File(p)
|
||||
if(!f.isDirectory){
|
||||
break
|
||||
}
|
||||
val secondList = f.list()
|
||||
secondList?.let {
|
||||
for(child in secondList){
|
||||
val childFile = File(child)
|
||||
upload(childFile)
|
||||
}
|
||||
}
|
||||
}
|
||||
val secondlist = f.list()
|
||||
for(child in secondlist){
|
||||
val childFile = File(child)
|
||||
upload(childFile)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun upload(file:File){
|
||||
// return
|
||||
// val content = file.readText()
|
||||
return
|
||||
val content = file.readText()
|
||||
// repository.uploadLogInfo(content)
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class AMapUtils {
|
||||
var29[0] = var24 * var22;
|
||||
var29[1] = var24 * var18;
|
||||
var29[2] = var20;
|
||||
return (float) (Math.asin(Math.sqrt((var28[0] - var29[0]) * (var28[0] - var29[0]) + (var28[1] - var29[1]) * (var28[1] - var29[1]) + (var28[2] - var29[2]) * (var28[2] - var29[2])) / 2.0D) * 1.27420015798544E7D);
|
||||
return (float)(Math.asin(Math.sqrt((var28[0] - var29[0]) * (var28[0] - var29[0]) + (var28[1] - var29[1]) * (var28[1] - var29[1]) + (var28[2] - var29[2]) * (var28[2] - var29[2])) / 2.0D) * 1.27420015798544E7D);
|
||||
} catch (Throwable var26) {
|
||||
var26.printStackTrace();
|
||||
return 0.0F;
|
||||
|
||||
@@ -2,13 +2,12 @@ package com.zhidaoauto.map.sdk.inner.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class MainInfo {
|
||||
private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
|
||||
private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
|
||||
private static MainInfo m_hinst = null;
|
||||
private boolean mbUserLog = true;
|
||||
private static boolean mbDebug = false;
|
||||
@@ -34,11 +33,12 @@ public class MainInfo {
|
||||
if (null == dir) {
|
||||
return;
|
||||
}
|
||||
try(FileWriter fw = new FileWriter((dir + "log.txt"), true)){
|
||||
try {
|
||||
FileWriter fw = new FileWriter((dir + "log.txt"), true);
|
||||
String date = dateFormat.format(new Date());
|
||||
fw.write(date + " " + log + "\r\n");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
fw.close();
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,11 +50,11 @@ public class MainInfo {
|
||||
if (null == dir) {
|
||||
return;
|
||||
}
|
||||
|
||||
try(FileWriter fw = new FileWriter((dir + "log.txt"), true)){
|
||||
try {
|
||||
FileWriter fw = new FileWriter((dir + "log.txt"), true);
|
||||
e.printStackTrace(new PrintWriter(fw));
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
fw.close();
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.zhidaoauto.map.sdk.inner.utils;
|
||||
|
||||
import com.zhidaoauto.map.sdk.inner.element.MapCoordinate;
|
||||
import com.zhidaoauto.map.sdk.open.nav.NavPoi;
|
||||
import com.zhidaoauto.map.sdk.open.logics.nav.NavPoi;
|
||||
|
||||
public class PubFunction
|
||||
{
|
||||
@@ -65,7 +65,7 @@ public class PubFunction
|
||||
*/
|
||||
public static double GetLineAngle(int nX1, int nY1, int nX2, int nY2)
|
||||
{
|
||||
return getAngleToNorth((nX2 - nX1)/5.0f, (nY2 - nY1)/4.0f);
|
||||
return getAngleToNorth((nX2 - nX1)/5, (nY2 - nY1)/4);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,14 +25,14 @@ import com.zhidaoauto.map.sdk.inner.utils.TransformUtils
|
||||
import com.zhidaoauto.map.sdk.open.abs.log.ILog
|
||||
import com.zhidaoauto.map.sdk.open.abs.navi.INaviResult
|
||||
import com.zhidaoauto.map.sdk.open.data.MapDataApi
|
||||
import com.zhidaoauto.map.sdk.open.navi.NaviModel
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools
|
||||
import com.zhidaoauto.map.sdk.inner.cloud.navi.NaviModel
|
||||
import com.zhidaoauto.map.sdk.open.common.tools.MapTools
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView
|
||||
import io.netty.buffer.Unpooled
|
||||
import java.math.BigDecimal
|
||||
import java.nio.charset.Charset
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.pow
|
||||
import java.nio.charset.StandardCharsets
|
||||
|
||||
|
||||
object MapAutoApi {
|
||||
@@ -521,16 +521,23 @@ object MapAutoApi {
|
||||
box = getTileBoundingBox(5572660368)
|
||||
println("-getTileBoundingBox:${box.lbLon},${box.lbLat},${box.rtLon},${box.rtLat}")
|
||||
println("--------")
|
||||
println("写入中")
|
||||
val byteBuffer = Unpooled.buffer()
|
||||
val str = "1111112345678sjkfdhdkb"
|
||||
byteBuffer.writeInt(str.length)
|
||||
byteBuffer.writeCharSequence(str, Charset.forName("utf-8"))
|
||||
var str = "1111112345678sjkfdhdkb"
|
||||
println("str:${str.length}")
|
||||
str = "1111112345678sjkfdhdkb中国"
|
||||
println("str中国:${str.length}")
|
||||
val utf8Bytes = str.toByteArray(StandardCharsets.UTF_8)
|
||||
println("str utf8Bytes size:${utf8Bytes.size}")
|
||||
byteBuffer.writeInt(utf8Bytes.size)
|
||||
byteBuffer.writeCharSequence(str, StandardCharsets.UTF_8)
|
||||
byteBuffer.writeBoolean(true)
|
||||
byteBuffer.writeInt(999)
|
||||
byteBuffer.writeInt(12)
|
||||
val length = byteBuffer.readInt()
|
||||
println("读取中")
|
||||
println("$length")
|
||||
println("${byteBuffer.readCharSequence(length, Charset.forName("utf-8"))}")
|
||||
println("${byteBuffer.readCharSequence(length, StandardCharsets.UTF_8)}")
|
||||
println("${byteBuffer.readBoolean()}")
|
||||
println("${byteBuffer.readInt()}")
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.zhidaoauto.map.sdk.open
|
||||
|
||||
import com.autonavi.nge.routing.RoutingProvider
|
||||
import com.zhidaoauto.map.sdk.open.nav.NaviViewShowMode
|
||||
import com.zhidaoauto.map.sdk.open.logics.nav.NaviViewShowMode
|
||||
|
||||
class NavParams private constructor() {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.zhidaoauto.map.sdk.open.abs
|
||||
|
||||
import com.zhidaoauto.map.sdk.open.camera.CameraPosition
|
||||
import com.zhidaoauto.map.sdk.open.logics.camera.CameraPosition
|
||||
|
||||
interface OnCameraChangeListener {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.zhidaoauto.map.sdk.open.abs
|
||||
|
||||
import com.zhidaoauto.map.sdk.open.location.MogoLocation
|
||||
import com.zhidaoauto.map.sdk.open.logics.location.MogoLocation
|
||||
|
||||
interface OnMapChangeListener {
|
||||
fun onMapChange(mogoLocation: MogoLocation)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.zhidaoauto.map.sdk.open.abs.marker
|
||||
|
||||
import android.view.View
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.Marker
|
||||
|
||||
interface InfoWindowAdapter{
|
||||
fun getInfoWindow(marker: Marker?): View?
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.zhidaoauto.map.sdk.open.abs.marker
|
||||
|
||||
import com.zhidaoauto.map.sdk.open.marker.Animation
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.Animation
|
||||
|
||||
|
||||
interface MarkerAnimationListener {
|
||||
fun onAnimationStart(animation: Animation)
|
||||
fun onAnimationStart(animation: com.zhidaoauto.map.sdk.open.renders.marker.Animation)
|
||||
|
||||
fun onAnimationEnd(animation: Animation)
|
||||
fun onAnimationEnd(animation: com.zhidaoauto.map.sdk.open.renders.marker.Animation)
|
||||
|
||||
fun onAnimationRepeat(animation: Animation)
|
||||
fun onAnimationRepeat(animation: com.zhidaoauto.map.sdk.open.renders.marker.Animation)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.zhidaoauto.map.sdk.open.abs.marker
|
||||
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.Marker
|
||||
|
||||
interface OnMarkerDragListener {
|
||||
fun onMarkerDragStart(var1: Marker?)
|
||||
|
||||
@@ -1,25 +1,22 @@
|
||||
package com.zhidaoauto.map.sdk.open.abs.search
|
||||
|
||||
import com.zhidaoauto.map.sdk.open.exception.MapException
|
||||
import com.zhidaoauto.map.sdk.open.query.GeocodeAddress
|
||||
import com.zhidaoauto.map.sdk.open.query.GeocodeQuery
|
||||
import com.zhidaoauto.map.sdk.open.query.OnGeocodeSearchListener
|
||||
import com.zhidaoauto.map.sdk.open.common.exception.MapException
|
||||
|
||||
|
||||
import com.zhidaoauto.map.sdk.open.query.RegeocodeAddress
|
||||
import com.zhidaoauto.map.sdk.open.query.RegeocodeQuery
|
||||
import com.zhidaoauto.map.sdk.open.logics.query.RegeocodeAddress
|
||||
import com.zhidaoauto.map.sdk.open.logics.query.RegeocodeQuery
|
||||
|
||||
interface IGeocodeSearch {
|
||||
@Throws(MapException::class)
|
||||
fun getFromLocation(regeocodeQuery: RegeocodeQuery): RegeocodeAddress?
|
||||
|
||||
@Throws(MapException::class)
|
||||
fun getFromLocationName(geocodeQuery: GeocodeQuery?): List<GeocodeAddress?>?
|
||||
fun getFromLocationName(geocodeQuery: com.zhidaoauto.map.sdk.open.logics.query.GeocodeQuery?): List<com.zhidaoauto.map.sdk.open.logics.query.GeocodeAddress?>?
|
||||
|
||||
fun setOnGeocodeSearchListener(listener: OnGeocodeSearchListener?)
|
||||
fun setOnGeocodeSearchListener(listener: com.zhidaoauto.map.sdk.open.logics.query.OnGeocodeSearchListener?)
|
||||
|
||||
fun getFromLocationAsyn(regeocodeQuery: RegeocodeQuery?)
|
||||
|
||||
fun getFromLocationNameAsyn(geocodeQuery: GeocodeQuery?)
|
||||
fun getFromLocationNameAsyn(geocodeQuery: com.zhidaoauto.map.sdk.open.logics.query.GeocodeQuery?)
|
||||
|
||||
}
|
||||
@@ -1,16 +1,14 @@
|
||||
package com.zhidaoauto.map.sdk.open.abs.search
|
||||
|
||||
import com.zhidaoauto.map.sdk.open.exception.MapException
|
||||
import com.zhidaoauto.map.sdk.open.query.InputtipsListener
|
||||
import com.zhidaoauto.map.sdk.open.query.InputtipsQuery
|
||||
import com.zhidaoauto.map.sdk.open.query.Tip
|
||||
import com.zhidaoauto.map.sdk.open.common.exception.MapException
|
||||
import com.zhidaoauto.map.sdk.open.logics.query.Tip
|
||||
|
||||
interface IInputtipsSearch {
|
||||
|
||||
fun getQuery(): InputtipsQuery?
|
||||
fun setQuery(query: InputtipsQuery)
|
||||
fun getQuery(): com.zhidaoauto.map.sdk.open.logics.query.InputtipsQuery?
|
||||
fun setQuery(query: com.zhidaoauto.map.sdk.open.logics.query.InputtipsQuery)
|
||||
|
||||
fun setInputtipsListener(listener: InputtipsListener?)
|
||||
fun setInputtipsListener(listener: com.zhidaoauto.map.sdk.open.logics.query.InputtipsListener?)
|
||||
|
||||
fun requestInputtipsAsyn()
|
||||
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
package com.zhidaoauto.map.sdk.open.abs.search
|
||||
|
||||
import com.zhidaoauto.map.sdk.open.exception.MapException
|
||||
import com.zhidaoauto.map.sdk.open.query.OnPoiSearchListener
|
||||
import com.zhidaoauto.map.sdk.open.query.PoiItem
|
||||
import com.zhidaoauto.map.sdk.open.query.PoiSearchResult
|
||||
import com.zhidaoauto.map.sdk.open.query.Query
|
||||
import com.zhidaoauto.map.sdk.open.query.SearchBound
|
||||
import com.zhidaoauto.map.sdk.open.common.exception.MapException
|
||||
import com.zhidaoauto.map.sdk.open.logics.query.PoiSearchResult
|
||||
import com.zhidaoauto.map.sdk.open.logics.query.Query
|
||||
import com.zhidaoauto.map.sdk.open.logics.query.SearchBound
|
||||
|
||||
interface IPoiSearch {
|
||||
fun setOnPoiSearchListener(onPoiSearchListener: OnPoiSearchListener?)
|
||||
fun setOnPoiSearchListener(onPoiSearchListener: com.zhidaoauto.map.sdk.open.logics.query.OnPoiSearchListener?)
|
||||
@Throws(MapException::class)
|
||||
fun searchPOI(): PoiSearchResult?
|
||||
|
||||
fun searchPOIAsyn()
|
||||
@Throws(MapException::class)
|
||||
fun searchPOIId(id: String?): PoiItem?
|
||||
fun searchPOIId(id: String?): com.zhidaoauto.map.sdk.open.logics.query.PoiItem?
|
||||
fun searchPOICateGoryAsyn()
|
||||
fun searchPOIIdAsyn(id: String?)
|
||||
fun setQuery(query: Query?)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog
|
||||
|
||||
import android.app.Dialog
|
||||
import android.util.Log
|
||||
@@ -22,7 +22,8 @@ abstract class BaseDialog {
|
||||
}
|
||||
|
||||
fun getDialogLifeCycleListener(): DialogLifeCycleListener {
|
||||
if (dialogLifeCycleListener == null) dialogLifeCycleListener = object : DialogLifeCycleListener {
|
||||
if (dialogLifeCycleListener == null) dialogLifeCycleListener = object :
|
||||
DialogLifeCycleListener {
|
||||
override fun onCreate(alertDialog: Dialog?) {}
|
||||
override fun onShow(alertDialog: Dialog?) {}
|
||||
override fun onDismiss() {}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog
|
||||
|
||||
import android.view.View
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog;
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
@@ -371,16 +371,16 @@ public class BlurView extends View {
|
||||
private static class StopException extends RuntimeException {
|
||||
}
|
||||
|
||||
private static final StopException STOP_EXCEPTION = new StopException();
|
||||
private static StopException STOP_EXCEPTION = new StopException();
|
||||
|
||||
// static {
|
||||
static {
|
||||
// try {
|
||||
// BlurView.class.getClassLoader().loadClass("androidx.renderscript.RenderScript");
|
||||
// } catch (ClassNotFoundException e) {
|
||||
// throw new RuntimeException("\n错误!\nRenderScript支持库未启用,要启用模糊效果,请在您的app的Gradle配置文件中添加以下语句:" +
|
||||
// "\nandroid { \n...\n defaultConfig { \n ...\n renderscriptTargetApi 19 \n renderscriptSupportModeEnabled true \n }\n}");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// android:debuggable="true" in AndroidManifest.xml (auto set by build tool)
|
||||
static Boolean DEBUG = null;
|
||||
@@ -389,6 +389,6 @@ public class BlurView extends View {
|
||||
if (DEBUG == null && ctx != null) {
|
||||
DEBUG = (ctx.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
|
||||
}
|
||||
return DEBUG != null && DEBUG.equals(Boolean.TRUE);
|
||||
return DEBUG.equals(Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.AlertDialog
|
||||
@@ -18,7 +18,7 @@ class CustomDialog() : BaseDialog() {
|
||||
private var mContext: Context? = null
|
||||
private var bindView: BindView? = null
|
||||
private var mGravity = 0
|
||||
private var mDialogHelper:DialogHelper? = null
|
||||
private var mDialogHelper: DialogHelper? = null
|
||||
|
||||
|
||||
companion object{
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.app.Dialog
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog
|
||||
|
||||
import android.app.Dialog
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog
|
||||
|
||||
object DialogSettings {
|
||||
const val THEME_LIGHT = 0
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.AlertDialog
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog;
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog;
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog;
|
||||
|
||||
import android.text.InputType;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog;
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog;
|
||||
|
||||
|
||||
import android.app.AlertDialog;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog
|
||||
|
||||
/**
|
||||
* Author: @Kongzue
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog;
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog
|
||||
|
||||
class TextInfo {
|
||||
var fontSize = -1 //字号大小,值为-1时使用默认样式,单位:dp
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.AlertDialog
|
||||
@@ -15,9 +15,9 @@ import android.widget.ImageView
|
||||
import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import com.zhidaoauto.map.sdk.R
|
||||
import com.zhidaoauto.map.sdk.open.dialog.DialogSettings.THEME_LIGHT
|
||||
import com.zhidaoauto.map.sdk.open.dialog.DialogSettings.blur_alpha
|
||||
import com.zhidaoauto.map.sdk.open.dialog.DialogSettings.tip_theme
|
||||
import com.zhidaoauto.map.sdk.open.common.dialog.DialogSettings.THEME_LIGHT
|
||||
import com.zhidaoauto.map.sdk.open.common.dialog.DialogSettings.blur_alpha
|
||||
import com.zhidaoauto.map.sdk.open.common.dialog.DialogSettings.tip_theme
|
||||
import java.util.Timer
|
||||
import java.util.TimerTask
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.dialog
|
||||
package com.zhidaoauto.map.sdk.open.common.dialog
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.AlertDialog
|
||||
@@ -14,8 +14,8 @@ import android.view.ViewGroup
|
||||
import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import com.zhidaoauto.map.sdk.R
|
||||
import com.zhidaoauto.map.sdk.open.dialog.DialogSettings.THEME_LIGHT
|
||||
import com.zhidaoauto.map.sdk.open.dialog.DialogSettings.tip_theme
|
||||
import com.zhidaoauto.map.sdk.open.common.dialog.DialogSettings.THEME_LIGHT
|
||||
import com.zhidaoauto.map.sdk.open.common.dialog.DialogSettings.tip_theme
|
||||
|
||||
class WaitDialog private constructor() : BaseDialog() {
|
||||
private var onBackPressListener: OnBackPressListener? = null
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.exception
|
||||
package com.zhidaoauto.map.sdk.open.common.exception
|
||||
|
||||
class MapException : Exception {
|
||||
var errorLevel = 0
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.exception
|
||||
package com.zhidaoauto.map.sdk.open.common.exception
|
||||
|
||||
/**
|
||||
* 当前未实现的异常
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.exception
|
||||
package com.zhidaoauto.map.sdk.open.common.exception
|
||||
|
||||
class RuntimeRemoteException(exception: Throwable) : RuntimeException() {
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.tools
|
||||
package com.zhidaoauto.map.sdk.open.common.tools
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import com.zhidaoauto.map.sdk.inner.utils.BitmapUtils
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.tools;
|
||||
package com.zhidaoauto.map.sdk.open.common.tools;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
public class MD5Utils {
|
||||
protected static char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
||||
protected static char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
||||
protected static MessageDigest messagedigest = null;
|
||||
|
||||
/**
|
||||
@@ -16,7 +16,7 @@ public class MD5Utils {
|
||||
* *
|
||||
*
|
||||
*/
|
||||
public static MessageDigest getInstance() {
|
||||
public static MessageDigest getInstanse() {
|
||||
if (messagedigest == null) {
|
||||
|
||||
try {
|
||||
@@ -31,11 +31,11 @@ public class MD5Utils {
|
||||
messagedigest.update(bytes);
|
||||
return bufferToHex(messagedigest.digest());
|
||||
}
|
||||
public static String bufferToHex(byte[] bytes) {
|
||||
public static String bufferToHex(byte bytes[]) {
|
||||
return bufferToHex(bytes, 0, bytes.length);
|
||||
}
|
||||
|
||||
private static String bufferToHex(byte[] bytes, int m, int n) {
|
||||
private static String bufferToHex(byte bytes[], int m, int n) {
|
||||
StringBuffer stringbuffer = new StringBuffer(2 * n);
|
||||
int k = m + n;
|
||||
for (int l = m; l < k; l++) {
|
||||
@@ -51,12 +51,9 @@ public class MD5Utils {
|
||||
public static boolean isSameImage(byte[] bytes, Context context){
|
||||
SharedPrefsMgr mgr = SharedPrefsMgr.getInstance(context);
|
||||
String imageStr = mgr.getString(MARKERIMAGE);
|
||||
MessageDigest md = MD5Utils.getInstance();
|
||||
MessageDigest md = MD5Utils.getInstanse();
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append(imageStr);
|
||||
if(md == null){
|
||||
return false;
|
||||
}
|
||||
md.update(bytes);
|
||||
String Md5Str = MD5Utils.bufferToHex(md.digest());
|
||||
if (imageStr.contains(Md5Str)){
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.tools
|
||||
package com.zhidaoauto.map.sdk.open.common.tools
|
||||
|
||||
import android.graphics.Point
|
||||
import android.util.Log
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.tools
|
||||
package com.zhidaoauto.map.sdk.open.common.tools
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
@@ -186,8 +186,8 @@ class MonitorPressApi {
|
||||
}
|
||||
if (i++ > randomsq) {
|
||||
i = 0
|
||||
randomsq = (Math.random() * 10).toInt()
|
||||
delay((Math.random() * 100).toLong())
|
||||
randomsq = (Math.random() * 30).toInt()
|
||||
delay((Math.random() * 40).toLong())
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.tools
|
||||
package com.zhidaoauto.map.sdk.open.common.tools
|
||||
|
||||
import android.os.Environment
|
||||
import android.text.TextUtils
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.tools
|
||||
package com.zhidaoauto.map.sdk.open.common.tools
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
@@ -21,22 +21,22 @@ import com.zhidaoauto.map.sdk.inner.road.RoadHelper
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi
|
||||
import com.zhidaoauto.map.sdk.open.abs.IResult
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnHdDataDownByCityListener
|
||||
import com.zhidaoauto.map.sdk.open.circle.CircleController
|
||||
import com.zhidaoauto.map.sdk.open.circle.CircleOptions
|
||||
import com.zhidaoauto.map.sdk.open.logics.circle.CircleController
|
||||
import com.zhidaoauto.map.sdk.open.logics.circle.CircleOptions
|
||||
import com.zhidaoauto.map.sdk.open.data.CityInfo
|
||||
import com.zhidaoauto.map.sdk.open.data.MapDataApi
|
||||
import com.zhidaoauto.map.sdk.open.location.MogoLocation
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerBatchData
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerCacheController
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerSimpleData
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerSimpleOptions
|
||||
import com.zhidaoauto.map.sdk.open.polygon.Polygon3D
|
||||
import com.zhidaoauto.map.sdk.open.polygon.Polygon3DHelper
|
||||
import com.zhidaoauto.map.sdk.open.polygon.Polygon3DOption
|
||||
import com.zhidaoauto.map.sdk.open.poyline.Polyline
|
||||
import com.zhidaoauto.map.sdk.open.poyline.PolylineOptions
|
||||
import com.zhidaoauto.map.sdk.open.logics.location.MogoLocation
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.Marker
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.MarkerBatchData
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.MarkerCacheController
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.MarkerOptions
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.MarkerSimpleData
|
||||
import com.zhidaoauto.map.sdk.open.renders.marker.MarkerSimpleOptions
|
||||
import com.zhidaoauto.map.sdk.open.renders.polygon.Polygon3D
|
||||
import com.zhidaoauto.map.sdk.open.renders.polygon.Polygon3DHelper
|
||||
import com.zhidaoauto.map.sdk.open.renders.polygon.Polygon3DOption
|
||||
import com.zhidaoauto.map.sdk.open.renders.poyline.Polyline
|
||||
import com.zhidaoauto.map.sdk.open.renders.poyline.PolylineOptions
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -194,6 +194,7 @@ class TaskManager private constructor() {
|
||||
}
|
||||
listRect.clear()
|
||||
}
|
||||
MapDataApi.cancelRoadTask()
|
||||
mMarkerCacheController?.destory()
|
||||
markerMap.clear()
|
||||
resetTask()
|
||||
@@ -545,7 +546,8 @@ class TaskManager private constructor() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
true
|
||||
)
|
||||
|
||||
}
|
||||
@@ -580,7 +582,8 @@ class TaskManager private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
true
|
||||
)
|
||||
|
||||
}
|
||||
@@ -663,7 +666,8 @@ class TaskManager private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
true
|
||||
)
|
||||
|
||||
|
||||
@@ -678,8 +682,7 @@ class TaskManager private constructor() {
|
||||
override fun result(code: Int, result: RoadCross?) {
|
||||
result?.let {
|
||||
if (it.status == 1) {
|
||||
RoadHelper.getInstance()
|
||||
?.getCrossRoadById(
|
||||
MapDataApi.getCrossRoadById(
|
||||
it.tile_id.toIntOrNull()?:1,
|
||||
it.cross_id.toLongOrNull()?:1L,
|
||||
object :
|
||||
@@ -712,7 +715,7 @@ class TaskManager private constructor() {
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},true)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -758,7 +761,7 @@ class TaskManager private constructor() {
|
||||
othercarFlag = true
|
||||
mapAutoView.getLocationClient()?.setIsUseExtraGPSData(true)
|
||||
mOtherCarJob?.cancel()
|
||||
mOtherCarJob = mTaskScope?.launch(Dispatchers.Default) {
|
||||
mOtherCarJob = mTaskScope?.launch(Dispatchers.IO) {
|
||||
val duration: Long = (Math.random() * DURATION_MAX).toLong()
|
||||
|
||||
val targetIndex = (Math.random() * TARGET_INDEX_MAX).toInt()
|
||||
@@ -938,7 +941,7 @@ class TaskManager private constructor() {
|
||||
randomTrackFlag = true
|
||||
mTrackJob?.cancel()
|
||||
mapAutoView.getLocationClient()?.setIsUseExtraGPSData(true)
|
||||
mTrackJob = mTaskScope?.launch(Dispatchers.Default) {
|
||||
mTrackJob = mTaskScope?.launch(Dispatchers.IO) {
|
||||
val duration: Long = (Math.random() * DURATION_MAX).toLong()
|
||||
try {
|
||||
val targetIndex = (Math.random() * TARGET_INDEX_MAX).toInt()
|
||||
@@ -955,6 +958,7 @@ class TaskManager private constructor() {
|
||||
continue
|
||||
}
|
||||
monitorLocation(lonlatPoint, mapAutoView)
|
||||
MapDataApi.cancelRoadTask()
|
||||
MapDataApi.getLimitSpeed(
|
||||
lonlatPoint.longitude,
|
||||
lonlatPoint.latitude,
|
||||
@@ -964,8 +968,8 @@ class TaskManager private constructor() {
|
||||
override fun result(code: Int, result: RoadInfo?) {
|
||||
|
||||
}
|
||||
})
|
||||
RoadHelper.getInstance()?.getZebraLine(
|
||||
},true)
|
||||
MapDataApi.getZebraLine(
|
||||
lonlatPoint.longitude,
|
||||
lonlatPoint.latitude,
|
||||
lonlatPoint.angle.toFloat(),
|
||||
@@ -975,8 +979,8 @@ class TaskManager private constructor() {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
RoadHelper.getInstance()?.getTrafficLight(
|
||||
},true)
|
||||
MapDataApi.getTrafficLight(
|
||||
lonlatPoint.longitude,
|
||||
lonlatPoint.latitude,
|
||||
lonlatPoint.angle.toFloat(),
|
||||
@@ -985,33 +989,31 @@ class TaskManager private constructor() {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
RoadHelper.getInstance()?.getCenterLineRange(
|
||||
},true)
|
||||
MapDataApi.getCenterLineRangeInfo(
|
||||
lonlatPoint.longitude,
|
||||
lonlatPoint.latitude,
|
||||
lonlatPoint.angle.toFloat(),
|
||||
10f,
|
||||
false,
|
||||
6,
|
||||
true,
|
||||
object : IResult<CenterLine> {
|
||||
override fun result(code: Int, result: CenterLine?) {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
RoadHelper.getInstance()?.getCenterLineRoadNode(
|
||||
},true)
|
||||
MapDataApi.getCenterLineRoadNode(
|
||||
lonlatPoint.latitude,
|
||||
lonlatPoint.latitude,
|
||||
lonlatPoint.angle.toFloat(),
|
||||
300f,
|
||||
true,
|
||||
object : IResult<CenterLine> {
|
||||
override fun result(code: Int, result: CenterLine?) {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
},true)
|
||||
delay(duration)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
@@ -1055,7 +1057,7 @@ class TaskManager private constructor() {
|
||||
suspend fun monitorDataAPI(trackIndex: Int, mapAutoView: MapAutoView) {
|
||||
dataFlag = true
|
||||
mDataJob?.cancel()
|
||||
mDataJob = mTaskScope?.launch(Dispatchers.Default) {
|
||||
mDataJob = mTaskScope?.launch(Dispatchers.IO) {
|
||||
val duration: Long = (Math.random() * DURATION_MAX).toLong()
|
||||
try {
|
||||
val targetIndex = (Math.random() * 2000).toInt()
|
||||
@@ -1090,7 +1092,7 @@ class TaskManager private constructor() {
|
||||
markerFlag = true
|
||||
mapAutoView.getLocationClient()?.setIsUseExtraGPSData(true)
|
||||
mMarkerJob?.cancel()
|
||||
mMarkerJob = mTaskScope?.launch(Dispatchers.Default) {
|
||||
mMarkerJob = mTaskScope?.launch(Dispatchers.IO) {
|
||||
val targetIndex = (Math.random() * TARGET_INDEX_MAX).toInt()
|
||||
val duration: Long = (Math.random() * DURATION_MAX).toLong()
|
||||
try {
|
||||
@@ -1129,7 +1131,7 @@ class TaskManager private constructor() {
|
||||
marker2DFlag = true
|
||||
mapAutoView.getMapAutoViewHelper()?.setIsUseExtraGPSData(true)
|
||||
m2DMarkerJob?.cancel()
|
||||
m2DMarkerJob = mTaskScope?.launch(Dispatchers.Default) {
|
||||
m2DMarkerJob = mTaskScope?.launch(Dispatchers.IO) {
|
||||
val targetIndex = (Math.random() * TARGET_INDEX_MAX).toInt()
|
||||
val duration: Long = (Math.random() * DURATION_MAX).toLong()
|
||||
try {
|
||||
@@ -1169,7 +1171,7 @@ class TaskManager private constructor() {
|
||||
polygonFlag = true
|
||||
mapAutoView.getLocationClient()?.setIsUseExtraGPSData(true)
|
||||
mPolygonJob?.cancel()
|
||||
mPolygonJob = mTaskScope?.launch(Dispatchers.Default) {
|
||||
mPolygonJob = mTaskScope?.launch(Dispatchers.IO) {
|
||||
val targetIndex = (Math.random() * TARGET_INDEX_MAX).toInt()
|
||||
val duration: Long = (Math.random() * DURATION_MAX).toLong()
|
||||
try {
|
||||
@@ -1308,7 +1310,7 @@ class TaskManager private constructor() {
|
||||
|
||||
fun monitorCacheHdData(mapAutoView: MapAutoView) {
|
||||
val lonLatPoint = mapAutoView.getCurrentLonLatPoint()
|
||||
RoadHelper.getInstance()?.getCityCode(lonLatPoint.longitude, lonLatPoint.latitude, object :
|
||||
MapDataApi.getCityCode(lonLatPoint.longitude, lonLatPoint.latitude, object :
|
||||
IResult<Int> {
|
||||
override fun result(code: Int, result: Int?) {
|
||||
result?.let {
|
||||
@@ -1325,13 +1327,13 @@ class TaskManager private constructor() {
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
},true)
|
||||
|
||||
}
|
||||
|
||||
fun monitorCacheHdData(mapAutoView: MapAutoView, tv: TextView) {
|
||||
val lonLatPoint = mapAutoView.getCurrentLonLatPoint()
|
||||
RoadHelper.getInstance()?.getCityCode(lonLatPoint.longitude, lonLatPoint.latitude, object :
|
||||
MapDataApi.getCityCode(lonLatPoint.longitude, lonLatPoint.latitude, object :
|
||||
IResult<Int> {
|
||||
override fun result(code: Int, id: Int?) {
|
||||
id?.let {
|
||||
@@ -1357,51 +1359,51 @@ class TaskManager private constructor() {
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},true)
|
||||
}
|
||||
|
||||
fun monitorGetAllCityCode() {
|
||||
RoadHelper.getInstance()?.getAllCityCode(object : IResult<ArrayList<CityInfo>> {
|
||||
MapDataApi.getAllCityCode(object : IResult<ArrayList<CityInfo>> {
|
||||
override fun result(code: Int, result: ArrayList<CityInfo>?) {
|
||||
|
||||
}
|
||||
})
|
||||
},true)
|
||||
|
||||
}
|
||||
|
||||
fun monitorGetAllCityCode(tv: TextView) {
|
||||
RoadHelper.getInstance()?.getAllCityCode(object : IResult<ArrayList<CityInfo>> {
|
||||
MapDataApi.getAllCityCode(object : IResult<ArrayList<CityInfo>> {
|
||||
override fun result(code: Int, result: ArrayList<CityInfo>?) {
|
||||
tv.text = "$result"
|
||||
}
|
||||
})
|
||||
},true)
|
||||
}
|
||||
|
||||
fun monitorCancelCacheHdData() {
|
||||
RoadHelper.getInstance()?.cancelCacheHDData()
|
||||
MapDataApi.cancelCacheHDData()
|
||||
}
|
||||
|
||||
fun monitorGetDataVersion(mapAutoView: MapAutoView) {
|
||||
val center = DoubleArray(2)
|
||||
mapAutoView.getMapController()?.getCenter(center)
|
||||
RoadHelper.getInstance()?.getHdDataVersionByCity(center[0], center[1], object :
|
||||
MapDataApi.getHdDataVersionByCity(center[0], center[1], object :
|
||||
IResult<String> {
|
||||
override fun result(code: Int, result: String?) {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
},true)
|
||||
}
|
||||
|
||||
fun monitorGetDataVersion(tv: TextView, mapAutoView: MapAutoView) {
|
||||
val center = DoubleArray(2)
|
||||
mapAutoView.getMapController()?.getCenter(center)
|
||||
RoadHelper.getInstance()?.getHdDataVersionByCity(center[0], center[1], object :
|
||||
MapDataApi.getHdDataVersionByCity(center[0], center[1], object :
|
||||
IResult<String> {
|
||||
override fun result(code: Int, version: String?) {
|
||||
tv.text = "数据版本:$version"
|
||||
}
|
||||
})
|
||||
},true)
|
||||
|
||||
}
|
||||
|
||||
@@ -1472,7 +1474,7 @@ class TaskManager private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
},true)
|
||||
|
||||
}
|
||||
|
||||
@@ -1480,7 +1482,7 @@ class TaskManager private constructor() {
|
||||
fun monitorGetZebraLine(lonlatPoint: LonLatPoint, mapAutoView: MapAutoView) {
|
||||
val deleteLineList = CopyOnWriteArrayList<String>()
|
||||
val currentLineList = CopyOnWriteArrayList<String>()
|
||||
RoadHelper.getInstance()?.getZebraLineByDistance(
|
||||
MapDataApi.getZebraLineByDistance(
|
||||
lonlatPoint.longitude,
|
||||
lonlatPoint.latitude,
|
||||
lonlatPoint.angle.toFloat(),
|
||||
@@ -1521,7 +1523,7 @@ class TaskManager private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
},true)
|
||||
|
||||
for (key in zebraLineMap.keys) {
|
||||
if (!currentLineList.contains(key)) {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.tools;
|
||||
package com.zhidaoauto.map.sdk.open.common.tools;
|
||||
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.tools
|
||||
package com.zhidaoauto.map.sdk.open.common.tools
|
||||
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
|
||||
@@ -47,52 +47,55 @@ object MapDataApi {
|
||||
SharedMemoryService.getInstance(context)
|
||||
}
|
||||
|
||||
fun destroy(){
|
||||
/**
|
||||
* 销毁操作,释放资源
|
||||
*/
|
||||
fun destroy() {
|
||||
// 释放 RoadHelper 实例
|
||||
RoadHelper.getInstance()?.release()
|
||||
if(CompileConfig.DEBUG){
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.w(TAG, "destroyop--:RoadHelper.destroy")
|
||||
}
|
||||
// 退出 SharedMemoryService
|
||||
SharedMemoryService.getInstance(mContext).exit()
|
||||
if(CompileConfig.DEBUG){
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.w(TAG, "destroyop--:SharedMemoryService.destroy")
|
||||
}
|
||||
mContext = null
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断服务是否开启
|
||||
* 判断指定服务是否正在运行
|
||||
*
|
||||
* @return
|
||||
* @param context 上下文
|
||||
* @param ServiceName 服务的类名
|
||||
* @return 服务是否正在运行
|
||||
*/
|
||||
fun isServiceRunning(context: Context, ServiceName: String): Boolean {
|
||||
// if (true) {
|
||||
// return false
|
||||
// }
|
||||
// if (TextUtils.isEmpty(ServiceName)) {
|
||||
// return false
|
||||
// }
|
||||
// val myManager = context
|
||||
// .getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
|
||||
// val runningServices = myManager
|
||||
// .getRunningServices(50) as ArrayList<ActivityManager.RunningServiceInfo>
|
||||
// for (info in runningServices) {
|
||||
// if (info.service.className == ServiceName) {
|
||||
// return true
|
||||
// }
|
||||
// }
|
||||
if (true) {
|
||||
return false
|
||||
}
|
||||
if (TextUtils.isEmpty(ServiceName)) {
|
||||
return false
|
||||
}
|
||||
val myManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
|
||||
val runningServices = myManager.getRunningServices(50) as ArrayList<ActivityManager.RunningServiceInfo>
|
||||
for (info in runningServices) {
|
||||
if (info.service.className == ServiceName) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取道路关键点数据
|
||||
*
|
||||
* @param lonLatPoints 道路上的经纬度点列表
|
||||
* @param bGetAllPoints 是否获取所有关键点
|
||||
* @return 匹配的关键点列表
|
||||
*/
|
||||
fun getMatchRoadInfo(
|
||||
lonLatPoints: List<LonLatPoint>,
|
||||
bGetAllPoints: Boolean
|
||||
): List<LonLatPoint>? {
|
||||
fun getMatchRoadInfo(lonLatPoints: List<LonLatPoint>, bGetAllPoints: Boolean): List<LonLatPoint>? {
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.i(TAG, "roadop getMatchRoadInfo")
|
||||
}
|
||||
@@ -105,7 +108,6 @@ object MapDataApi {
|
||||
}
|
||||
if (CompileConfig.DEBUG) {
|
||||
LogHelper.info(TAG, "roadop getMatchRoadInfo--param:${originArray.joinToString()}")
|
||||
// Recorder.i("${originArray.joinToString()}")
|
||||
}
|
||||
val resultArray = RoadHelper.getInstance()?.getMatchRoadInfo(originArray, bGetAllPoints)
|
||||
if (CompileConfig.DEBUG) {
|
||||
@@ -126,25 +128,25 @@ object MapDataApi {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取行车方向
|
||||
* 获取两点之间的行车方向角度
|
||||
*
|
||||
* @param startLonLat 起点经纬度
|
||||
* @param endLonLat 终点经纬度
|
||||
* @return 行车方向角度
|
||||
*/
|
||||
fun getRouteAngle(startLonLat: LonLatPoint, endLonLat: LonLatPoint): Float {
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.i(TAG, "queryop getRouteAngle")
|
||||
}
|
||||
val start =
|
||||
CommonProxy.getInstance().getLonLatProxy().switchLonLat(startLonLat)
|
||||
val end =
|
||||
CommonProxy.getInstance().getLonLatProxy().switchLonLat(endLonLat)
|
||||
val start = CommonProxy.getInstance().getLonLatProxy().switchLonLat(startLonLat)
|
||||
val end = CommonProxy.getInstance().getLonLatProxy().switchLonLat(endLonLat)
|
||||
return RoadHelper.getInstance()?.getRouteAngle(
|
||||
start.lon.toFloat(),
|
||||
start.lat.toFloat(),
|
||||
end.lon.toFloat(),
|
||||
end.lat.toFloat()
|
||||
)?:0f
|
||||
) ?: 0f
|
||||
}
|
||||
|
||||
// 匹配车道中心线数据
|
||||
@@ -154,116 +156,208 @@ object MapDataApi {
|
||||
return RoadHelper.getInstance()?.getSinglePointMatchRoad(lon, lat, angle, isGps,isRTK)
|
||||
}
|
||||
|
||||
// 获取车道中心线数据
|
||||
/**
|
||||
* 获取车道中心线数据
|
||||
*
|
||||
* @param tileId 瓦片 ID
|
||||
* @param routeId 路线 ID
|
||||
* @return 车道中心线数据列表
|
||||
*/
|
||||
fun getLaneInfo(tileId: Long, routeId: Int): ArrayList<Lane>? {
|
||||
Recorder.add("roadop-getLimitSpeed:$tileId,$routeId")
|
||||
return RoadHelper.getInstance()?.getLaneInfo(tileId, routeId)
|
||||
}
|
||||
|
||||
// 获取点到线段的距离
|
||||
fun GetDisFromPointToLine( ptOrg:LonLatPoint, pLine:ArrayList<LonLatPoint>, ptMatch:LonLatPoint, nSegmentOrder:Int):Double {
|
||||
/**
|
||||
* 获取点到线段的距离
|
||||
*
|
||||
* @param ptOrg 原始点
|
||||
* @param pLine 线段的点列表
|
||||
* @param ptMatch 匹配点
|
||||
* @param nSegmentOrder 线段的序号
|
||||
* @return 点到线段的距离
|
||||
*/
|
||||
fun GetDisFromPointToLine(ptOrg: LonLatPoint, pLine: ArrayList<LonLatPoint>, ptMatch: LonLatPoint, nSegmentOrder: Int): Double {
|
||||
return GisGeomTool.GetDisFromPointToLine(ptOrg, pLine, ptMatch, nSegmentOrder)
|
||||
}
|
||||
|
||||
// 获取点到线段的最近距离
|
||||
/**
|
||||
* 获取点到线段的最近距离
|
||||
*
|
||||
* @param x 点的横坐标
|
||||
* @param y 点的纵坐标
|
||||
* @param x1 线段起点的横坐标
|
||||
* @param y1 线段起点的纵坐标
|
||||
* @param x2 线段终点的横坐标
|
||||
* @param y2 线段终点的纵坐标
|
||||
* @return 点到线段的最近距离
|
||||
*/
|
||||
fun getNearstFromPointToSegment(x: Double, y: Double, x1: Double, y1: Double, x2: Double, y2: Double): Double {
|
||||
return MathUtils.minDistance(x, y, x1, y1, x2, y2)
|
||||
}
|
||||
|
||||
//获取限速接口
|
||||
fun getLimitSpeed(lon: Double,lat: Double,angle: Float,call: IResult<RoadInfo>){
|
||||
/**
|
||||
* 获取限速接口
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 航向角
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getLimitSpeed(lon: Double, lat: Double, angle: Float, call: IResult<RoadInfo>, isCanCancel: Boolean = false): String? {
|
||||
Recorder.add("roadop-getLimitSpeed:$lon,$lat,$angle")
|
||||
RoadHelper.getInstance()?.getRoadLimitSpeed(lon,lat,angle,true,call)
|
||||
return RoadHelper.getInstance()?.getRoadLimitSpeed(lon, lat, angle, isCanCancel, call)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取点与道路边界的距离
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 航向角
|
||||
* @return 点到道路边界的距离
|
||||
*/
|
||||
fun getOffRoadDistance(lon: Double, lat: Double, angle: Float): Double {
|
||||
Recorder.add("roadop-getOffRoadDistance:$lon,$lat,$angle")
|
||||
return RoadHelper.getInstance()?.getOffRoadDistance(lon, lat, angle)?:0.0
|
||||
return RoadHelper.getInstance()?.getOffRoadDistance(lon, lat, angle) ?: 0.0
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取停止线信息
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 航向角
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getStopLineInfo(lon: Double, lat: Double, angle: Float,call: IResult<StopLine>) {
|
||||
fun getStopLineInfo(lon: Double, lat: Double, angle: Float, call: IResult<StopLine>, isCanCancel: Boolean = false): String? {
|
||||
Recorder.add("roadop-getStopLineInfo:$lon,$lat,$angle")
|
||||
RoadHelper.getInstance()?.getStopLine(lon, lat, angle,false,call)
|
||||
return RoadHelper.getInstance()?.getStopLine(lon, lat, angle, isCanCancel, call)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取行驶方向一定长度的中心线
|
||||
* lon:经度
|
||||
* lat:纬度
|
||||
* angle:航向角
|
||||
* dis:获取车道中心线的长度 正 行驶方向前方距离 负 行驶方向后方距离
|
||||
* isSmooth:是否平滑
|
||||
* orders:贝塞尔阶数
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 航向角
|
||||
* @param dis 获取车道中心线的长度,正值为行驶方向前方距离,负值为行驶方向后方距离
|
||||
* @param isSmooth 是否平滑
|
||||
* @param orders 贝塞尔阶数
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getCenterLineRangeInfo(lon: Double, lat: Double, angle: Float, dis: Float,isSmooth: Boolean,orders:Int, call: IResult<CenterLine>) {
|
||||
fun getCenterLineRangeInfo(lon: Double, lat: Double, angle: Float, dis: Float, isSmooth: Boolean, orders: Int, call: IResult<CenterLine>, isCanCancel: Boolean = false): String? {
|
||||
Recorder.add("roadop-getCenterLineRangeInfo:$lon,$lat,$angle,$dis")
|
||||
if(isSmooth && orders < 3){
|
||||
call.result(-1,null)
|
||||
return
|
||||
if (isSmooth && orders < 3) {
|
||||
call.result(-1, null)
|
||||
return null
|
||||
}
|
||||
RoadHelper.getInstance()?.getCenterLineRange(lon, lat, angle,dis,isSmooth,orders,false, call)
|
||||
return RoadHelper.getInstance()?.getCenterLineRange(lon, lat, angle, dis, isSmooth, orders, isCanCancel, call)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取行驶方向一定长度的中心线
|
||||
* lon:经度
|
||||
* lat:纬度
|
||||
* angle:航向角
|
||||
* dis:获取车道中心线的长度 正 行驶方向前方距离 负 行驶方向后方距离
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 航向角
|
||||
* @param dis 获取车道中心线的长度,正值为行驶方向前方距离,负值为行驶方向后方距离
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getCenterLineRoadNode(lon: Double, lat: Double, angle: Float, dis: Float,call: IResult<CenterLine>){
|
||||
fun getCenterLineRoadNode(lon: Double, lat: Double, angle: Float, dis: Float, call: IResult<CenterLine>, isCanCancel: Boolean = false): String? {
|
||||
Recorder.add("roadop-getCenterLineRoadNode:$lon,$lat,$angle,$dis")
|
||||
RoadHelper.getInstance()?.getCenterLineRoadNode(lon, lat, angle,dis,false,call)
|
||||
return RoadHelper.getInstance()?.getCenterLineRoadNode(lon, lat, angle, dis, isCanCancel, call)
|
||||
}
|
||||
|
||||
|
||||
fun getRoadName(lon: Double, lat: Double, angle: Float, call: IResult<RoadNameInfo>){
|
||||
/**
|
||||
* 获取道路名称信息
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 航向角
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getRoadName(lon: Double, lat: Double, angle: Float, call: IResult<RoadNameInfo>, isCanCancel: Boolean = false): String? {
|
||||
Recorder.add("roadop-getRoadName:$lon,$lat,$angle")
|
||||
RoadHelper.getInstance()?.getRoadName(lon, lat, angle,call)
|
||||
return RoadHelper.getInstance()?.getRoadName(lon, lat, angle, isCanCancel, call)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取道路路口信息
|
||||
*
|
||||
* @param dLon 经度
|
||||
* @param dLat 纬度
|
||||
* @param fAngle 航向角
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getCrossRoad(dLon: Double, dLat: Double , fAngle: Float,call: IResult<RoadCross>){
|
||||
fun getCrossRoad(dLon: Double, dLat: Double, fAngle: Float, call: IResult<RoadCross>, isCanCancel: Boolean = false): String? {
|
||||
Recorder.add("roadop-getCrossRoad:$dLon,$dLat,$fAngle")
|
||||
RoadHelper.getInstance()?.getCrossRoad(dLon, dLat, fAngle,false,call)
|
||||
}
|
||||
/**
|
||||
* 根据路口id获取道路信息
|
||||
*/
|
||||
fun getCrossRoadById(tileId: Int, id: Long,call: IResult<ArrayList<LonLatPoint>>){
|
||||
Recorder.add("roadop-getCrossRoadById:$tileId,$id")
|
||||
RoadHelper.getInstance()?.getCrossRoadById(tileId, id,call)
|
||||
return RoadHelper.getInstance()?.getCrossRoad(dLon, dLat, fAngle, isCanCancel, call)
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据路口 ID 获取道路信息
|
||||
*
|
||||
* @param tileId 瓦片 ID
|
||||
* @param id 路口 ID
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getCrossRoadById(tileId: Int, id: Long, call: IResult<ArrayList<LonLatPoint>>, isCanCancel: Boolean = false): String? {
|
||||
Recorder.add("roadop-getCrossRoadById:$tileId,$id")
|
||||
return RoadHelper.getInstance()?.getCrossRoadById(tileId, id, isCanCancel, call)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取道路矩形点
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 航向角
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getRoadRectInfo(lon: Double, lat: Double, angle: Float,call : IResult<RoadRectInfos>) {
|
||||
RoadHelper.getInstance()?.getRoadRect(lon, lat, angle,call)
|
||||
fun getRoadRectInfo(lon: Double, lat: Double, angle: Float, call: IResult<RoadRectInfos>, isCanCancel: Boolean = false): String? {
|
||||
return RoadHelper.getInstance()?.getRoadRect(lon, lat, angle, isCanCancel, call)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取车道中心线信息
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 航向角
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getCenterLineInfo(lon: Double, lat: Double, angle: Float,call: IResult<CenterLine>) {
|
||||
fun getCenterLineInfo(lon: Double, lat: Double, angle: Float, call: IResult<CenterLine>, isCanCancel: Boolean = false): String? {
|
||||
Recorder.add("roadop-getCenterLineInfo:$lon,$lat,$angle")
|
||||
RoadHelper.getInstance()?.getCenterLine(lon, lat, angle,false,call)
|
||||
return RoadHelper.getInstance()?.getCenterLine(lon, lat, angle, isCanCancel, call)
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否合法的经纬度
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @return 是否合法的经纬度
|
||||
*/
|
||||
fun isRightLonLat(lon:Double,lat:Double):Boolean{
|
||||
fun isRightLonLat(lon: Double, lat: Double): Boolean {
|
||||
var rightLon = false
|
||||
var rightLat = false
|
||||
if (lon > -180.0 && lon < 180.0) {
|
||||
@@ -273,125 +367,262 @@ object MapDataApi {
|
||||
rightLat = true
|
||||
}
|
||||
return rightLon && rightLat
|
||||
|
||||
}
|
||||
|
||||
fun modifyRedisFileVersion(version:Int){
|
||||
|
||||
/**
|
||||
* 修改 Redis 文件版本
|
||||
*
|
||||
* @param version 新的 Redis 文件版本
|
||||
*/
|
||||
fun modifyRedisFileVersion(version: Int) {
|
||||
RoadHelper.getInstance()?.modifyRedisFileVersion(version)
|
||||
}
|
||||
|
||||
fun updateCacheFile(){
|
||||
/**
|
||||
* 更新缓存文件
|
||||
*/
|
||||
fun updateCacheFile() {
|
||||
RoadHelper.getInstance()?.updateCacheFile()
|
||||
}
|
||||
|
||||
|
||||
fun getZebraLineByDistance(dLon: Double, dlat: Double , fAngle: Float, dis: Float,call: IResult<MutableList<ZebraLine>>){
|
||||
/**
|
||||
* 根据距离获取斑马线信息
|
||||
*
|
||||
* @param dLon 经度
|
||||
* @param dlat 纬度
|
||||
* @param fAngle 角度
|
||||
* @param dis 距离
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getZebraLineByDistance(dLon: Double, dlat: Double, fAngle: Float, dis: Float, call: IResult<MutableList<ZebraLine>>, isCanCancel: Boolean = false): String? {
|
||||
Recorder.add("$dLon,$dlat,$fAngle,$dis")
|
||||
RoadHelper.getInstance()?.getZebraLineByDistance(dLon, dlat, fAngle, dis,call)
|
||||
return RoadHelper.getInstance()?.getZebraLineByDistance(dLon, dlat, fAngle, dis, isCanCancel, call)
|
||||
}
|
||||
|
||||
//计算两线交点
|
||||
/**
|
||||
* 计算两条线的交点
|
||||
*
|
||||
* @param lineSelf 第一条线的点列表
|
||||
* @param lineOther 第二条线的点列表
|
||||
* @return 包含交点和交点距离的 Pair 对象
|
||||
*/
|
||||
fun getIntersection(lineSelf: ArrayList<LonLatPoint>, lineOther: ArrayList<LonLatPoint>): Pair<LonLatPoint?, Double?> {
|
||||
return MathUtils.getIntersection(lineSelf, lineOther)
|
||||
}
|
||||
//获取动态线
|
||||
fun getDynamicLinePoints(centerLonLatPoint: LonLatPoint, pointList: MutableList<LonLatPoint>): MutableList<LonLatPoint>?{
|
||||
|
||||
/**
|
||||
* 获取动态线上的点
|
||||
*
|
||||
* @param centerLonLatPoint 动态线的中心点
|
||||
* @param pointList 线上的点列表
|
||||
* @return 动态线上的最近点列表
|
||||
*/
|
||||
fun getDynamicLinePoints(centerLonLatPoint: LonLatPoint, pointList: MutableList<LonLatPoint>): MutableList<LonLatPoint>? {
|
||||
return MathUtils.getNearestPoints(centerLonLatPoint, pointList)
|
||||
}
|
||||
|
||||
fun initFileCacheByCity(lon :Double, lat: Double){
|
||||
/**
|
||||
* 根据城市经纬度初始化文件缓存
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
*/
|
||||
fun initFileCacheByCity(lon: Double, lat: Double) {
|
||||
RoadHelper.getInstance()?.initFileCacheByCity(lon, lat)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取城市列表
|
||||
* 获取所有城市编码列表
|
||||
*
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getAllCityCode(call:IResult<ArrayList<CityInfo>>){
|
||||
if(CompileConfig.DEBUG){
|
||||
fun getAllCityCode(call: IResult<ArrayList<CityInfo>>, isCanCancel: Boolean = false): String? {
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.i(TAG, "cacheop-getAllCityCode")
|
||||
}
|
||||
RoadHelper.getInstance()?.getAllCityCode(call)
|
||||
return RoadHelper.getInstance()?.getAllCityCode(isCanCancel, call)
|
||||
}
|
||||
|
||||
|
||||
fun getCityCode(lon: Double, lat: Double,call:IResult<Int>){
|
||||
if(CompileConfig.DEBUG){
|
||||
/**
|
||||
* 根据经纬度获取城市编码
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getCityCode(lon: Double, lat: Double, call: IResult<Int>, isCanCancel: Boolean = false): String? {
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.i(TAG, "cacheop-getCityCode")
|
||||
}
|
||||
RoadHelper.getInstance()?.getCityCode(lon, lat,call)
|
||||
return RoadHelper.getInstance()?.getCityCode(lon, lat, isCanCancel, call)
|
||||
}
|
||||
|
||||
fun isCacheCity(lon: Double, lat: Double,call:IResult<Boolean>){
|
||||
if(CompileConfig.DEBUG){
|
||||
/**
|
||||
* 判断城市数据是否已缓存
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun isCacheCity(lon: Double, lat: Double, call: IResult<Boolean>, isCanCancel: Boolean = false): String? {
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.i(TAG, "cacheop-isCacheCity")
|
||||
}
|
||||
RoadHelper.getInstance()?.isCityDataCached(lon, lat,call)
|
||||
return RoadHelper.getInstance()?.isCityDataCached(lon, lat, isCanCancel, call)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取城市数据版本
|
||||
* 根据城市经纬度获取地图数据版本
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getHdDataVersionByCity(lon: Double,lat: Double,call:IResult<String>){
|
||||
if(CompileConfig.DEBUG){
|
||||
fun getHdDataVersionByCity(lon: Double, lat: Double, call: IResult<String>, isCanCancel: Boolean = false): String? {
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.i(TAG, "cacheop-getHdDataVersionByCity:$lon,$lat")
|
||||
}
|
||||
RoadHelper.getInstance()?.getHdDataVersionByCity(lon, lat,call)
|
||||
return RoadHelper.getInstance()?.getHdDataVersionByCity(lon, lat, isCanCancel, call)
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消缓存数据
|
||||
* 取消缓存地图数据
|
||||
*/
|
||||
fun cancelCacheHDData(){
|
||||
if(CompileConfig.DEBUG){
|
||||
fun cancelCacheHDData() {
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.i(TAG, "cacheop-cancelCacheHDData:")
|
||||
}
|
||||
RoadHelper.getInstance()?.cancelCacheHDData()
|
||||
}
|
||||
|
||||
/**
|
||||
* 按照城市缓存高精数据
|
||||
* 根据城市 ID 缓存地图数据
|
||||
*
|
||||
* @param id 城市 ID
|
||||
* @param listener 地图数据下载监听器
|
||||
*/
|
||||
fun cacheHDDataByCity(id: Int, listener: OnHdDataDownByCityListener){
|
||||
if(CompileConfig.DEBUG){
|
||||
fun cacheHDDataByCity(id: Int, listener: OnHdDataDownByCityListener,isCanCancel: Boolean=false) {
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.i(TAG, "cacheop-cacheHDDataByCity: $id")
|
||||
}
|
||||
RoadHelper.getInstance()?.cacheHDDataByCity(id, listener)
|
||||
RoadHelper.getInstance()?.cacheHDDataByCity(id,isCanCancel,listener)
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消过去时间段里的道路相关的任务
|
||||
* 取消过去时间段里的道路相关任务
|
||||
*/
|
||||
fun cancelRoadTask(){
|
||||
fun cancelRoadTask() {
|
||||
RoadHelper.getInstance()?.cancelTask()
|
||||
}
|
||||
|
||||
/**
|
||||
* 按照经纬度缓存城市数据
|
||||
* 根据经纬度缓存城市数据
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param listener 地图数据下载监听器
|
||||
*/
|
||||
fun cacheHDDataByCityByLonLat(lon: Double, lat: Double, listener: OnHdDataDownByCityListener){
|
||||
if(CompileConfig.DEBUG){
|
||||
fun cacheHDDataByCityByLonLat(lon: Double, lat: Double, listener: OnHdDataDownByCityListener,isCanCancel: Boolean=false) {
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.i(TAG, "cacheop-cacheHDDataByCityByLonLat: $lon,$lat")
|
||||
}
|
||||
RoadHelper.getInstance()?.cacheHDDataByCityLonLat(lon, lat, listener)
|
||||
RoadHelper.getInstance()?.cacheHDDataByCityLonLat(lon, lat,isCanCancel, listener)
|
||||
}
|
||||
|
||||
fun addHdDataDownListener(id: Int, onHdDataDownByCityListener: OnHdDataDownByCityListener){
|
||||
|
||||
/**
|
||||
* 添加地图数据下载监听器
|
||||
*
|
||||
* @param id 监听器标识符
|
||||
* @param onHdDataDownByCityListener 地图数据下载监听器
|
||||
*/
|
||||
fun addHdDataDownListener(id: Int, onHdDataDownByCityListener: OnHdDataDownByCityListener) {
|
||||
RoadHelper.getInstance()?.addHdDataDownListener(id, onHdDataDownByCityListener)
|
||||
}
|
||||
fun removeHdDataDownListener(id: Int){
|
||||
|
||||
/**
|
||||
* 移除地图数据下载监听器
|
||||
*
|
||||
* @param id 监听器标识符
|
||||
*/
|
||||
fun removeHdDataDownListener(id: Int) {
|
||||
RoadHelper.getInstance()?.removeHdDataDownListener(id)
|
||||
}
|
||||
|
||||
fun isInRoadSideFenceRegion(lon: Double, lat: Double, call:IResult<Int>){
|
||||
RoadHelper.getInstance()?.isInRoadSideFenceRegion(lon,lat, call)
|
||||
/**
|
||||
* 判断点是否在道路边界围栏区域内
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun isInRoadSideFenceRegion(lon: Double, lat: Double, call: IResult<Int>, isCanCancel: Boolean = false): String? {
|
||||
return RoadHelper.getInstance()?.isInRoadSideFenceRegion(lon, lat, isCanCancel, call)
|
||||
}
|
||||
|
||||
|
||||
fun getRouteInfo(routeList : ArrayList<LonLatPoint>,call:IResult<RoutePath> ){
|
||||
RoadHelper.getInstance()?.getRouteInfo(routeList,call)
|
||||
/**
|
||||
* 获取路线信息
|
||||
*
|
||||
* @param routeList 路线点列表
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getRouteInfo(routeList: ArrayList<LonLatPoint>, call: IResult<RoutePath>, isCanCancel: Boolean = false): String? {
|
||||
return RoadHelper.getInstance()?.getRouteInfo(routeList, isCanCancel, call)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取交通灯信息
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 角度
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getTrafficLight(lon: Double, lat: Double, angle: Float, call: IResult<String>, isCanCancel: Boolean = false): String? {
|
||||
return RoadHelper.getInstance()?.getTrafficLight(lon, lat, angle, isCanCancel, call)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取斑马线信息
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 角度
|
||||
* @param call 结果回调
|
||||
* @param isCanCancel 是否允许取消操作
|
||||
* @return 操作结果的字符串
|
||||
*/
|
||||
fun getZebraLine(lon: Double, lat: Double, angle: Float, call: IResult<String>, isCanCancel: Boolean = false): String? {
|
||||
return RoadHelper.getInstance()?.getZebraLine(lon, lat, angle, isCanCancel, call)
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除道路 API 密钥
|
||||
*
|
||||
* @param key 道路 API 密钥
|
||||
*/
|
||||
fun removeRoadApiKey(key: String) {
|
||||
RoadHelper.getInstance()?.removeRoadApiKey(key)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.zhidaoauto.map.sdk.open.business
|
||||
package com.zhidaoauto.map.sdk.open.helpers
|
||||
|
||||
import android.util.Log
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
import com.zhidaoauto.map.sdk.inner.CompileConfig
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools
|
||||
import com.zhidaoauto.map.sdk.open.common.tools.MapTools
|
||||
|
||||
|
||||
object DeadZoneHelper {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.business
|
||||
package com.zhidaoauto.map.sdk.open.helpers
|
||||
|
||||
import com.zhidaoauto.map.sdk.inner.abs.IMapController
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open
|
||||
package com.zhidaoauto.map.sdk.open.logics
|
||||
|
||||
enum class LogLevels(
|
||||
val type: Int
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.camera
|
||||
package com.zhidaoauto.map.sdk.open.logics.camera
|
||||
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
|
||||
@@ -111,7 +111,7 @@ class CameraPosition(
|
||||
}
|
||||
|
||||
fun builder(cameraPosition: CameraPosition): Builder {
|
||||
return CameraPosition.Builder(cameraPosition)
|
||||
return Builder(cameraPosition)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
package com.zhidaoauto.map.sdk.open.camera
|
||||
package com.zhidaoauto.map.sdk.open.logics.camera
|
||||
|
||||
class CameraUpdate(val cameraUpdateFactoryDelegate: MapCameraMessage)
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.camera
|
||||
package com.zhidaoauto.map.sdk.open.logics.camera
|
||||
|
||||
import android.graphics.Point
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.camera
|
||||
package com.zhidaoauto.map.sdk.open.logics.camera
|
||||
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
import com.zhidaoauto.map.sdk.inner.utils.TransformUtils
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.camera
|
||||
package com.zhidaoauto.map.sdk.open.logics.camera
|
||||
|
||||
import android.graphics.Point
|
||||
|
||||
@@ -22,7 +22,7 @@ abstract class MapCameraMessage {
|
||||
|
||||
init {
|
||||
this.nowType =
|
||||
Type.none
|
||||
Type.none
|
||||
this.isChangeFinished = false
|
||||
this.focus = null
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zhidaoauto.map.sdk.open.circle
|
||||
package com.zhidaoauto.map.sdk.open.logics.circle
|
||||
|
||||
import com.zhidaoauto.map.sdk.inner.abs.IMapController
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user