[map-sdk]同步地图3.2.0修改 1.增加聚焦自车周边车辆 2.车道中心线数据平滑处理

This commit is contained in:
jiaguofeng
2023-09-19 10:59:09 +08:00
parent c467a8a50d
commit f29829751c
45 changed files with 777 additions and 609 deletions

View File

@@ -1,59 +0,0 @@
package com.autonavi.nge;
import com.zhidaoauto.map.sdk.inner.CompileConfig;
import com.zhidaoauto.map.sdk.inner.road.RoadResultController;
public class MapBox {
private static final String TAG = "MapBox";
static {
System.loadLibrary("map");
}
public MapBox(){
llaInit(this);
}
public native void llaInit(MapBox mapBox);
public native void llaGetCenterLine(double dLon, double dLat, float fAngle);
public native void llaStopLine(double dLon, double dLat, float fAngle);
public native void llaGetZebraLine(double dLon, double dLat, float fAngle);
public native void llaGetTrafficLight(double dLon, double dLat, float fAngle);
public native void llaMergedRoadRect(double dLon, double dLat, float fAngle);
public native void llaGetRoadLimitSpeed(double dLon, double dLat, float fAngle);
public native void llaGetCenterLineRange(double dLon, double dLat, float fAngle,float fDis,boolean isSmooth,int orders);
public native void llaGetRoadName(double dLon, double dLat, float fAngle);
public native void llaGetCenterLineRoadNode(double dLon, double dLat, float fAngle,float fDis);
public native void llaGetCrossRoad(double dLon, double dLat, float fAngle);
public native void llaGetCrossRoadById(int tileId, long id);
public native void llaIsInZebraLine(double dLon, double dLat, float fAngle);
public native void llaGetZebraLineByDistance(double dLon, double dLat, float fAngle,float dis);
public native void updateCacheFile();
public native void modifyRedisFileVersion(int version);
/*@return value format: cityCode1,chineseCityName1,englishCityName1,isCache1;cityCode2,chineseCityName2,englishCityName2,isCache2;...;*/
public native void getAllCityCode();
public native void cacheHDDataByCity(int id);
public native void getCityCode(double lon, double lat);
public native void getCacheProgressByCity(int id);
public native void cacheHDDataByCityLonLat(double lon,double lat);
public native void cancelCacheHDData();
public native void initFileCacheByCity(double lon, double lat);
public native void getHdDataVersionByCity(double lon,double lat);
public native void llaRelease();
static void resultCallbackByteStream(String key,byte[] result){
if(CompileConfig.INSTANCE.getDEBUG()){
// Log.d(TAG, "roadop--resultCallbackDouble: " +"key:" + key + " + " result:"+ result.length);
}
if (result == null || result.length < 1) {
return;
}
RoadResultController.getInstance().dispatchRoadResult(0,key,result);
}
}

View File

@@ -41,7 +41,7 @@ public class SharedMemoryService {
unload();
}
private native static int initSharedMemory_Native(String dir, String tilesDir,int[] tileFilter);
private native static int initSharedMemory_Native(String dir, String mogoStyleDir,String tilesDir,int[] tileFilter);
private native static boolean testRoutingTile(int i, int j, int k);
@@ -64,7 +64,7 @@ public class SharedMemoryService {
if (CompileConfig.INSTANCE.getDEBUG()) {
Log.i(TAG, "autoop-dir:" + dir+",SharedMemory--cachePath:"+cachePath);
}
initSharedMemory_Native(dir, cachePath,MapHelper.INSTANCE.getMMapParams().getQZoneFilterArray());
initSharedMemory_Native(dir,MapHelper.INSTANCE.getMMapParams().getStyleDir(),cachePath,MapHelper.INSTANCE.getMMapParams().getQZoneFilterArray());
}

View File

@@ -4,8 +4,8 @@ import android.os.Parcel;
import android.os.Parcelable;
public class LonLat implements Parcelable {
private double lon;
private double lat;
private double lon = - 1.0;
private double lat = - 1.0;
private double alt;

View File

@@ -998,15 +998,15 @@ class MapEngine {
mObj = 0
}
}
fun setLightWave(da:DoubleArray){
fun setLightWave(cmd:String){
if (mObj != 0L) {
setLightWaveJni(mObj,da)
setPainterCmdJni(mObj,"lightwave",cmd)
}
}
fun setGuideLine(da:DoubleArray?){
fun setGuideLine(cmd:String?){
if (mObj != 0L) {
setGuideLineJni(mObj,da)
setPainterCmdJni(mObj,"guideline",cmd)
}
}
fun setTexture(name: String,ba:ByteArray?){
@@ -1623,7 +1623,6 @@ class MapEngine {
private external fun drawDeadZoneJni(obj: Long,strJsonOption: String?)
private external fun setDeadZoneVisiableJni(obj:Long,b: Boolean)
private external fun setLightWaveJni(obj: Long,da:DoubleArray) //光波移动lon1,lat1,lon2,lat2...width,duration
private external fun setGuideLineJni(obj: Long,da:DoubleArray?) //带纹理的引导线
private external fun setTextureJni(obj: Long,name:String,ba:ByteArray?) //设置一些元素的纹理,比如路面("road"),地面("plane")啥的
private external fun setPainterCmdJni(obj: Long,name:String?,cmd:String?)
}

View File

@@ -18,7 +18,6 @@ import android.view.SurfaceHolder
import android.view.View
import com.alibaba.fastjson.JSON
import com.zhidaoauto.map.data.point.LonLatPoint
import com.zhidaoauto.map.sdk.inner.CompileConfig
import com.zhidaoauto.map.sdk.inner.CompileConfig.DEBUG
import com.zhidaoauto.map.sdk.inner.abs.IEventController
import com.zhidaoauto.map.sdk.inner.abs.ILockLocation
@@ -86,7 +85,6 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
private var m_fLastAverageDistanceFromCenter = -1f
private var m_iMultiTouchCnt = 0
private var m_FPS = 60
private var lastUpdateTime: Long = 0
private val mGestureDetector: GestureDetector
//The controller of map
private var mMapController: IMapController? = null
@@ -98,16 +96,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
// down事件时间
private var lastDownTime = 0L
// 上次ScaleBy事件时间
private var lastScaleByTime = 0L
// 上次时间
private var lastTime = 0L
// 事件间隔
private final val eventScaleInterval = 30L // 事件间隔
private final val eventInterval = 30L
private val eventInterval = 30L
//已初始化Surface
private var mSurfaceCreated: AtomicBoolean = AtomicBoolean(false)
@@ -119,7 +108,6 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
private var mPoiTouchEnable = true
private var mViewWidth = 1920
private var mViewHeight = 1040
var mLonLat: LonLat? = null
private val ZOOM_CHANGE = 0x7F
private val FOCUS_CHANGE = 0x9F
private val ROTATE_CHANGE = 0x11F
@@ -128,25 +116,23 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
private val LOAD_COMPLETE = 0x17F
private val RENDER_CHANGE = 0x19F
private val INIT_COMPLETE = 0x21F
private val LISTENER_TYPE_SCREEN = 0x5F
private val DELAY_TIME: Long = 500
private val VELOCITY_MEASURE: Float = 3000f
private val SCALE_SMALL_DISTANCE: Float = 0.5f
private var mOnMarkerDragListener: OnMarkerDragListener? = null
var mITraffic: ITraffic? = null
var mLockCarJob: Job? = null
var mAnimJob: Job? = null
var mMarkerJob: Job? = null
var mLongPressJob: Job? = null
var mLockCar: Job? = null
private var mLockCarJob: Job? = null
private var mAnimJob: Job? = null
private var mMarkerJob: Job? = null
private var mLongPressJob: Job? = null
private var mLockCar: Job? = null
//是否第一次加载完成
private var isFirst = true
//是否已回收
private var isDestory = false
private var isDestroy = false
private var lastClickMarker: Marker? = null
private var dragMarker: Marker? = null
private var mDragMarker: Marker? = null
private var renderDataCall: IRenderData? = null
private var enableSync = false
@@ -155,9 +141,9 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
private var isAutoLockCar = true
// 协程
lateinit var mScope: CoroutineScope
private val mScope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
// 耗时专用协程
lateinit var mDemaningScope: CoroutineScope
private val mDemaningScope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
private val mHandler: Handler = object : Handler(Looper.getMainLooper()) {
@@ -183,10 +169,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
if (DEBUG) {
Log.i(TAG, "mapop--load complete-start")
}
// setAnchorScale(1.01f,2.5f)
mEventController?.dispatchMapLoadedListener()
// CommonController.instance.naviAutoView?.mNaviViewListener?.onNaviViewLoaded()
}
INIT_COMPLETE -> {
@@ -195,8 +178,6 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
}
mEventController?.dispatchMapLoadedInitListener()
}
else -> {
}
}
}
}
@@ -243,7 +224,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
}
isFirst = true
loaded = false
isDestory = true
isDestroy = true
mHandler.removeCallbacksAndMessages(null)
mMapController = null
mITraffic = null
@@ -285,30 +266,17 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
}
override fun onPause() {
super.onPause()
}
override fun onResume() {
super.onResume()
}
open fun loadOverCallbak() {
// if (DEBUG) {
// Log.i(TAG, "mapop---renderop-loadOverCallbak- isFirst:${isFirst}")
// }
fun loadOverCallbak() {
if (isFirst) {
loaded = true
isFirst = false
// setAnchorScale(1.01f,2.5f)
mHandler.sendEmptyMessage(LOAD_COMPLETE)
}
}
//渲染完成回调
open fun renderOverCallbak() {
fun renderOverCallbak() {
if (DEBUG) {
Log.i(TAG, "mapop---renderop-renderOverCallbak: ")
}
@@ -320,7 +288,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
this.renderDataCall = renderDataCall
}
open fun clipedRouteLineCbk(
fun clipedRouteLineCbk(
tileId: Int, leftTopLon: Double, leftTopLat: Double, leftBottomLon: Double, leftBottomLat: Double,
rightTopLon: Double, rightTopLat: Double, rightBottomLon: Double, rightBottomLat: Double, clipedRouteInfo: String?
) {
@@ -331,9 +299,11 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
mEventController?.dispatchRoadLoadedListener(clipedRouteInfo)
}
//type==2 代表的缩放结束
//type==1 代表平移结束
//type== 0 代表所有动画结束
/**
* 锚点动画事件回调
* @param markerId
* @param type 0 代表所有动画结束 1 代表平移结束 2 代表的缩放结束
*/
fun AnimateFinishCallback(markerId: String, type: Int) {
if (DEBUG) {
Log.d("AnimateFinishCallback", "markerop-AnimateFinishCallback:${markerId},type =${type}")
@@ -341,12 +311,17 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
val animationListener = mMarkerCall?.getAnimationListener(markerId)
animationListener?.let {
mAnimJob?.cancel()
mAnimJob = mScope.launch(Dispatchers.IO){
mAnimJob = mDemaningScope.launch(){
it.onAnimationFinish(markerId, type)
}
}
}
/**
* 锚点批量更新数据回调,锚点所有属性
*
* @param dataStr
*/
private fun markerBatchCallback(dataStr: String) {
mMarkerCall?.updateMarkerResource(dataStr)
if(DEBUG) {
@@ -365,15 +340,17 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
return JSON.parseObject(json, MarkerInfo::class.java)
}
var isTouchingFlag = false
private var isTouchingFlag = false
var lonlat: LonLat? = null
override fun onTouchEvent(ev: MotionEvent): Boolean {
if (ev.action == MotionEvent.ACTION_MOVE && dragMarker != null) {
dragMarker?.let {
Log.i(TAG, "markerop--dragMarker:ev.getX().toInt()${ev.getX().toInt()} ev.getY().toInt()${ev.getY().toInt()}")
if (ev.action == MotionEvent.ACTION_MOVE && mDragMarker != null) {
mDragMarker?.let {
if(DEBUG){
Log.i(TAG, "markerop--dragMarker:ev.getX().toInt()${ev.getX().toInt()} ev.getY().toInt()${ev.getY().toInt()}")
}
mMapEngine.setSomeDrawModelPointScreenPosition(ev.getX().toInt(), ev.getY().toInt())
mOnMarkerDragListener?.onMarkerDrag(dragMarker)
mOnMarkerDragListener?.onMarkerDrag(mDragMarker)
return true
}
@@ -390,12 +367,12 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
if (ev.action == MotionEvent.ACTION_UP || ev.action == MotionEvent.ACTION_CANCEL) {
mDealScale = true
isTouchingFlag = false
dragMarker?.let {
dragMarker?.getId()?.let {
mDragMarker?.let {
mDragMarker?.getId()?.let {
mMapEngine.setSomeAnchorDrawModel(it, false)
mOnMarkerDragListener?.onMarkerDragEnd(dragMarker)
mOnMarkerDragListener?.onMarkerDragEnd(mDragMarker)
}
dragMarker = null
mDragMarker = null
mOnMarkerDragListener = null
}
}
@@ -410,7 +387,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
mILockLocation.setLockCar(false)
if(isAutoLockCar) {
mLockCarJob?.cancel()
mLockCarJob = mDemaningScope.launch(Dispatchers.IO) {
mLockCarJob = mDemaningScope.launch {
if (DEBUG) {
Log.i(TAG, "lockop--onTouchEvent:mLockCarJob start: ${mMapStyleParams.getVrAngleMode()}")
}
@@ -438,22 +415,18 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
var angle = 0
// 两指切换3D效果
if (m_bLastMultiple && !m_bRotating) {
if (m_bLastMultiple && !m_bRotating && isFling) {
//跳到3d效果
val dy0 = m_iLastY0 - ev.getY(0)
val dy1 = m_iLastY1 - ev.getY(1)
if (abs(dy0) > 1 || abs(dy1) > 1) {
if (dy1 * dy0 > 1 && dy1 / dy0 < 3 && dy0 / dy1 < 3) {
if (isFling) {
m_bBending = true
val value = (dy0 + dy1) / 8f
if (DEBUG && mShowTouchInfo) {
Log.i(TAG, "touchop--lookUpDown:${value}")
}
tilt(value)
}
if ((abs(dy0) > 1 || abs(dy1) > 1)
&& (dy1 * dy0 > 1 && dy1 / dy0 < 3 && dy0 / dy1 < 3)){
m_bBending = true
val value = (dy0 + dy1) / 8f
if (DEBUG && mShowTouchInfo) {
Log.i(TAG, "touchop--lookUpDown:${value}")
}
tilt(value)
}
}
//旋转效果
@@ -507,12 +480,9 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
if (DEBUG && mShowTouchInfo) {
Log.i(TAG, "touchop--scaleop--lastDownTime:${lastDownTime},${ev.eventTime}")
}
// 增加两次事件执行间隔
// if (lastScaleByTime == 0L || ev.eventTime - lastDownTime > eventScaleInterval) {
if (DEBUG && mShowTouchInfo) {
Log.i(TAG, "touchop--scaleop--zoomFactor-scaleBy2:${zoomFactor},${mScaleCenterX},${mScaleCenterY}")
}
// lastScaleByTime = SystemClock.uptimeMillis()
if(isVr && (mMapStyleParams.getStyleMode() == MapAutoApi.MAP_STYLE_NIGHT_VR || mMapStyleParams.getStyleMode() == MapAutoApi.MAP_STYLE_DAY_VR)){
if(DEBUG) {
Log.d(TAG, "getZoomVal(): ${mMapEngine.getZoomValue()}, $zoomFactor")
@@ -520,8 +490,6 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
//zoomFactor 缩放比例 > 1 放大 < 1 缩小 getZoomVal() / zoomFactor 缩放到的值
if(mMapEngine.getZoomValue() / zoomFactor < 3.0) {
mMapEngine.scaleByCenter(mScaleCenterX, mScaleCenterY, zoomFactor)
}else{
}
}else {
mMapEngine.scaleByCenter(mScaleCenterX, mScaleCenterY, zoomFactor)
@@ -530,7 +498,6 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
Log.i(TAG, "touchop--scaleop:over")
}
requestRender()
// }
}
}
@@ -609,17 +576,8 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
}
}
var snapshotBitmap: Bitmap? = null
var isScreen:AtomicBoolean = AtomicBoolean()
private var doubles = doubleArrayOf()
open fun getDoubles(): DoubleArray {
return doubles
}
open override fun setDoubles(doubles: DoubleArray) {
this.doubles = doubles
}
private var snapshotBitmap: Bitmap? = null
private var isScreen:AtomicBoolean = AtomicBoolean()
private var time: Long = 0
@@ -627,7 +585,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
override fun onDrawFrame(gl: GL10) {
if (isDestory) {
if (isDestroy) {
return
}
time = System.currentTimeMillis()
@@ -638,7 +596,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
if (isRenderFirst) {
isRenderFirst = false
if(mMapStyleParams.getStyleMode() == MapAutoApi.MAP_STYLE_NIGHT_VR || mMapStyleParams.getStyleMode() == MapAutoApi.MAP_STYLE_DAY_VR) {
mMapController?.setMapViewVisualAngle(mMapStyleParams.getDefaultPerspective())
mMapController?.setMapViewVisualAngle(mMapStyleParams.getVrAngleDefaultMode())
}
mHandler.sendEmptyMessage(INIT_COMPLETE)
if(DEBUG){
@@ -648,7 +606,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
if(enableSync){
// 2ms是每次耗时补充
val sTime = renderTimePer-(System.currentTimeMillis()-time)-2
if(sTime > 0 && sTime < 100){
if(sTime in 1..99){
try {
Thread.sleep(sTime)
} catch (e:Exception) {
@@ -718,7 +676,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
override fun onAttachedToWindow() {
super.onAttachedToWindow()
isRenderFirst = true
isDestory = false
isDestroy = false
isFirst = true
if (DEBUG) {
Log.i(TAG, "mapop-surfaceop----onAttachedToWindow:")
@@ -766,11 +724,9 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
//默认锁车模式
mMapEngine.setLockSelfCar(true)
mMapController?.setMapStyle(styleMode)
val param = mMapStyleParams.getCarPosition()
// if(param>0f)
// {
mMapEngine.setScreenToOriginDis(param)
// }
mMapEngine.setScreenToOriginDis(mMapStyleParams.getCarPosition())
if (mMapStyleParams.getStyleMode() == MapAutoApi.MAP_STYLE_NIGHT_VR || mMapStyleParams.getStyleMode() == MapAutoApi.MAP_STYLE_DAY_VR) {
if (DEBUG) {
Log.i(TAG, "mapop-surfaceop----onSurfaceCreated,Vr")
@@ -790,7 +746,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
if(mMapStyleParams.getPerspectiveMode()>2){
mMapEngine.setSelfLocaionControl(mMapStyleParams.getPerspectiveMode())
}
if(mMapStyleParams.getIsSkyBoxEnable()) {
if(mMapStyleParams.isSkyBoxEnable()) {
mMapController?.setSkyBoxMode()
}
isFling = false
@@ -825,13 +781,13 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
}
if (isCanZoom) {
if(mMapStyleParams.isSwitchViewAngle() && (mMapStyleParams.getStyleMode() == MapAutoApi.MAP_STYLE_NIGHT_VR || mMapStyleParams.getStyleMode() == MapAutoApi.MAP_STYLE_DAY_VR)){
var type = mMapStyleParams.getDefaultPerspective()
var type = mMapStyleParams.getVrAngleDefaultMode()
when(mMapStyleParams.getVrAngleMode()){
mMapStyleParams.getDefaultPerspective()->{
mMapStyleParams.getVrAngleDefaultMode()->{
type = ConstantExt.MAP_STYLE_VR_ANGLE_FAR
}
ConstantExt.MAP_STYLE_VR_ANGLE_FAR->{
type = mMapStyleParams.getDefaultPerspective()
type = mMapStyleParams.getVrAngleDefaultMode()
}
}
setMapViewVisualAngle(type)
@@ -885,7 +841,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
val x = e.x.toInt()
val y = e.y.toInt()
mMarkerJob?.cancel()
mMarkerJob = mDemaningScope.launch(Dispatchers.IO) {
mMarkerJob = mDemaningScope.launch {
if (DEBUG) {
Log.i(TAG, "markerop--findAnchorAtScreenPoint:start")
}
@@ -897,6 +853,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
Log.i(TAG, "markerop--findAnchorAtScreenPoint:${resultInfo}")
}
if (TextUtils.isEmpty(resultInfo) || resultInfo == "unableBeTouch") {
return@launch
} else {
val markerInfo = jsonToObj(resultInfo)
@@ -921,7 +878,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
mILockLocation.setLockCar(false)
it.onMarkClick(marker)
mLockCarJob?.cancel()
mLockCarJob = mDemaningScope.launch(Dispatchers.IO) {
mLockCarJob = mDemaningScope.launch {
delay(waitTime)
mILockLocation.setLockCar(true)
}
@@ -935,7 +892,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
for (rect in it.keys) {
if (rect.contains(markerInfo.hitx, markerInfo.hity)) {
withContext(Dispatchers.Main) {
it.get(rect)?.click()
it[rect]?.click()
}
clickFlag = true
break
@@ -960,11 +917,11 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
inner class TouchGestureDetecter : GestureDetector.OnGestureListener {
override fun onLongPress(e: MotionEvent) {
if (dragMarker != null) {
if (mDragMarker != null) {
return
}
mLongPressJob?.cancel()
mLongPressJob = mScope.launch(Dispatchers.IO) {
mLongPressJob = mScope.launch {
if(!mSurfaceCreated.get()){
return@launch
}
@@ -973,20 +930,21 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
Log.i(TAG, "markerop--touch--findAnchorAtScreenPoint:${resultInfo}")
}
if (TextUtils.isEmpty(resultInfo) || resultInfo == "unableBeTouch") {
return@launch
} else {
val markerInfo = jsonToObj(resultInfo)
if (markerInfo != null) {
val isDraggable = mMapEngine.getAnchorProperty(markerInfo.id, "draggable").toBoolean()
if (isDraggable) {
dragMarker = Marker(MarkerOptions(markerInfo.id,null).lonLatPoint(LonLat(markerInfo.lon, markerInfo.lat)),mMapController,mMarkerCall)
mDragMarker = Marker(MarkerOptions(markerInfo.id,null).lonLatPoint(LonLat(markerInfo.lon, markerInfo.lat)),mMapController,mMarkerCall)
markerInfo.id?.let { infoId->
mOnMarkerDragListener = mMarkerCall?.getMarkDragListener(infoId)
mOnMarkerDragListener?.let {
withContext(Dispatchers.Main) {
dragMarker?.getId()?.let { id->
mDragMarker?.getId()?.let { id->
mMapEngine.setSomeAnchorDrawModel(id, true)
Log.i(TAG, "markerop--markerDragStart")
it.onMarkerDragStart(dragMarker)
it.onMarkerDragStart(mDragMarker)
}
}
@@ -1330,8 +1288,6 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
companion object {
private const val TAG = "MapView"
private const val SECOND = 1000
private const val FRAME_TIME = 16
private const val NOT_A_ANGLE = -2147483648
const val LISTENER_TYPE_SCROLL = 0x11111
@@ -1374,8 +1330,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
mGestureDetector = GestureDetector(context, TouchGestureDetecter())
mGestureDetector.setOnDoubleTapListener(DoubleClickDetecter())
m_iLastAngle = NOT_A_ANGLE
mScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
mDemaningScope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
}
}

View File

@@ -1,39 +0,0 @@
package com.autonavi.nge.routeinfo;
import android.os.Environment;
import android.util.Log;
import com.zhidaoauto.map.sdk.inner.CompileConfig;
public class RouteInfoProvider {
{
System.loadLibrary("map");
}
private static final String TAG = "RouteInfoProvider";
public RouteInfoProvider() {
if (CompileConfig.INSTANCE.getDEBUG()) {
Log.i(TAG, "roadop load database");
}
String shmdataDir = Environment.getExternalStorageDirectory().getAbsolutePath() + "/shmdata/";
RouteInfoProvider.init(shmdataDir);
}
private native static boolean init(String dir);
@Deprecated
public native String getRouteInfo(float centerLon, float centerLat,int type, int nFuncClass);
@Deprecated
public native float getRouteAngle(float startLon, float startLat,float endLon, float endLat);
@Deprecated
public native double [] matchPointOnRoad(double[] allPoint, boolean bGetAllPoints);
@Deprecated
public native String matchSinglePointOnRoad(float fLon, float fLat, float fAngle);
public native String matchHDSinglePointOnRoad(double fLon, double fLat, float fAngle, float fDistance, float fDetaAngle, boolean isZeroNo);
public native double getOffRoadDistance(double dLon, double dLat, double dAngle);
public native static void release();
}

View File

@@ -31,17 +31,10 @@ public class RoutingProvider {
public RoutingProvider() {
String dir = Constant.getNDSDataPath();
load(dir, "autonavi", null);
//setloglevel(1, 4);
}
{
// System.loadLibrary("datascript");
// System.loadLibrary("ndssqlite");
// System.loadLibrary("ndssystem");
// System.loadLibrary("ndsprovider");
// System.loadLibrary("datamgr");
System.loadLibrary("routing");
// System.loadLibrary("pbjni");
}
public void destroyProvider() { unload(); }