diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt index 55f6691d06..a15ace89e9 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt @@ -21,7 +21,7 @@ import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.OnRoad import com.mogo.eagle.core.utilcode.kotlin.* import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.zhidaoauto.map.data.road.StopLine -import com.zhidaoauto.map.sdk.open.tools.* +import com.zhidaoauto.map.sdk.open.common.tools.MapTools import kotlinx.coroutines.* import kotlinx.coroutines.android.* import java.util.* diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/RouteOverlayDrawer.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/RouteOverlayDrawer.java index e1c81539ae..a10959cc87 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/RouteOverlayDrawer.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/RouteOverlayDrawer.java @@ -18,7 +18,7 @@ import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils; import com.mogo.map.overlay.IMoGoOverlayManager; import com.mogo.map.overlay.core.Level; import com.mogo.map.overlay.line.Polyline; -import com.zhidaoauto.map.sdk.open.tools.MapTools; +import com.zhidaoauto.map.sdk.open.common.tools.MapTools; import java.util.ArrayList; import java.util.LinkedList; diff --git a/gradle.properties b/gradle.properties index 73cd23a03b..cc419b56ac 100644 --- a/gradle.properties +++ b/gradle.properties @@ -81,7 +81,7 @@ MOGO_LOCATION_VERSION=1.4.7.23 MOGO_TELEMATIC_VERSION=1.4.7.23 ######## MogoAiCloudSDK Version ######## # 自研地图 -MAP_SDK_VERSION=3.3.3.14 +MAP_SDK_VERSION=3.4.0.1 MAP_SDK_DATA_VERSION=1.0.0.7 MAP_SDK_OPERATION_VERSION=1.1.4.1 # websocket diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1b511f962f..55e1a2591e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Sep 22 11:53:55 CST 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/libraries/mapmodule/src/main/aidl/com/autonavi/nge/dm/INavigationCore.aidl b/libraries/mapmodule/src/main/aidl/com/autonavi/nge/dm/INavigationCore.aidl new file mode 100644 index 0000000000..bea7074392 --- /dev/null +++ b/libraries/mapmodule/src/main/aidl/com/autonavi/nge/dm/INavigationCore.aidl @@ -0,0 +1,85 @@ +//package com.autonavi.nge.dm; +// +//import android.os.IBinder; +//import com.autonavi.nge.guidance.RouteBook; +//import com.autonavi.nge.guidance.NaviInfo; +//import com.autonavi.nge.guidance.RouteImage; +//import com.autonavi.nge.guidance.LaneMask; +//import com.autonavi.nge.obj.Category; +//import com.autonavi.nge.obj.UpdateRegion; +//import com.autonavi.nge.trafficInfo.TMCID; +//import com.autonavi.nge.search.SPPoiItem; +//import com.autonavi.nge.search.SPCategories; +//import com.autonavi.nge.search.SPQuery; +//import com.autonavi.nge.search.SPSearchResult; +//import com.autonavi.nge.map.LonLat; +//import com.autonavi.nge.guidance.GuidanceStatListener; +//interface INavigationCore { +//// IBinder getHandler(); +// void Routing_SetOrigin(float lon, float lat, int sessionid); +// void Routing_SetDest(float lon, float lat, int sessionid); +// void Routing_GetRoute(int sessionid); +// boolean Routing_GetStatus(int sessionid); +// void Routing_Reset(int sessionid); +// void Routing_ClearTour(int sessionid); +// void RoutingSetCostModel(int model, int sessionid); +// void RoutingSetAvoidHighway(boolean isAvoidHighway, int sessionid); +// void RoutingSetAvoidToll(boolean isAvoidToll, int sessionid); +// +// void Traffic_Update(in List ids, int evt); +// void Traffic_UpdateByTile(int tile, in int[] ids, in byte[] speeds); +// void RoutingSetUseTraffic(boolean useTraffic, int sessionid); +// int RoutingGetRouteNum(int sessionid); +// int RoutingGetLength(int route, int sessionid); +// int RoutingGetSTime(int route, int sessionid); +// int RoutingGetDTime(int route, int sessionid); +// void addwaypoint(float lon, float lat, int heading, int sessionid); +// void clearwaypoints(int sessionid); +// +// void Guidance_UpdatePosition(float lon, float lat, float speed, float heading); +// void Guidance_StartNavi(int type); +// void Guidance_StopNavi(); +// void Guidance_SetSimSpeed(int speed); +// void Guidance_PauseSimNavi(); +// void Guidance_ResumeSimNavi(); +// RouteBook Guidance_RouteBook(int session,int start,int end); +// NaviInfo Guidance_NaviInfo(); +// NaviInfo GetNaviInfo(in byte[] datas); +// String Guidance_TTS(); +// RouteImage Guidance_Image(int imageUr,int imageBg,int imageArrow,int type); +// LaneMask Guidance_LaneMask(); +// double Guidance_getRoadAngle(); +// +// List Search_getSearchResult(int productId, double lon, double lat, double radius, int kindfilter, int updateregionId, String keyWord, int pageIdx, int searchType); +// SPPoiItem getPoiItemByPoiId(int poiId); +// List getPoiItemListByLonLat(int prodId, int urId, float lon, float lat, int pageCount, int pageIdx); +// List queryPoiItemByCircle(float centerLon,float centerLat,float radius); +// List queryPoiItemByRect(float topLeftLon,float topLeftLat,float bottomRightLon,float bottomRightLat); +// List queryPoiItemByPolygon(in List latLonPoints); +// List getFTSDataByDA( int urid, String keyStr, int keytype, int maxResultCount); +// List getInputResult(int productId, int updateregionId, String inputStr); +// List getInputResultByDA(); +// List getCatList(int urid); +// List getURListByDA(int prodid); +// void play(String text,boolean forcePlay); +// +// int RoutingGetSearchedCnt(int route, int sessionid); +// +// int [] getMemoryInfo(); +// +// void startServer(); +// +// void stopServer(); +// +// int getMDSVersion(); +// String getDataVersion(); +// String getCopyRight(); +// String getCompilerVersion(); +// +// void onGuidanceStatusChanged(int statCode, in byte[] datas); +// +// void setGuidanceStatListener(GuidanceStatListener listener); +// +// SPCategories getAllPoiCategories(int languageCode); +// List getPoiItemList(in SPQuery query); +//} diff --git a/libraries/mapmodule/src/main/assets/shaders/fMogo_Shader.glsl b/libraries/mapmodule/src/main/assets/shaders/fMogo_Shader.glsl index de74e89e78..d77eac3d54 100644 --- a/libraries/mapmodule/src/main/assets/shaders/fMogo_Shader.glsl +++ b/libraries/mapmodule/src/main/assets/shaders/fMogo_Shader.glsl @@ -12,6 +12,9 @@ uniform bool isPcf; //是否聚光灯 uniform bool isWave; //流光效果 uniform sampler2D texId; uniform sampler2DShadow depthTex; //深度纹理 +uniform sampler2D texId2; +uniform bool isMixTex2; +uniform float texId2Fac; uniform bool isRenderSignalLine; //信号线 uniform float signalLineTime; //信号线时间 uniform float signalLineCnt; //信号线时间 @@ -126,7 +129,12 @@ bool isInScreen(vec4 p){ //是否在包围盒[(0,0)-(1,1)]内 } void setZebra(){ - vec4 c = texture(texId, _uv); + vec4 c = vec4(0.0); + if(!isMixTex2){ + c = texture(texId,_uv); + }else{ + c = mix(texture(texId,_uv),texture(texId2,_uv),texId2Fac); + } fragColor = vec4(c.rgb, step(0.8,c.a)); } void setColor(){ @@ -137,7 +145,11 @@ void setTex(){ if(_uv.y<0.0 || _uv.y>1.0) discard; } - fragColor = texture(texId,_uv); + if(!isMixTex2){ + fragColor = texture(texId,_uv); + }else{ + fragColor = mix(texture(texId,_uv),texture(texId2,_uv),texId2Fac); + } } float getShadowOffset(float x, float y) { diff --git a/libraries/mapmodule/src/main/assets/shaders/fSelfCar_Shader.glsl b/libraries/mapmodule/src/main/assets/shaders/fSelfCar_Shader.glsl index cbe9e4b130..971d40f522 100644 --- a/libraries/mapmodule/src/main/assets/shaders/fSelfCar_Shader.glsl +++ b/libraries/mapmodule/src/main/assets/shaders/fSelfCar_Shader.glsl @@ -49,6 +49,10 @@ vec4 changeColorMethod(vec4 texColor){ } }else retColor = texColor; //s0 + }else if(_changeColorCmd==5.0){ + retColor = mix(texColor,replacedColor,_changeColorRatio); + }else if(_changeColorCmd==6.0){ + retColor = mix(texColor,replacedColor,1.0-_changeColorRatio); }else if(_changeColorRatio==0.0){ if(_changeColorCmd==1.0) retColor = mix(texColor,replacedColor,0.5); diff --git a/libraries/mapmodule/src/main/assets/shaders/vMogo_Shader.glsl b/libraries/mapmodule/src/main/assets/shaders/vMogo_Shader.glsl index 2da5a49892..20928bd7ea 100644 --- a/libraries/mapmodule/src/main/assets/shaders/vMogo_Shader.glsl +++ b/libraries/mapmodule/src/main/assets/shaders/vMogo_Shader.glsl @@ -169,4 +169,5 @@ void main() gl_Position = projMat*viewMat*modelMat * pos; ndc = gl_Position; + gl_PointSize = (1.0-gl_Position.z/gl_Position.w)*70.0; } \ No newline at end of file diff --git a/libraries/mapmodule/src/main/assets/style/hd_res/day_mode/ForbidLogo.png b/libraries/mapmodule/src/main/assets/style/hd_res/day_mode/ForbidLogo.png deleted file mode 100644 index 6893589c22..0000000000 Binary files a/libraries/mapmodule/src/main/assets/style/hd_res/day_mode/ForbidLogo.png and /dev/null differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/1.png b/libraries/mapmodule/src/main/assets/style/skybox/cloudy/1.png new file mode 100644 index 0000000000..ee46a900a9 Binary files /dev/null and b/libraries/mapmodule/src/main/assets/style/skybox/cloudy/1.png differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/2.png b/libraries/mapmodule/src/main/assets/style/skybox/cloudy/2.png new file mode 100644 index 0000000000..76ac9bb75c Binary files /dev/null and b/libraries/mapmodule/src/main/assets/style/skybox/cloudy/2.png differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/3.png b/libraries/mapmodule/src/main/assets/style/skybox/cloudy/3.png new file mode 100644 index 0000000000..fa20a8a330 Binary files /dev/null and b/libraries/mapmodule/src/main/assets/style/skybox/cloudy/3.png differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/4.png b/libraries/mapmodule/src/main/assets/style/skybox/cloudy/4.png new file mode 100644 index 0000000000..fc740264bc Binary files /dev/null and b/libraries/mapmodule/src/main/assets/style/skybox/cloudy/4.png differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/negx.png b/libraries/mapmodule/src/main/assets/style/skybox/cloudy/negx.png deleted file mode 100644 index a50cbce157..0000000000 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/negx.png and /dev/null differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/negy.png b/libraries/mapmodule/src/main/assets/style/skybox/cloudy/negy.png deleted file mode 100644 index a50cbce157..0000000000 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/negy.png and /dev/null differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/negz.png b/libraries/mapmodule/src/main/assets/style/skybox/cloudy/negz.png deleted file mode 100644 index e1fef07df2..0000000000 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/negz.png and /dev/null differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/posx.png b/libraries/mapmodule/src/main/assets/style/skybox/cloudy/posx.png deleted file mode 100644 index a50cbce157..0000000000 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/posx.png and /dev/null differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/posy.png b/libraries/mapmodule/src/main/assets/style/skybox/cloudy/posy.png deleted file mode 100644 index a50cbce157..0000000000 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/posy.png and /dev/null differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/posz.png b/libraries/mapmodule/src/main/assets/style/skybox/cloudy/posz.png deleted file mode 100644 index a50cbce157..0000000000 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/cloudy/posz.png and /dev/null differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/morning/1.png b/libraries/mapmodule/src/main/assets/style/skybox/morning/1.png index 651e214ee8..89539b0ef8 100644 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/morning/1.png and b/libraries/mapmodule/src/main/assets/style/skybox/morning/1.png differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/morning/2.png b/libraries/mapmodule/src/main/assets/style/skybox/morning/2.png index c5baa218f4..04ce0e9cd6 100644 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/morning/2.png and b/libraries/mapmodule/src/main/assets/style/skybox/morning/2.png differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/morning/3.png b/libraries/mapmodule/src/main/assets/style/skybox/morning/3.png index a765a4494f..cfd747f948 100644 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/morning/3.png and b/libraries/mapmodule/src/main/assets/style/skybox/morning/3.png differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/morning/4.png b/libraries/mapmodule/src/main/assets/style/skybox/morning/4.png index efb081433d..1c1c7dce22 100644 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/morning/4.png and b/libraries/mapmodule/src/main/assets/style/skybox/morning/4.png differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/negx.png b/libraries/mapmodule/src/main/assets/style/skybox/negx.png deleted file mode 100644 index c281a2e37b..0000000000 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/negx.png and /dev/null differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/negy.png b/libraries/mapmodule/src/main/assets/style/skybox/negy.png deleted file mode 100644 index 60d9d1bdf3..0000000000 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/negy.png and /dev/null differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/negz.png b/libraries/mapmodule/src/main/assets/style/skybox/negz.png deleted file mode 100644 index e1fef07df2..0000000000 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/negz.png and /dev/null differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/nighttime/1.png b/libraries/mapmodule/src/main/assets/style/skybox/nighttime/1.png new file mode 100644 index 0000000000..044730cf10 Binary files /dev/null and b/libraries/mapmodule/src/main/assets/style/skybox/nighttime/1.png differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/nighttime/2.png b/libraries/mapmodule/src/main/assets/style/skybox/nighttime/2.png new file mode 100644 index 0000000000..3b5ee4c76d Binary files /dev/null and b/libraries/mapmodule/src/main/assets/style/skybox/nighttime/2.png differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/nighttime/3.png b/libraries/mapmodule/src/main/assets/style/skybox/nighttime/3.png new file mode 100644 index 0000000000..053adbad2e Binary files /dev/null and b/libraries/mapmodule/src/main/assets/style/skybox/nighttime/3.png differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/nighttime/4.png b/libraries/mapmodule/src/main/assets/style/skybox/nighttime/4.png new file mode 100644 index 0000000000..6b6d376484 Binary files /dev/null and b/libraries/mapmodule/src/main/assets/style/skybox/nighttime/4.png differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/posx.png b/libraries/mapmodule/src/main/assets/style/skybox/posx.png deleted file mode 100644 index cfdbd058af..0000000000 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/posx.png and /dev/null differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/posy.png b/libraries/mapmodule/src/main/assets/style/skybox/posy.png deleted file mode 100644 index 359d065144..0000000000 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/posy.png and /dev/null differ diff --git a/libraries/mapmodule/src/main/assets/style/skybox/posz.png b/libraries/mapmodule/src/main/assets/style/skybox/posz.png deleted file mode 100644 index a50cbce157..0000000000 Binary files a/libraries/mapmodule/src/main/assets/style/skybox/posz.png and /dev/null differ diff --git a/libraries/mapmodule/src/main/assets/style/style/erhai/vr/day/common.cfg b/libraries/mapmodule/src/main/assets/style/style/erhai/vr/day/common.cfg deleted file mode 100644 index fcfdbc5047..0000000000 --- a/libraries/mapmodule/src/main/assets/style/style/erhai/vr/day/common.cfg +++ /dev/null @@ -1,29 +0,0 @@ -backGround=B0BED1 //背景色 -road=80,92,112 //路面颜色 -arrow.color.fac=0.95 //箭头颜色因子 -alphaNumeric.color.fac=1.0 //地标颜色因子 -zebra.color.fac=0.98 //斑马线颜色因子 -spotLight=2.5;0.5;1 //聚光灯 半径;亮度;偏移 -shadow=70,85,107,200 //阴影颜色 -greenBelt=6C8C86;9EBDB4 //绿化带 底部颜色;顶部颜色 -dividerLine=228,233,250;228,233,250;1.0 //白色;黄色;颜色因子 -pole=8999B0;4E617E //灯杆渐变颜色 -guardBar=9FB4C8;7C8EA5;B8C8E1 //隔离带颜色 -roadPile=1.0,0.84,0.23;0.18,0.18,0.18;0.25,0.25,0.25 //路桩颜色 -bridgePier=d2d6e4;979aa4 //桥墩颜色 -cable=5cd3ff;1e79d6;65f3ff;48b3bc //电缆颜色1;电缆颜色2;光缆颜色1;光缆颜色2 -area.type.2=D0E7DD //绿地颜色 -area.type.3=99C0E7 //水系颜色 -area.type.4=37485E //路面铺装颜色 -area.type.101=B0BED1 //区域块颜色 -regional=889DB5 //人行步道颜色 -building=7fA3B7D0;D0E3FB //建筑物底部颜色;顶部颜色 -camera=BCC3D0 //摄像头颜色 -trafficLight=BCC3D0 //交通灯颜色 -rsu.type.1=BCC3D0 //雷达颜色 -rsu.type.2=BCC3D0 //mec颜色 -rsu.type.3=BCC3D0 //rsu颜色 -//光照 环境光;漫反射;高光;高光的光泽度 -selfCar.light=0.8,0.8,0.8;0.2,0.2,0.2;0.8,0.8,0.8;12.0 //自车 -otherCar.light=0.7,0.7,0.7;0.1,0.1,0.1;0.3,0.3,0.3;11.0 //他车 -others.light=0.7,0.7,0.7;0.1,0.1,0.1;0.6,0.6,0.6;12.0 //除自车和他车外的其他3d锚点 \ No newline at end of file diff --git a/libraries/mapmodule/src/main/assets/style/style/erhai/vr/night/common.cfg b/libraries/mapmodule/src/main/assets/style/style/erhai/vr/night/common.cfg deleted file mode 100644 index 2a4a6f6361..0000000000 --- a/libraries/mapmodule/src/main/assets/style/style/erhai/vr/night/common.cfg +++ /dev/null @@ -1,29 +0,0 @@ -backGround=60,74,105 //背景色 -road=1E2637 //路面颜色 -arrow.color.fac=1.0 //箭头颜色因子 -alphaNumeric.color.fac=1.0 //地标颜色因子 -zebra.color.fac=1.0 //斑马线颜色因子 -spotLight=1;0.75;-25 //聚光灯 半径;亮度;偏移 -shadow=18,28,56,180 //阴影颜色 -greenBelt=35,50,75;60,74,105 //绿化带 底部颜色;顶部颜色 -dividerLine=102,115,140;230,180,90;1.0 //白色;黄色;颜色因子 -pole=6698B1;335780 //灯杆渐变颜色 -guardBar=344563;273651;506B9A //隔离带颜色 -roadPile=0.9,0.7,0.35;0.16,0.16,0.16;0.24,0.24,0.24 //路桩颜色 -bridgePier=384f76;1e2636 //桥墩颜色 -cable=5cd3ff;1e79d6;65f3ff;48b3bc //电缆颜色1;电缆颜色2;光缆颜色1;光缆颜色2 -area.type.2=D0E7DD //绿地颜色 -area.type.3=8BD0FD //水系颜色 -area.type.4=37485E //路面铺装颜色 -area.type.101=343F5B //区域块颜色 -regional=3C4A69 //人行步道颜色 -building=7fA1B7DD;E3ECFF //建筑物底部颜色;顶部颜色 -camera=0 //摄像头颜色 -trafficLight=0 //交通灯颜色 -rsu.type.1=0 //雷达颜色 -rsu.type.2=0 //mec颜色 -rsu.type.3=0 //rsu颜色 -//光照 环境光;漫反射;高光;高光的光泽度 -selfCar.light=0.6,0.6,0.6;0.1,0.1,0.1;0.6,0.6,0.6;12.0 //自车 -otherCar.light=0.4,0.4,0.4;0.1,0.1,0.1;0.6,0.6,0.6;12.0 //他车 -others.light=0.4,0.4,0.4;0.1,0.1,0.1;0.6,0.6,0.6;12.0 //除自车和他车外的其他3d锚点 \ No newline at end of file diff --git a/libraries/mapmodule/src/main/assets/style/style/normal/vr/night/common.cfg b/libraries/mapmodule/src/main/assets/style/style/normal/vr/night/common.cfg index c8a7d2ef28..6ce9448862 100644 --- a/libraries/mapmodule/src/main/assets/style/style/normal/vr/night/common.cfg +++ b/libraries/mapmodule/src/main/assets/style/style/normal/vr/night/common.cfg @@ -30,7 +30,7 @@ selfCar.light=0.6,0.6,0.6;0.1,0.1,0.1;0.6,0.6,0.6;12.0 //自车 otherCar.light=0.4,0.4,0.4;0.1,0.1,0.1;0.6,0.6,0.6;12.0 //他车 others.light=0.4,0.4,0.4;0.1,0.1,0.1;0.6,0.6,0.6;12.0 //除自车和他车外的其他3d锚点 fog=BFD9FD;35;70;0.8 //雾颜色,起始距离,结束距离,密度 -skybox.lookat=0;-13;8.5;0;0;3; 0;1;0 //天空盒lookat参数 +skybox.lookat=0;-13;8.5;0;0;3; 0;1;0 //天空盒lookat参数 skybox.proj=60;0.1;100 //天空盒fov,近平面,远平面 grayscale=#BCCCDAFF building.text.color=0.8,0.8,0.8,1.0 diff --git a/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_day/common.cfg b/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_day/common.cfg index 586c54c8bd..5fc6242cca 100644 --- a/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_day/common.cfg +++ b/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_day/common.cfg @@ -47,23 +47,27 @@ divider.15.right.tex.path=/hd_res/taxi_day_mode/divider15_right.png skybox.2d.tex.path=/skyDay.png road.isGradient=true road.gradientColor=66B5C8E6;00B5C8E6 -road.gradientColor_morning=00f2c3b1;66f2c3b1 +road.gradientColor_morning=66B5C8E6;00B5C8E6 road.gradientColor_daytime=66B5C8E6;00B5C8E6 road.gradientColor_evening=00f2c3b1;66f2c3b1 +road.gradientColor_nighttime=004CECFF;004CECFF greenbelt.isGradient=true greenbelt.gradientColor=66E5F0E8;00E5F0E8 -greenbelt.gradientColor_morning=00f2c3b1;66f2c3b1 +greenbelt.gradientColor_morning=66E5F0E8;00E5F0E8 greenbelt.gradientColor_daytime=66E5F0E8;00E5F0E8 greenbelt.gradientColor_evening=00f2c3b1;66f2c3b1 +greenbelt.gradientColor_nighttime=004CECFF;004CECFF plane.isGradient=true plane.gradientColor=66B5C8E6;00B5C8E6 -plane.gradientColor_morning=00f2c3b1;66f2c3b1 +plane.gradientColor_morning=66B5C8E6;00B5C8E6 plane.gradientColor_daytime=66B5C8E6;00B5C8E6 plane.gradientColor_evening=00f2c3b1;66f2c3b1 +plane.gradientColor_nighttime=004CECFF;004CECFF fog=C4E1FF;20;65;0.9 //雾颜色,起始距离,结束距离,密度 -fog_morning=D6CFDC;20;65;0.9 //雾颜色,起始距离,结束距离,密度 +fog_morning=F0F5F6;20;65;0.4 //雾颜色,起始距离,结束距离,密度 fog_daytime=C4E1FF;20;65;0.9 //雾颜色,起始距离,结束距离,密度 fog_evening=D6CFDC;20;65;0.9 //雾颜色,起始距离,结束距离,密度 +fog_nighttime=4CECFF;20;65;0.3 //雾颜色,起始距离,结束距离,密度 diff --git a/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_night/alpha.cfg b/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_night/alpha.cfg new file mode 100644 index 0000000000..ca942f4727 --- /dev/null +++ b/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_night/alpha.cfg @@ -0,0 +1,50 @@ +alpha.tex.path.11.出口.0=/hd_res/night_mode/exit.png +alpha.tex.path.11.前方学校.1=/hd_res/night_mode/schoolZone_white.png +alpha.tex.path.11.前方学校.2=/hd_res/night_mode/schoolZone_yellow.png +alpha.tex.path.11.公交专用.0=/hd_res/night_mode/WithBusVertical.png +alpha.tex.path.11.潮汐车道.0=/hd_res/night_mode/ReversibleLane.png +alpha.tex.path.11.公交车道.0=/hd_res/night_mode/busLaneVertical.png +alpha.tex.path.11.公交车.0=/hd_res/night_mode/bus.png +alpha.tex.path.11.快速公交专用线.1=/hd_res/night_mode/bus_Rapid_white.png +alpha.tex.path.11.快速公交专用线.2=/hd_res/night_mode/bus_Rapid_yellow.png +alpha.tex.path.11.借道区.1=/hd_res/night_mode/throughWordsV_white.png +alpha.tex.path.11.借道区.2=/hd_res/night_mode/throughWordsV_yellow.png +alpha.tex.path.11.公交停靠.0=/hd_res/night_mode/busStop.png +alpha.tex.path.11.警务专用.0=/hd_res/night_mode/policeSpecialV.png +alpha.tex.path.11.礼让行人.1=/hd_res/night_mode/comity_PedestrianShu.png +alpha.tex.path.11.礼让行人.2=/hd_res/night_mode/comityPedestrianCShu.png +alpha.tex.path.11.人行道.0=/hd_res/night_mode/sideRoad.png +alpha.tex.path.11.观光车专用道.0=/hd_res/night_mode/tourRoad.png +alpha.tex.path.12.BATTERY.0=/hd_res/night_mode/battery.png +alpha.tex.path.12.WALK.0=/hd_res/night_mode/walk.png +alpha.tex.path.12.车让人.0=/hd_res/night_mode/carpeople.png +alpha.tex.path.12.公交专用.0=/hd_res/night_mode/WithBusAcross.png +alpha.tex.path.12.公交车道.0=/hd_res/night_mode/busLaneAcross.png +alpha.tex.path.12.礼让行人.1=/hd_res/night_mode/comity_Pedestrian.png +alpha.tex.path.12.礼让行人.2=/hd_res/night_mode/comityPedestrianC.png +alpha.tex.path.12.停.0=/hd_res/night_mode/stop.png +alpha.tex.path.12.请勿越线.2=/hd_res/night_mode/noCrossLine.png +alpha.tex.path.22.7-22.0=/hd_res/night_mode/7-22.png +alpha.tex.path.22.7-9.1=/hd_res/night_mode/7-9_white.png +alpha.tex.path.22.7-9.2=/hd_res/night_mode/7-9_yellow.png +alpha.tex.path.22.17-19.1=/hd_res/night_mode/17-19_white.png +alpha.tex.path.22.17-19.2=/hd_res/night_mode/17-19_yellow.png +alpha.tex.path.22.16-19.1=/hd_res/night_mode/16-19_white.png +alpha.tex.path.22.16-19.2=/hd_res/night_mode/16-19_yellow.png +alpha.tex.path.22.17-20.1=/hd_res/night_mode/17-20_white.png +alpha.tex.path.22.17-20.2=/hd_res/night_mode/17-20_yellow.png +alpha.tex.path.22.6-20.0=/hd_res/night_mode/6-20_white.png +alpha.tex.path.22.6-22.0=/hd_res/night_mode/6-22_white.png +alpha.tex.path.22.7:30-9:30.1=/hd_res/night_mode/1730-1930-white.png +alpha.tex.path.22.7:30-9:30.2=/hd_res/night_mode/1730-1930-yellow.png +alpha.tex.path.22.7-10.0=/hd_res/night_mode/7-10-speed.png +alpha.tex.path.22.16:00-18:00.1=/hd_res/night_mode/16_18.png +alpha.tex.path.31.60-80.0=/hd_res/night_mode/60-80-speed.png +alpha.tex.path.31.80-100.0=/hd_res/night_mode/80-100-speed.png +alpha.tex.path.31.100-120.0=/hd_res/night_mode/100-120-speed.png +alpha.tex.path.31.60-100.0=/hd_res/night_mode/60-100-speed.png +alpha.tex.path.31.90-120.0=/hd_res/night_mode/90-120-speed.png +alpha.tex.path.32.80.0=/hd_res/night_mode/80-speed.png +alpha.tex.path.32.60.0=/hd_res/night_mode/60-speed.png +alpha.tex.path.32.40.1=/hd_res/night_mode/40-speed-white.png +alpha.tex.path.32.40.2=/hd_res/night_mode/40-speed-yellow.png \ No newline at end of file diff --git a/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_night/arrow.cfg b/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_night/arrow.cfg new file mode 100644 index 0000000000..66327274dc --- /dev/null +++ b/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_night/arrow.cfg @@ -0,0 +1,65 @@ +arrow.tex.path.201=/hd_res/night_mode/gostraight.png +arrow.tex.path.202=/hd_res/night_mode/gostraightleft.png +arrow.tex.path.203=/hd_res/night_mode/gostraightrightturn.png +arrow.tex.path.204=/hd_res/night_mode/gostraightleftround.png +arrow.tex.path.220=/hd_res/night_mode/gostraightrightround.png +arrow.tex.path.205=/hd_res/night_mode/leftturn.png +arrow.tex.path.206=/hd_res/night_mode/leftleftround.png +arrow.tex.path.207=/hd_res/night_mode/leftwaitturn.png +arrow.tex.path.208=/hd_res/night_mode/rightturn.png +arrow.tex.path.209=/hd_res/night_mode/rightwaitturn.png +arrow.tex.path.210=/hd_res/night_mode/leftrightturn.png +arrow.tex.path.211=/hd_res/night_mode/leftround.png +arrow.tex.path.212=/hd_res/night_mode/noleftturn.png +arrow.tex.path.215=/hd_res/night_mode/gostraightleftright.png +arrow.tex.path.402=/hd_res/night_mode/bicycle_cross_right.png +arrow.tex.path.412=/hd_res/night_mode/bicycle_vertical_right.png +arrow.tex.path.408=/hd_res/night_mode/bicycle_vertical_left.png +arrow.tex.path.410=/hd_res/night_mode/bicycle_cross_left.png +arrow.tex.path.411=/hd_res/night_mode/motorVehiclesC.png +arrow.tex.path.413=/hd_res/night_mode/bicycle_vertical_LL.png +arrow.tex.path.404=/hd_res/night_mode/bicycle_vertical_right_down.png +arrow.tex.path.508=/hd_res/night_mode/Rhombus.png +arrow.tex.path.509=/hd_res/night_mode/Triangle.png +arrow.tex.path.511.1=/hd_res/night_mode/SpeedBump1_white.png +arrow.tex.path.511.2=/hd_res/night_mode/SpeedBump1_yellow.png +arrow.tex.path.511.4=/hd_res/night_mode/SpeedBump1_red.png +arrow.tex.path.501.1=/hd_res/night_mode/SpeedBump2_white.png +arrow.tex.path.501.2=/hd_res/night_mode/SpeedBump2_yellow.png +arrow.tex.path.501.4=/hd_res/night_mode/SpeedBump2_red.png +arrow.tex.path.502.1=/hd_res/night_mode/SpeedBump3_white.png +arrow.tex.path.502.2=/hd_res/night_mode/SpeedBump3_yellow.png +arrow.tex.path.502.4=/hd_res/night_mode/SpeedBump3_red.png +arrow.tex.path.512.1=/hd_res/night_mode/SpeedBump4_white.png +arrow.tex.path.512.2=/hd_res/night_mode/SpeedBump4_yellow.png +arrow.tex.path.512.4=/hd_res/night_mode/SpeedBump4_red.png +arrow.tex.path.517.4=/hd_res/night_mode/SpeedBump5_red.png +arrow.tex.path.517.1=/hd_res/night_mode/SpeedBump5_white.png +arrow.tex.path.517.2=/hd_res/night_mode/SpeedBump5_yellow.png +arrow.tex.path.603=/hd_res/night_mode/BigSquareForbidArea.png +arrow.tex.path.604=/hd_res/night_mode/SmaSquareForbidArea.png +arrow.tex.path.605=/hd_res/night_mode/BigRectForbidArea.png +arrow.tex.path.606=/hd_res/night_mode/SmaRectForbidArea.png +arrow.tex.path.513.1=/hd_res/night_mode/UnSpeedBump1_white.png +arrow.tex.path.513.2=/hd_res/night_mode/UnSpeedBump1_yellow.png +arrow.tex.path.513.4=/hd_res/night_mode/UnSpeedBump1_red.png +arrow.tex.path.514.1=/hd_res/night_mode/UnSpeedBump2_white.png +arrow.tex.path.514.2=/hd_res/night_mode/UnSpeedBump2_yellow.png +arrow.tex.path.514.4=/hd_res/night_mode/UnSpeedBump2_red.png +arrow.tex.path.515.1=/hd_res/night_mode/UnSpeedBump3_white.png +arrow.tex.path.515.2=/hd_res/night_mode/UnSpeedBump3_yellow.png +arrow.tex.path.515.4=/hd_res/night_mode/UnSpeedBump3_red.png +arrow.tex.path.516.1=/hd_res/night_mode/UnSpeedBump4_white.png +arrow.tex.path.516.2=/hd_res/night_mode/UnSpeedBump4_yellow.png +arrow.tex.path.516.4=/hd_res/night_mode/UnSpeedBump4_red.png +arrow.tex.path.518.4=/hd_res/night_mode/UnSpeedBump5_red.png +arrow.tex.path.518.1=/hd_res/night_mode/UnSpeedBump5_white.png +arrow.tex.path.518.2=/hd_res/night_mode/UnSpeedBump5_yellow.png +arrow.tex.path.719=/hd_res/night_mode/busTransitLaneV.png +arrow.tex.path.721=/hd_res/night_mode/hov.png +arrow.tex.path.608=/hd_res/night_mode/noStopMarking.png +arrow.tex.path.219=/hd_res/night_mode/noLeftOrTurn.png +arrow.tex.path.722=/hd_res/night_mode/ParkingLotSign.png +arrow.tex.path.415=/hd_res/night_mode/415_1.png +arrow.tex.path.416=/hd_res/night_mode/416.png +arrow.tex.path.214=/hd_res/night_mode/noTurn.png \ No newline at end of file diff --git a/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_night/building.cfg b/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_night/building.cfg new file mode 100644 index 0000000000..c86405e0d6 --- /dev/null +++ b/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_night/building.cfg @@ -0,0 +1,18 @@ + +building.icon.path.type.6=/building/加油站.png;e6e6e6 //路径;颜色 +building.icon.path.type.30=/building/医院.png;e6e6e6 +building.icon.path.type.35=/building/警察局.png;e6e6e6 +building.icon.path.type.36=/building/邮局.png;e6e6e6 +building.icon.path.type.37=/building/市政府.png;e6e6e6 +building.icon.path.type.39=/building/法院.png;e6e6e6 +building.icon.path.type.40=/building/政府机构.png;e6e6e6 +building.icon.path.type.41=/building/社区活动中心.png;e6e6e6 +building.icon.path.type.42=/building/购物中心.png;e6e6e6 +building.icon.path.type.44=/building/银行.png;e6e6e6 +building.icon.path.type.66=/building/商业设施.png;e6e6e6 +building.icon.path.type.67=/building/展览馆.png;e6e6e6 +building.icon.path.type.68=/building/火车站.png;e6e6e6 +building.icon.path.type.69=/building/公交站.png;e6e6e6 +building.icon.path.type.71=/building/飞机场.png;e6e6e6 +building.icon.path.type.75=/building/紧急医疗服务.png;e6e6e6 +building.icon.path.type.99=/building/mogo.png;e6e6e6 \ No newline at end of file diff --git a/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_night/common.cfg b/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_night/common.cfg new file mode 100644 index 0000000000..dafd581ea9 --- /dev/null +++ b/libraries/mapmodule/src/main/assets/style/style/normal/vr/taxi_night/common.cfg @@ -0,0 +1,74 @@ +backGround=60,74,105 //背景色 +road=1E2637 //路面颜色 +arrow.color.fac=1.0 //箭头颜色因子 +alphaNumeric.color.fac=1.0 //地标颜色因子 +zebra.color.fac=1.0 //斑马线颜色因子 +spotLight=1;0.75;-25 //聚光灯 半径;亮度;偏移 +shadow=18,28,56,180 //阴影颜色 +greenBelt=35,50,75;60,74,105 //绿化带 底部颜色;顶部颜色 +dividerLine=102,115,140;230,180,90;1.0 //白色;黄色;颜色因子 +pole=6698B1;335780 //灯杆渐变颜色 +guardBar=344563;273651;506B9A //隔离带颜色 +roadPile=0.9,0.7,0.35;0.16,0.16,0.16;0.24,0.24,0.24 //路桩颜色 +bridgePier=384f76;1e2636 //桥墩颜色 +cable=5cd3ff;1e79d6;65f3ff;48b3bc //电缆颜色1;电缆颜色2;光缆颜色1;光缆颜色2 +area.type.2=456A63 //绿地颜色 +area.type.3.color.pure=426798 //水系颜色 +area.type.3.color.gradient=426700;426798 //水系渐变颜色 +area.type.3.ring.width=50 //水系环宽度 +area.type.4=37485E //路面铺装颜色 +area.type.101=3C4A69 //区域块颜色 +regional=323E58 //人行步道颜色 +building=23344E;4B5E89 //建筑物底部颜色;顶部颜色 +camera=0 //摄像头颜色 +trafficLight=0 //交通灯颜色 +rsu.type.1=0 //雷达颜色 +rsu.type.2=0 //mec颜色 +rsu.type.3=0 //rsu颜色 +//光照 环境光;漫反射;高光;高光的光泽度 +selfCar.light=0.6,0.6,0.6;0.1,0.1,0.1;0.6,0.6,0.6;12.0 //自车 +otherCar.light=0.4,0.4,0.4;0.1,0.1,0.1;0.6,0.6,0.6;12.0 //他车 +others.light=0.4,0.4,0.4;0.1,0.1,0.1;0.6,0.6,0.6;12.0 //除自车和他车外的其他3d锚点 +skybox.lookat=0;-13;8.5;0;0;3; 0;1;0 //天空盒lookat参数 +skybox.proj=60;0.1;100 //天空盒fov,近平面,远平面 +grayscale=#BCCCDAFF +building.text.color=0.8,0.8,0.8,1.0 +building.text.size=100 +station.text.color=0.0,0.0,1.0,1.0 +station.text.size=150 +cable.wave.color=1.0,1.0,1.0,0.6 +cable.wave.vel=1.0 +road.tex.path=/hd_res/night_mode/road.png +zebra.tex.path=/hd_res/night_mode/zebra.png +plane.tex.path=/hd_res/night_mode/plane.png +building.tex.path=/hd_res/night_mode/zhuan.png +divider.15.left.tex.path=/hd_res/night_mode/divider15_left.png +divider.15.right.tex.path=/hd_res/night_mode/divider15_right.png +skybox.2d.tex.path=/skyNight.png +road.isGradient=true +road.gradientColor=ffB5C8E6;00B5C8E6 +road.gradientColor_morning=00f2c3b1;fff2c3b1 +road.gradientColor_daytime=ffB5C8E6;00B5C8E6 +road.gradientColor_evening=00f2c3b1;fff2c3b1 +road.gradientColor_nighttime=004CECFF;004CECFF +greenbelt.isGradient=true +greenbelt.gradientColor=ffE5F0E8;00E5F0E8 +greenbelt.gradientColor_morning=00f2c3b1;fff2c3b1 +greenbelt.gradientColor_daytime=ffE5F0E8;00E5F0E8 +greenbelt.gradientColor_evening=00f2c3b1;fff2c3b1 +greenbelt.gradientColor_nighttime=004CECFF;004CECFF +plane.isGradient=true +plane.gradientColor=ffB5C8E6;00B5C8E6 +plane.gradientColor_morning=00f2c3b1;fff2c3b1 +plane.gradientColor_daytime=ffB5C8E6;00B5C8E6 +plane.gradientColor_evening=00f2c3b1;fff2c3b1 +plane.gradientColor_nighttime=004CECFF;004CECFF +fog=C4E1FF;20;65;0.9 //雾颜色,起始距离,结束距离,密度 +fog_morning=F0F5F6;20;65;0.4 //雾颜色,起始距离,结束距离,密度 +fog_daytime=C4E1FF;20;65;0.9 //雾颜色,起始距离,结束距离,密度 +fog_evening=D6CFDC;20;65;0.9 //雾颜色,起始距离,结束距离,密度 +fog_nighttime=4CECFF;20;65;0.3 //雾颜色,起始距离,结束距离,密度 + + + + diff --git a/libraries/mapmodule/src/main/java/com/autonavi/nge/guidance/LaneMarkTools.java b/libraries/mapmodule/src/main/java/com/autonavi/nge/guidance/LaneMarkTools.java index e7d8fee100..4145030de4 100644 --- a/libraries/mapmodule/src/main/java/com/autonavi/nge/guidance/LaneMarkTools.java +++ b/libraries/mapmodule/src/main/java/com/autonavi/nge/guidance/LaneMarkTools.java @@ -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; } - //直行 + 左转 + 右转 + //直行 + 左转 + 右转ֱ�� + ��ת + ��ת 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; diff --git a/libraries/mapmodule/src/main/java/com/autonavi/nge/map/MapEngine.kt b/libraries/mapmodule/src/main/java/com/autonavi/nge/map/MapEngine.kt index ad3946f1f3..94af47e74b 100644 --- a/libraries/mapmodule/src/main/java/com/autonavi/nge/map/MapEngine.kt +++ b/libraries/mapmodule/src/main/java/com/autonavi/nge/map/MapEngine.kt @@ -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, diff --git a/libraries/mapmodule/src/main/java/com/autonavi/nge/map/MapView.kt b/libraries/mapmodule/src/main/java/com/autonavi/nge/map/MapView.kt index 82c21aceec..6245dd8cee 100644 --- a/libraries/mapmodule/src/main/java/com/autonavi/nge/map/MapView.kt +++ b/libraries/mapmodule/src/main/java/com/autonavi/nge/map/MapView.kt @@ -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) } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IEventController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IEventController.kt index 1bb01e55f9..053c747d33 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IEventController.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IEventController.kt @@ -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 { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/ILocationView.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/ILocationView.kt index 3f0a3bc079..a4594a0aeb 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/ILocationView.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/ILocationView.kt @@ -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 { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IMapController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IMapController.kt index e4acdb6776..aad0c410a7 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IMapController.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IMapController.kt @@ -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) diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IMarkerCall.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IMarkerCall.kt index f628a08fa4..c72ee3452e 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IMarkerCall.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IMarkerCall.kt @@ -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 { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IMarkerController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IMarkerController.kt index 88669d5e71..f8a0bda092 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IMarkerController.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IMarkerController.kt @@ -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? //添加普通模型 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/INaviController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/INaviController.kt index df15e70359..4f5a0e7582 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/INaviController.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/INaviController.kt @@ -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 { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IWeatherController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IWeatherController.kt new file mode 100644 index 0000000000..1d7a75fa8d --- /dev/null +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/abs/IWeatherController.kt @@ -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) +} \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/byteh/PayloadEncoder.java b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/byteh/PayloadEncoder.java index dcb5928cc9..6f3f27d43e 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/byteh/PayloadEncoder.java +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/byteh/PayloadEncoder.java @@ -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": diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/city/CityCodeModel.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/city/CityCodeModel.kt similarity index 87% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/city/CityCodeModel.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/city/CityCodeModel.kt index b7a0858c54..7b1c47b7fb 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/city/CityCodeModel.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/city/CityCodeModel.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/city/CityCodeRepository.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/city/CityCodeRepository.kt similarity index 69% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/city/CityCodeRepository.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/city/CityCodeRepository.kt index 9b99d50da2..ad127e871a 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/city/CityCodeRepository.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/city/CityCodeRepository.kt @@ -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() { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/navi/NaviModel.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/navi/NaviModel.kt similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/navi/NaviModel.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/navi/NaviModel.kt index d704a64450..77d9fefd72 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/navi/NaviModel.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/navi/NaviModel.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/navi/NaviRepository.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/navi/NaviRepository.kt similarity index 81% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/navi/NaviRepository.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/navi/NaviRepository.kt index 610c987aca..3ce97df164 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/navi/NaviRepository.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/navi/NaviRepository.kt @@ -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() { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/CityCodeRetrofitClient.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/CityCodeRetrofitClient.kt similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/CityCodeRetrofitClient.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/CityCodeRetrofitClient.kt index 755e5bc667..07c983517a 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/CityCodeRetrofitClient.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/CityCodeRetrofitClient.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.net +package com.zhidaoauto.map.sdk.inner.cloud.net import android.util.Log diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/CityCodeService.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/CityCodeService.kt similarity index 79% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/CityCodeService.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/CityCodeService.kt index d025a1b92e..28df9336f0 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/CityCodeService.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/CityCodeService.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/LogRetrofitClient.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/LogRetrofitClient.kt similarity index 100% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/LogRetrofitClient.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/LogRetrofitClient.kt diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/LogService.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/LogService.kt similarity index 100% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/LogService.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/LogService.kt diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/NavRetrofitClient.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/NavRetrofitClient.kt similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/NavRetrofitClient.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/NavRetrofitClient.kt index ed861c7531..4919895825 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/NavRetrofitClient.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/NavRetrofitClient.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.net +package com.zhidaoauto.map.sdk.inner.cloud.net import android.util.Log diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/NavService.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/NavService.kt similarity index 79% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/NavService.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/NavService.kt index 91702fd19f..d69d32d7ef 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/NavService.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/NavService.kt @@ -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.* diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/WeatherRetrofitClient.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/WeatherRetrofitClient.kt similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/WeatherRetrofitClient.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/WeatherRetrofitClient.kt index f8a32c7425..8a810e9c0a 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/WeatherRetrofitClient.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/WeatherRetrofitClient.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.net +package com.zhidaoauto.map.sdk.inner.cloud.net import android.util.Log diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/WeatherService.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/WeatherService.kt similarity index 81% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/WeatherService.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/WeatherService.kt index fc8ef2ae5b..90d00660fb 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/net/WeatherService.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/net/WeatherService.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherModel.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/weather/WeatherModel.kt similarity index 85% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherModel.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/weather/WeatherModel.kt index eaaf18f973..140b356ab8 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherModel.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/weather/WeatherModel.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherRepository.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/weather/WeatherRepository.kt similarity index 72% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherRepository.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/weather/WeatherRepository.kt index b79cc3cd25..1dfccb9d13 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherRepository.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/cloud/weather/WeatherRepository.kt @@ -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() { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/common/ConstantExt.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/common/ConstantExt.kt index ff37048d58..407505446d 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/common/ConstantExt.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/common/ConstantExt.kt @@ -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" diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/common/NavHelper.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/common/NavHelper.kt index 588b1b6148..bef58e18da 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/common/NavHelper.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/common/NavHelper.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/controller/MapEventController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/controller/MapEventController.kt index ba6563c47b..d16ae1e7db 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/controller/MapEventController.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/controller/MapEventController.kt @@ -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 { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/db/DataStorageManager.java b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/db/DataStorageManager.java index 86662b149a..757cb49f9f 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/db/DataStorageManager.java +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/db/DataStorageManager.java @@ -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; diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/element/M3DCar.java b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/element/M3DCar.java index 6fb688aea9..6b2afa8ef1 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/element/M3DCar.java +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/element/M3DCar.java @@ -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(); } } } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/location/LocationHelper.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/location/LocationHelper.kt index 0792686626..76afc09333 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/location/LocationHelper.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/location/LocationHelper.kt @@ -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( diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/MapCameraMessageImpl.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/MapCameraMessageImpl.kt index e48d30fc76..5d4e57bd74 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/MapCameraMessageImpl.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/MapCameraMessageImpl.kt @@ -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() diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/MapController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/MapController.kt index 61ef97b489..0bf73020e9 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/MapController.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/MapController.kt @@ -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) } - } \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/WeatherController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/WeatherController.kt new file mode 100644 index 0000000000..4639b3abce --- /dev/null +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/WeatherController.kt @@ -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!") + } + } + } + } + +} diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/marker/MarkerNativeInterface.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/marker/MarkerNativeInterface.kt index bb3c70f27c..f122c9a33e 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/marker/MarkerNativeInterface.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/marker/MarkerNativeInterface.kt @@ -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,angle:Float, isGps:Boolean,current:Long,duration: Int) { + fun addDynamicAnchorPostion(id: String, points: List,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() diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/nav/NaviController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/nav/NaviController.kt index 98fdea2cfb..36b12082ba 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/nav/NaviController.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/nav/NaviController.kt @@ -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}") // } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/obj/NavMsg.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/obj/NavMsg.kt index 34e2df476e..866df5cf63 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/obj/NavMsg.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/obj/NavMsg.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/DirectionLayer.java b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/DirectionLayer.java index ce15abe9ca..b8a0336757 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/DirectionLayer.java +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/DirectionLayer.java @@ -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(); diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/PanelRouteSet.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/PanelRouteSet.kt index f6386e2e2a..46d911133e 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/PanelRouteSet.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/PanelRouteSet.kt @@ -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 { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/PanelSelectRoute.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/PanelSelectRoute.kt index f1ca39af4f..2483bfa698 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/PanelSelectRoute.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/PanelSelectRoute.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/PanelTrafficSign.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/PanelTrafficSign.kt index 8eb17b2d44..d65c0f9019 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/PanelTrafficSign.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/PanelTrafficSign.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/SatelliteSkyView.java b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/SatelliteSkyView.java index 22732e9d7d..5ca03e064a 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/SatelliteSkyView.java +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/panel/SatelliteSkyView.java @@ -30,835 +30,850 @@ import java.util.Iterator; public class SatelliteSkyView extends View { - private int text1_x = 66; - private int text2_x = 165; - private int text3_x = 340; - private int text4_x = 46; - private int text5_x = 210; - private int text6_x = 377; - private int text1_y = 57; - private int text2_y = 57; - private int text3_y = 57; - private int text4_y = 133; - private int text5_y = 133; - private int text6_y = 133; - private int radius = 130;// 星球半径 - private int centerX = 240;// 星球中心点x值 - private int centerY = 425;// 星球中心点y值 - private int ballR = 35; // 小球半径 - private int redR = 175; - private int settingX = 460; - private int settingY = 670; + private int text1_x = 66; + private int text2_x = 165; + private int text3_x = 340; + private int text4_x = 46; + private int text5_x = 210; + private int text6_x = 377; + private int text1_y = 57; + private int text2_y = 57; + private int text3_y = 57; + private int text4_y = 133; + private int text5_y = 133; + private int text6_y = 133; + private int radius = 130;// 星球半径 + private int centerX = 240;// 星球中心点x值 + private int centerY = 425;// 星球中心点y值 + private int ballR = 35; // 小球半径 + private int redR = 175; + private int settingX=460; + private int settingY=670; - private final Paint mGridPaint; - private final Paint mTextPaint; + private Paint mGridPaint; + private Paint mTextPaint; + private Paint mBackground; - private Bitmap mbg; - private final Bitmap[] number = new Bitmap[10]; - private final Bitmap[] lNumber = new Bitmap[10]; - private Bitmap water; - private Bitmap arrow; - private Bitmap sector; - private Bitmap dot; - private Bitmap greenDot; - private Bitmap grayDot; - private Bitmap yellowDot; + private Bitmap mbg; + private Bitmap[] number = new Bitmap[10]; + private Bitmap[] lNumber = new Bitmap[10]; + private Bitmap water; + private Bitmap arrow; + private Bitmap sector; + private Bitmap dot; + private Bitmap greenDot; + private Bitmap grayDot; + private Bitmap yellowDot; + + private int signalBottom; + private int signalTop; + private int[] signalX = new int[12]; + private int signalWidth; + private float degree = 0; + private float acc = 0; + private float dirX = 0; + private float dirY = 0; + private float m_sensorDir = 0; + private float[] lastA = new float[3]; + private float[] initA = new float[3]; + private boolean start = false; + private int count = 0; + private int m_nScreenWidth = 0; + private int m_nScreenHeight = 0; + int nDispH = this.getHeight(); - private int signalBottom; - private int signalTop; - private final int[] signalX = new int[12]; - private int signalWidth; - private float degree = 0; - private float acc = 0; - private float dirX = 0; - private float dirY = 0; - private float m_sensorDir = 0; - private final float[] lastA = new float[3]; - private final float[] initA = new float[3]; - private boolean start = false; - private int count = 0; - private int m_nScreenWidth = 0; - private int m_nScreenHeight = 0; - int nDispH = this.getHeight(); + private float x; //水珠坐标 + private float y; + private float nx;//水珠重力坐标 + private float ny; + private float sx = -80; //雷达坐标 + private float sy = -165; + private double dx;//三角变换 + private double dy; + private int delayCount = 0; + private float m_AccX; + private float m_AccY; + private int lastDir = 0; + private float v = 2; + private GradientDrawable mDrawable; + private Paint blackPaint; - private float x; //水珠坐标 - private float y; - private float nx;//水珠重力坐标 - private float ny; - private float sx = -80; //雷达坐标 - private float sy = -165; - private double dx;//三角变换 - private double dy; - private int delayCount = 0; - private float m_AccX; - private float m_AccY; - private int lastDir = 0; - private final float v = 2; - private final GradientDrawable mDrawable; - private final Paint blackPaint; + private float mBitmapAdjustment; - private final float mBitmapAdjustment; + public final static int MAX_SATS = 12; - public final static int MAX_SATS = 12; + private int mSatellites; + private int[] mPrns = null; + private float[] mElevation = null; + private float[] mAzimuth = null; + private float[] mSnrs = null; + private float[] mX = null; + private float[] mY = null; + private int mUsedInFixMask = 0; + private double lon = 0; + private double lat = 0; - private int mSatellites; - private int[] mPrns = null; - private float[] mElevation = null; - private float[] mAzimuth = null; - private float[] mSnrs = null; - private float[] mX = null; - private float[] mY = null; - private int mUsedInFixMask = 0; - private double lon = 0; - private double lat = 0; + // 画信号强度 + private Paint mLinePaint; + private Paint mBarPaintUsed; + private Paint mBarPaintUnused; + private Paint mBarPaintNoFix; + private Paint mBarOutlinePaint; - // 画信号强度 - private final Paint mLinePaint; - private final Paint mBarPaintUsed; - private final Paint mBarPaintUnused; - private final Paint mBarPaintNoFix; - private final Paint mBarOutlinePaint; + private double mAlt = 0; + private long mTime = -1; + private int mSpeed = 0; + // 横竖屏模式 + private boolean m_bW = false; + private int m_nDensity = 240; + private boolean flagDir = false; + private boolean flagBall = false; + private SensorManager sensorManager; + + private float fltScale = 0f; + + private Bitmap bitmap; + + private Bitmap setting; + + private GpsStatus gsv = null;; + + public void setExtraInfo(double a, long t, int s) { + this.mAlt = a; + this.mTime = t; + this.mSpeed = s; + } - private double mAlt = 0; - private long mTime = -1; - private int mSpeed = 0; - // 横竖屏模式 - private boolean m_bW = false; - private int m_nDensity = 240; - private boolean flagDir = false; - private boolean flagBall = false; - private final SensorManager sensorManager; + private void computeXY() { + for (int i = 0; i < mSatellites; ++i) { + double theta = -(mAzimuth[i] - 90); + double rad = theta * Math.PI / 180.0; + mX[i] = (float) Math.cos(rad); + mY[i] = -(float) Math.sin(rad); + mElevation[i] = 90 - mElevation[i]; + } + } - private float fltScale = 0f; + private float[] gacc = new float[3]; + private float[] dir = new float[3]; + private float[] lacc = new float[3]; + private long curTime = 0; - private Bitmap bitmap; + private final SensorEventListener sensorEventListener = new SensorEventListener() { + @Override + public void onSensorChanged(SensorEvent event) { + if (event.sensor.getType() == Sensor.TYPE_LINEAR_ACCELERATION) { + lacc[0] = event.values[0]; + lacc[1] = event.values[1]; + lacc[2] = event.values[2]; + }else if(event.sensor.getType() == Sensor.TYPE_ORIENTATION){ + dir[0] = event.values[0]; + dir[1] = event.values[1]; + dir[2] = event.values[2]; + }else if(event.sensor.getType() == Sensor.TYPE_ACCELEROMETER){ + gacc[0] = event.values[0]; + gacc[1] = event.values[1]; + gacc[2] = event.values[2]; + } + if(curTime == 0) { + curTime = System.currentTimeMillis(); + } else if(System.currentTimeMillis() - curTime > 50){ + curTime = System.currentTimeMillis(); + update(gacc, dir, lacc); + invalidate(); + } + } - private Bitmap setting; + @Override + public void onAccuracyChanged(Sensor arg0, int arg1) { - private final GpsStatus gsv = null; - - public void setExtraInfo(double a, long t, int s) { - this.mAlt = a; - this.mTime = t; - this.mSpeed = s; - } - - private void computeXY() { - for (int i = 0; i < mSatellites; ++i) { - double theta = -(mAzimuth[i] - 90); - double rad = theta * Math.PI / 180.0; - mX[i] = (float) Math.cos(rad); - mY[i] = -(float) Math.sin(rad); - mElevation[i] = 90 - mElevation[i]; - } - } - - private final float[] gacc = new float[3]; - private final float[] dir = new float[3]; - private final float[] lacc = new float[3]; - private long curTime = 0; - - private final SensorEventListener sensorEventListener = new SensorEventListener() { - @Override - public void onSensorChanged(SensorEvent event) { - if (event.sensor.getType() == Sensor.TYPE_LINEAR_ACCELERATION) { - lacc[0] = event.values[0]; - lacc[1] = event.values[1]; - lacc[2] = event.values[2]; - } else if (event.sensor.getType() == Sensor.TYPE_ORIENTATION) { - dir[0] = event.values[0]; - dir[1] = event.values[1]; - dir[2] = event.values[2]; - } else if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) { - gacc[0] = event.values[0]; - gacc[1] = event.values[1]; - gacc[2] = event.values[2]; - } - if (curTime == 0) { - curTime = System.currentTimeMillis(); - } else if (System.currentTimeMillis() - curTime > 50) { - curTime = System.currentTimeMillis(); - update(gacc, dir, lacc); - invalidate(); - } - } - - @Override - public void onAccuracyChanged(Sensor arg0, int arg1) { - - - } - }; - private Context mContext; - - public void Resume() { - sensorManager.registerListener( - sensorEventListener, - sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION), - SensorManager.SENSOR_DELAY_FASTEST - ); - sensorManager.registerListener( - sensorEventListener, - sensorManager.getDefaultSensor(Sensor.TYPE_LINEAR_ACCELERATION), - SensorManager.SENSOR_DELAY_FASTEST - ); - sensorManager.registerListener( - sensorEventListener, - sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), - SensorManager.SENSOR_DELAY_FASTEST - ); - } - - public void Destroy() { - sensorManager.unregisterListener(sensorEventListener); - } - - public SatelliteSkyView(Context context) { - super(context); - mContext = context; - sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE); - curTime = 0; - int nbgID = R.mipmap.navi_gpssv; - { - // 竖屏 + + } + }; + private Context mContext; + + public void Resume() { + sensorManager.registerListener( + sensorEventListener, + sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION), + SensorManager.SENSOR_DELAY_FASTEST + ); + sensorManager.registerListener( + sensorEventListener, + sensorManager.getDefaultSensor(Sensor.TYPE_LINEAR_ACCELERATION), + SensorManager.SENSOR_DELAY_FASTEST + ); + sensorManager.registerListener( + sensorEventListener, + sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), + SensorManager.SENSOR_DELAY_FASTEST + ); + } + + public void Destroy() { + sensorManager.unregisterListener(sensorEventListener); + } + + public SatelliteSkyView(Context context) { + super(context); + mContext = context; + sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE); + curTime = 0; + int nbgID = R.mipmap.navi_gpssv; + { + // 竖屏 x = centerX; y = centerY; - - //信号显示位置设置 - signalTop = 719; - signalBottom = 782; - signalWidth = 13; - signalX[0] = 31; - for (int i = 1; i < 12; i++) { - signalX[i] = signalX[i - 1] + 37; - if (i >= 3 && i <= 6) { - signalX[i]++; - } + + //信号显示位置设置 + signalTop = 719; + signalBottom = 782; + signalWidth = 13; + signalX[0] =31; + for(int i=1 ; i<12; i++){ + signalX[i] = signalX[i-1]+37; + if(i>=3 && i<=6){ + signalX[i]++; } - } - mDrawable = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, - new int[]{0xff7bd497, 0x557bd497});//13d346 - blackPaint = new Paint(); - blackPaint.setStrokeWidth(13); - blackPaint.setAlpha(255); - blackPaint.setARGB(255, 7, 7, 7); + } + } + mDrawable = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, + new int[] { 0xff7bd497, 0x557bd497 });//13d346 + blackPaint = new Paint(); + blackPaint.setStrokeWidth(13); + blackPaint.setAlpha(255); + blackPaint.setARGB(255, 7, 7, 7); - try { - mbg = decodeResource(this.getResources(), nbgID); - setting = decodeResource(this.getResources(), R.mipmap.navi_gps_set); - number[0] = decodeResource(this.getResources(), R.mipmap.n0); - number[1] = decodeResource(this.getResources(), R.mipmap.n1); - number[2] = decodeResource(this.getResources(), R.mipmap.n2); - number[3] = decodeResource(this.getResources(), R.mipmap.n3); - number[4] = decodeResource(this.getResources(), R.mipmap.n4); - number[5] = decodeResource(this.getResources(), R.mipmap.n5); - number[6] = decodeResource(this.getResources(), R.mipmap.n6); - number[7] = decodeResource(this.getResources(), R.mipmap.n7); - number[8] = decodeResource(this.getResources(), R.mipmap.n8); - number[9] = decodeResource(this.getResources(), R.mipmap.n9); + try { + mbg = decodeResource(this.getResources(), nbgID); + setting = decodeResource(this.getResources(), R.mipmap.navi_gps_set); + number[0] = decodeResource(this.getResources(), R.mipmap.n0); + number[1] = decodeResource(this.getResources(), R.mipmap.n1); + number[2] = decodeResource(this.getResources(), R.mipmap.n2); + number[3] = decodeResource(this.getResources(), R.mipmap.n3); + number[4] = decodeResource(this.getResources(), R.mipmap.n4); + number[5] = decodeResource(this.getResources(), R.mipmap.n5); + number[6] = decodeResource(this.getResources(), R.mipmap.n6); + number[7] = decodeResource(this.getResources(), R.mipmap.n7); + number[8] = decodeResource(this.getResources(), R.mipmap.n8); + number[9] = decodeResource(this.getResources(), R.mipmap.n9); + + lNumber[0] = decodeResource(this.getResources(), R.mipmap.l0); + lNumber[1] = decodeResource(this.getResources(), R.mipmap.l1); + lNumber[2] = decodeResource(this.getResources(), R.mipmap.l2); + lNumber[3] = decodeResource(this.getResources(), R.mipmap.l3); + lNumber[4] = decodeResource(this.getResources(), R.mipmap.l4); + lNumber[5] = decodeResource(this.getResources(), R.mipmap.l5); + lNumber[6] = decodeResource(this.getResources(), R.mipmap.l6); + lNumber[7] = decodeResource(this.getResources(), R.mipmap.l7); + lNumber[8] = decodeResource(this.getResources(), R.mipmap.l8); + lNumber[9] = decodeResource(this.getResources(), R.mipmap.l9); + + water = decodeResource(this.getResources(), R.mipmap.water); + arrow = decodeResource(this.getResources(), R.mipmap.arrow); + sector = decodeResource(this.getResources(), R.mipmap.sector); + dot = decodeResource(this.getResources(), R.mipmap.dot); + + greenDot = decodeResource(this.getResources(), R.mipmap.green_dot); + grayDot = decodeResource(this.getResources(), R.mipmap.gray_dot); + yellowDot = decodeResource(this.getResources(), R.mipmap.yellow_dot); + + float fltWScale = 1.0f * this.getWidth() / mbg.getWidth(); + float fltHScale = 1.0f * this.getHeight() / mbg.getHeight(); + + if(fltWScale > fltHScale){ + fltScale = fltHScale; + } + else{ + fltScale = fltWScale; + } + } catch (Exception ex) { + ex.printStackTrace(); + } - lNumber[0] = decodeResource(this.getResources(), R.mipmap.l0); - lNumber[1] = decodeResource(this.getResources(), R.mipmap.l1); - lNumber[2] = decodeResource(this.getResources(), R.mipmap.l2); - lNumber[3] = decodeResource(this.getResources(), R.mipmap.l3); - lNumber[4] = decodeResource(this.getResources(), R.mipmap.l4); - lNumber[5] = decodeResource(this.getResources(), R.mipmap.l5); - lNumber[6] = decodeResource(this.getResources(), R.mipmap.l6); - lNumber[7] = decodeResource(this.getResources(), R.mipmap.l7); - lNumber[8] = decodeResource(this.getResources(), R.mipmap.l8); - lNumber[9] = decodeResource(this.getResources(), R.mipmap.l9); + mGridPaint = new Paint(); + mGridPaint.setColor(0xFFDDDDDD); + mGridPaint.setAntiAlias(true); + mGridPaint.setStyle(Style.STROKE); + mGridPaint.setStrokeWidth(1.0f); - water = decodeResource(this.getResources(), R.mipmap.water); - arrow = decodeResource(this.getResources(), R.mipmap.arrow); - sector = decodeResource(this.getResources(), R.mipmap.sector); - dot = decodeResource(this.getResources(), R.mipmap.dot); + mBackground = new Paint(); + mBackground.setColor(0xFF4444DD); - greenDot = decodeResource(this.getResources(), R.mipmap.green_dot); - grayDot = decodeResource(this.getResources(), R.mipmap.gray_dot); - yellowDot = decodeResource(this.getResources(), R.mipmap.yellow_dot); + mTextPaint = new Paint(); + mTextPaint.setAntiAlias(true); + mTextPaint.setColor(0xFFFFFFFF); - float fltWScale = 1.0f * this.getWidth() / mbg.getWidth(); - float fltHScale = 1.0f * this.getHeight() / mbg.getHeight(); + mTextPaint.setTextSize(16); + mTextPaint.setTextAlign(Align.CENTER); - fltScale = Math.min(fltWScale, fltHScale); - } catch (Exception ex) { - ex.printStackTrace(); - } + mBitmapAdjustment = 10; - mGridPaint = new Paint(); - mGridPaint.setColor(0xFFDDDDDD); - mGridPaint.setAntiAlias(true); - mGridPaint.setStyle(Style.STROKE); - mGridPaint.setStrokeWidth(1.0f); + mLinePaint = new Paint(); + mLinePaint.setColor(0xFFDDDDDD); + mLinePaint.setAntiAlias(true); + mLinePaint.setStyle(Style.STROKE); + mLinePaint.setStrokeWidth(1.0f); - Paint mBackground = new Paint(); - mBackground.setColor(0xFF4444DD); + mBarPaintUsed = new Paint(); + mBarPaintUsed.setColor(0xFF00BB00); + mBarPaintUsed.setAntiAlias(true); + mBarPaintUsed.setStyle(Style.FILL); + mBarPaintUsed.setStrokeWidth(1.0f); - mTextPaint = new Paint(); - mTextPaint.setAntiAlias(true); - mTextPaint.setColor(0xFFFFFFFF); + mBarPaintUnused = new Paint(mBarPaintUsed); + mBarPaintUnused.setColor(0xFFFFCC33); - mTextPaint.setTextSize(16); - mTextPaint.setTextAlign(Align.CENTER); + mBarPaintNoFix = new Paint(mBarPaintUsed); + mBarPaintNoFix.setStyle(Style.STROKE); - mBitmapAdjustment = 10; + mBarOutlinePaint = new Paint(); + mBarOutlinePaint.setColor(0xFFFFFFFF); + mBarOutlinePaint.setAntiAlias(true); + mBarOutlinePaint.setStyle(Style.STROKE); + mBarOutlinePaint.setStrokeWidth(1.0f); + } - mLinePaint = new Paint(); - mLinePaint.setColor(0xFFDDDDDD); - mLinePaint.setAntiAlias(true); - mLinePaint.setStyle(Style.STROKE); - mLinePaint.setStrokeWidth(1.0f); + public void setLonLat(double lon, double lat) { + this.lon = lon; + this.lat = lat; + } - mBarPaintUsed = new Paint(); - mBarPaintUsed.setColor(0xFF00BB00); - mBarPaintUsed.setAntiAlias(true); - mBarPaintUsed.setStyle(Style.FILL); - mBarPaintUsed.setStrokeWidth(1.0f); + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { - mBarPaintUnused = new Paint(mBarPaintUsed); - mBarPaintUnused.setColor(0xFFFFCC33); - - mBarPaintNoFix = new Paint(mBarPaintUsed); - mBarPaintNoFix.setStyle(Style.STROKE); - - mBarOutlinePaint = new Paint(); - mBarOutlinePaint.setColor(0xFFFFFFFF); - mBarOutlinePaint.setAntiAlias(true); - mBarOutlinePaint.setStyle(Style.STROKE); - mBarOutlinePaint.setStrokeWidth(1.0f); - } - - public void setLonLat(double lon, double lat) { - this.lon = lon; - this.lat = lat; - } - - @Override - protected void onSizeChanged(int w, int h, int oldw, int oldh) { - - boolean bReset; - int nbgID = R.mipmap.navi_gpssv; + boolean bReset = false; + int nbgID = R.mipmap.navi_gpssv; mbg = decodeResource(this.getResources(), nbgID); - + float fltWScale = 1.0f * w / mbg.getWidth(); - float fltHScale = 1.0f * h / mbg.getHeight(); + float fltHScale = 1.0f * h / mbg.getHeight(); + + if(fltWScale > fltHScale){ + fltScale = fltHScale; + } + else{ + fltScale = fltWScale; + } + if (this.getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { + if (!m_bW) { + return; + } - fltScale = Math.min(fltWScale, fltHScale); - if (this.getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { - if (!m_bW) { - return; - } - - bReset = true; - // 竖屏 - text1_x = 111; - text2_x = 280; - text3_x = 540; - text4_x = 94; - text5_x = 334; - text6_x = 565; - text1_y = 95; - text2_y = 95; - text3_y = 95; - text4_y = 208; - text5_y = 208; - text6_y = 208; - - settingX = 460; - settingY = 670; - - radius = 186; - centerX = 360; - centerY = 638; - x = centerX; - y = centerY; - redR = 295; + bReset = true; + // 竖屏 + text1_x = 111; + text2_x = 280; + text3_x = 540; + text4_x = 94; + text5_x = 334; + text6_x = 565; + text1_y = 95; + text2_y = 95; + text3_y = 95; + text4_y = 208; + text5_y = 208; + text6_y = 208; + + settingX=460; + settingY=670; + + radius = 186; + centerX = 360; + centerY = 638; + x = centerX; + y = centerY; + redR = 295; sx = -185; sy = -195; - //信号显示位置设置 - signalTop = 1074; - signalBottom = 1171; - signalWidth = 20; - signalX[0] = 48; - for (int i = 1; i < 12; i++) { - signalX[i] = signalX[i - 1] + 55; - if (i >= 3 && i <= 6) { - signalX[i]++; - } - } + //信号显示位置设置 + signalTop = 1074; + signalBottom = 1171; + signalWidth = 20; + signalX[0] =48; + for(int i=1 ; i<12; i++){ + signalX[i] = signalX[i-1]+55; + if(i>=3 && i<=6){ + signalX[i]++; + } + } sector = decodeResource(this.getResources(), R.mipmap.sector); m_bW = false; - } else { - if (m_bW) { - return; + } else { + if (m_bW) { + return; + } + + bReset = true; + // 横屏 + text1_x = 135; + text2_x = 60; + text3_x = 85; + text4_x = 120; + text5_x = 120; + text6_x = 135; + text1_y = 85; + text2_y = 600; + text3_y = 290; + text4_y = 500; + text5_y = 400; + text6_y = 190; + + radius = 172; + centerX = 645; + centerY = 335; + x = centerX; + y = centerY; + sx = -184; + sy = -186; + redR = 275; + //信号显示位置设置 + signalTop = 1193; + signalBottom = 1089; + signalWidth = 20; + signalX[0] =57; + for(int i=1 ; i<12; i++){ + signalX[i] = signalX[i-1]+50; + if(i>=3 && i<=6){ + signalX[i]++; + } } + m_nScreenWidth = this.getWidth(); + m_nScreenHeight = this.getHeight(); + //nbgID = R.mipmap.navi_gpssv_h; + //sector = decodeResource(this.getResources(), R.mipmap.sector1); + m_bW = true; + } - bReset = true; - // 横屏 - text1_x = 135; - text2_x = 60; - text3_x = 85; - text4_x = 120; - text5_x = 120; - text6_x = 135; - text1_y = 85; - text2_y = 600; - text3_y = 290; - text4_y = 500; - text5_y = 400; - text6_y = 190; + if (bReset) { + try { + mbg = decodeResource(this.getResources(), nbgID); + if(bitmap != null){ + bitmap.recycle(); + bitmap = null; + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } - radius = 172; - centerX = 645; - centerY = 335; - x = centerX; - y = centerY; - sx = -184; - sy = -186; - redR = 275; - //信号显示位置设置 - signalTop = 1193; - signalBottom = 1089; - signalWidth = 20; - signalX[0] = 57; - for (int i = 1; i < 12; i++) { - signalX[i] = signalX[i - 1] + 50; - if (i >= 3 && i <= 6) { - signalX[i]++; - } - } - m_nScreenWidth = this.getWidth(); - m_nScreenHeight = this.getHeight(); - //nbgID = R.mipmap.navi_gpssv_h; - //sector = decodeResource(this.getResources(), R.mipmap.sector1); - m_bW = true; - } + super.onSizeChanged(w, h, oldw, oldh); + } - if (bReset) { - try { - mbg = decodeResource(this.getResources(), nbgID); - if (bitmap != null) { - bitmap.recycle(); - bitmap = null; - } - } catch (Exception ex) { - ex.printStackTrace(); - } - } + @Override + protected void onDraw(Canvas canvas) { - super.onSizeChanged(w, h, oldw, oldh); - } + super.onDraw(canvas); + int nDispW = this.getWidth(); + int nDispH = this.getHeight(); + int nBgWidth = mbg.getWidth(); + int nBgHeight = mbg.getHeight(); + + m_nScreenWidth = nDispW; + m_nScreenHeight = nDispH; + + if(bitmap == null){ + bitmap = Bitmap.createBitmap(mbg.getWidth(), mbg.getHeight(), Bitmap.Config.RGB_565); + } + + canvas.setDensity(m_nDensity); + bitmap.setDensity(m_nDensity); + Canvas tmpCanvas = new Canvas(bitmap); + drawView(tmpCanvas); + + int nBgW = (int)(fltScale * nBgWidth); + int nBgH = (int)(fltScale * nBgHeight); + Rect src = new Rect(0, 0, nBgWidth, nBgHeight); + Rect dst = new Rect((nDispW-nBgW)/2, (nDispH-nBgH)/2, (nDispW+nBgW)/2, (nDispH+nBgH)/2); + canvas.drawBitmap(bitmap, src, dst, null); + } - @Override - protected void onDraw(Canvas canvas) { - - super.onDraw(canvas); - int nDispW = this.getWidth(); - int nDispH = this.getHeight(); - int nBgWidth = mbg.getWidth(); - int nBgHeight = mbg.getHeight(); - - m_nScreenWidth = nDispW; - m_nScreenHeight = nDispH; - - if (bitmap == null) { - bitmap = Bitmap.createBitmap(mbg.getWidth(), mbg.getHeight(), Bitmap.Config.RGB_565); - } - - canvas.setDensity(m_nDensity); - bitmap.setDensity(m_nDensity); - Canvas tmpCanvas = new Canvas(bitmap); - drawView(tmpCanvas); - - int nBgW = (int) (fltScale * nBgWidth); - int nBgH = (int) (fltScale * nBgHeight); - Rect src = new Rect(0, 0, nBgWidth, nBgHeight); - Rect dst = new Rect((nDispW - nBgW) / 2, (nDispH - nBgH) / 2, (nDispW + nBgW) / 2, (nDispH + nBgH) / 2); - canvas.drawBitmap(bitmap, src, dst, null); - } - - private void drawView(Canvas canvas) { - if (null == canvas) { - return; - } - canvas.drawBitmap(mbg, 0, 0, null); - canvas.drawBitmap(setting, settingX - setting.getWidth(), settingY - setting.getHeight(), null); - //气泡 - if (!m_bW) { - canvas.drawBitmap(water, x - ballR, y - ballR, null); - } else { - if (m_AccX > 3) { - canvas.drawBitmap(water, centerX + (y - centerY) - ballR, centerY - (x - centerX) - ballR, null); - flagBall = true; - } else if (m_AccX < -3) { - canvas.drawBitmap(water, centerX - (y - centerY) - ballR, centerY + (x - centerX) - ballR, null); - flagBall = false; - } else { - if (flagBall) { - canvas.drawBitmap(water, centerX + (y - centerY) - ballR, centerY - (x - centerX) - ballR, null); - } else { - canvas.drawBitmap(water, centerX - (y - centerY) - ballR, centerY + (x - centerX) - ballR, null); - } - } - } - - - //罗盘箭头 - float dirTmp = m_sensorDir; - if (m_bW) { - if (m_AccX > 3) { - m_sensorDir = (m_sensorDir + 90) % 360; - flagDir = true; - } else if (m_AccX < -3) { - m_sensorDir = (m_sensorDir - 90 + 360) % 360; - flagDir = false; - } else { - if (flagDir) { - m_sensorDir = (m_sensorDir + 90) % 360; - } else { - m_sensorDir = (m_sensorDir - 90 + 360) % 360; - } - } - } - canvas.save(); - canvas.translate(centerX, centerY); - int ndir = (int) m_sensorDir; - m_sensorDir = dirTmp; - int delta = ((360 - ndir) - lastDir + 360) % 360; - if (delta > 2) { - if (delta < 180) { - lastDir = (lastDir + 1 + delta / 3) % 360; - } else { - lastDir = (lastDir - 1 - (360 - delta) / 3 + 360) % 360; - } - } - canvas.rotate(lastDir); - canvas.drawBitmap(arrow, (float) -15, (float) (-redR - 45), null); - canvas.restore(); - - //扫描扇形进行旋转 - canvas.save(); - canvas.translate(centerX, centerY); - canvas.rotate((degree += 3) % 360); - canvas.drawBitmap(sector, sx, sy, null); - canvas.restore(); + private void drawView(Canvas canvas){ + if(null == canvas){ + return; + } + canvas.drawBitmap(mbg, 0, 0, null); + canvas.drawBitmap(setting, settingX-setting.getWidth(), settingY-setting.getHeight(), null); + //气泡 + if(!m_bW) { + canvas.drawBitmap(water, x-ballR, y-ballR, null); + } else{ + if(m_AccX > 3){ + canvas.drawBitmap(water, centerX + (y - centerY) - ballR, centerY - (x - centerX) - ballR, null); + flagBall = true; + }else if(m_AccX < -3){ + canvas.drawBitmap(water, centerX - (y - centerY) - ballR, centerY + (x - centerX) - ballR, null); + flagBall = false; + }else{ + if(flagBall) { + canvas.drawBitmap(water, centerX + (y - centerY) - ballR, centerY - (x - centerX) - ballR, null); + } else { + canvas.drawBitmap(water, centerX - (y - centerY) - ballR, centerY + (x - centerX) - ballR, null); + } + } + } + + + //罗盘箭头 + float dirTmp = m_sensorDir; + if(m_bW){ + if(m_AccX > 3){ + m_sensorDir = (m_sensorDir + 90) % 360; + flagDir = true; + }else if(m_AccX < -3){ + m_sensorDir = (m_sensorDir - 90 + 360) % 360; + flagDir = false; + }else{ + if(flagDir) { + m_sensorDir = (m_sensorDir + 90) % 360; + } else { + m_sensorDir = (m_sensorDir - 90 + 360) % 360; + } + } + } + canvas.save(); + canvas.translate(centerX, centerY); + int ndir = (int)m_sensorDir; + m_sensorDir = dirTmp; + int delta = ((360 - ndir) - lastDir + 360) % 360; + if(delta > 2){ + if(delta < 180){ + lastDir = (lastDir + 1 + delta / 3) % 360; + }else{ + lastDir = (lastDir - 1 - (360-delta) / 3+ 360) % 360; + } + } + canvas.rotate(lastDir); + canvas.drawBitmap(arrow, (float)-15, (float)(-redR-45), null); + canvas.restore(); + //扫描扇形进行旋转 + canvas.save(); + canvas.translate(centerX, centerY); + canvas.rotate((degree += 3)%360); + canvas.drawBitmap(sector, sx, sy, null); + canvas.restore(); + // GpsStatus gsv = MainInfo.GetInstance().getNaviControler().GetCurGSV(); - - if (gsv == null) { + + if(gsv == null){ // gsv = CommonController.getInstance().getLocationMgr(mContext).getGpsStatus(gsv); - } + } + + if (gsv != null) { + Iterable sats = gsv.getSatellites(); + Iterator iter = sats.iterator(); - if (gsv != null) { - Iterable sats = gsv.getSatellites(); - Iterator iter = sats.iterator(); + int nMaxNum = gsv.getMaxSatellites(); + if( nMaxNum <= 0) { + return; + } + + mPrns = new int[nMaxNum]; + mElevation = new float[nMaxNum]; + mAzimuth = new float[nMaxNum]; + mSnrs = new float[nMaxNum]; + mX = new float[nMaxNum]; + mY = new float[nMaxNum]; - int nMaxNum = gsv.getMaxSatellites(); - if (nMaxNum <= 0) { - return; - } + int count = 0; + mUsedInFixMask = 0; - mPrns = new int[nMaxNum]; - mElevation = new float[nMaxNum]; - mAzimuth = new float[nMaxNum]; - mSnrs = new float[nMaxNum]; - mX = new float[nMaxNum]; - mY = new float[nMaxNum]; + while (iter.hasNext()) { + GpsSatellite sat = (GpsSatellite) iter.next(); - int count = 0; - mUsedInFixMask = 0; + int mPrn = sat.getPrn(); + float mSnr = sat.getSnr(); + float mElev = sat.getElevation(); + float mAzi = sat.getAzimuth(); + + if (mElev >= 90 || mAzi< 0 || mPrn <= 0 || mSnr < 0) { + continue; + } - while (iter.hasNext()) { - GpsSatellite sat = (GpsSatellite) iter.next(); + mPrns[count] = mPrn; + mSnrs[count] = mSnr; + mElevation[count] = mElev; + mAzimuth[count] = mAzi; - int mPrn = sat.getPrn(); - float mSnr = sat.getSnr(); - float mElev = sat.getElevation(); - float mAzi = sat.getAzimuth(); + if (sat.usedInFix()) { + mUsedInFixMask += 1; + } - if (mElev >= 90 || mAzi < 0 || mPrn <= 0 || mSnr < 0) { - continue; - } + mUsedInFixMask <<= 1; + count++; + } - mPrns[count] = mPrn; - mSnrs[count] = mSnr; - mElevation[count] = mElev; - mAzimuth[count] = mAzi; + mSatellites = count; + computeXY(); + } - if (sat.usedInFix()) { - mUsedInFixMask += 1; - } + final Paint gridPaint = mGridPaint; + final Paint textPaint = mTextPaint; - mUsedInFixMask <<= 1; - count++; - } + double scale = radius / 90.0; + + for (int i = 0; i < mSatellites; ++i) { + //屏蔽无效星历 + if (mElevation[i] >= 90 || mAzimuth[i] <= 0) { + continue; + } + double a = mElevation[i] * scale; - mSatellites = count; - computeXY(); - } + int x = (int) Math.round(centerX + (mX[i] * a) - mBitmapAdjustment); + int y = (int) Math.round(centerY + (mY[i] * a) - mBitmapAdjustment); - final Paint gridPaint = mGridPaint; - final Paint textPaint = mTextPaint; + if (0 == mUsedInFixMask || mSnrs[i] <= 0) { + //gridPaint.setColor(Color.GRAY); + // 地图上的卫星符号 + canvas.drawBitmap(grayDot, x, y,null); + } else if (0 != (mUsedInFixMask & (1 << (mSatellites - i)))) { + // 可用 + gridPaint.setColor(Color.GREEN); + canvas.drawBitmap(greenDot, x, y,null); + } else { + gridPaint.setColor(Color.YELLOW); + canvas.drawBitmap(yellowDot, x, y,null); + } + } - double scale = radius / 90.0; + + // * GPS状态: 搜索中 已连接 速度 高程 方向 卫星颗数(有效的) 时间 + final int fill = 18; + float slotWidth = 36; + float barWidth = slotWidth - fill; - for (int i = 0; i < mSatellites; ++i) { - //屏蔽无效星历 - if (mElevation[i] >= 90 || mAzimuth[i] <= 0) { - continue; - } - double a = mElevation[i] * scale; - - int x = (int) Math.round(centerX + (mX[i] * a) - mBitmapAdjustment); - int y = (int) Math.round(centerY + (mY[i] * a) - mBitmapAdjustment); - - if (0 == mUsedInFixMask || mSnrs[i] <= 0) { - //gridPaint.setColor(Color.GRAY); - // 地图上的卫星符号 - canvas.drawBitmap(grayDot, x, y, null); - } else if (0 != (mUsedInFixMask & (1 << (mSatellites - i)))) { - // 可用 - gridPaint.setColor(Color.GREEN); - canvas.drawBitmap(greenDot, x, y, null); - } else { - gridPaint.setColor(Color.YELLOW); - canvas.drawBitmap(yellowDot, x, y, null); - } - } - - - // * GPS状态: 搜索中 已连接 速度 高程 方向 卫星颗数(有效的) 时间 - final int fill = 18; - float slotWidth = 36; - float barWidth = slotWidth - fill; - - // 宽13 11 间隔 11 - if (gsv != null) { - for (int i = 0; i < mSatellites; ++i) { - if (mSnrs[i] < 0) { - mSnrs[i] = 0; + // 宽13 11 间隔 11 + if (gsv != null) { + for (int i = 0; i < mSatellites; ++i) { + if (mSnrs[i] < 0) { + mSnrs[i] = 0; // MainInfo.GetInstance().LogAdd("GPS: i=" + i + "<0"); - } else if (mSnrs[i] >= 70) { - mSnrs[i] = 70; - } - } - } + }else if(mSnrs[i] >= 70){ + mSnrs[i] = 70; + } + } + } - int mSatellitesInUsed = 0; + int mSatellitesInUsed = 0; + + for (int i = 0; i < mSatellites; ++i) { + if (mPrns[i] <= 0 || mSnrs[i] < 0) { + continue; + } + if(mSatellitesInUsed >= MAX_SATS){ + break; + } + if(!m_bW){//竖屏 + mDrawable.setBounds(new Rect(signalX[i],signalTop,signalX[i] + signalWidth,signalBottom)); + mDrawable.setGradientType(GradientDrawable.LINEAR_GRADIENT); - for (int i = 0; i < mSatellites; ++i) { - if (mPrns[i] <= 0 || mSnrs[i] < 0) { - continue; - } - if (mSatellitesInUsed >= MAX_SATS) { - break; - } - if (!m_bW) {//竖屏 - mDrawable.setBounds(new Rect(signalX[i], signalTop, signalX[i] + signalWidth, signalBottom)); - mDrawable.setGradientType(GradientDrawable.LINEAR_GRADIENT); + + if (0 == mUsedInFixMask) { + mDrawable.setColor(0xff858585); + } else if (0 != (mUsedInFixMask & (1 << (mSatellites - i)))) { + mDrawable.setColor(0xff7bd497); + } else { + mDrawable.setColor(0xffffa300); + } + mDrawable.draw(canvas); + canvas.drawLine(signalX[i] + signalWidth/2, signalTop, signalX[i] + signalWidth/2, signalBottom - mSnrs[i], blackPaint); + int n = mPrns[i]%100/10; + if(n > 0){ + canvas.drawBitmap(lNumber[n], signalX[i]-12, signalBottom -5,null); + canvas.drawBitmap(lNumber[mPrns[i]%10], signalX[i]-1, signalBottom -5 ,null); + }else{ + canvas.drawBitmap(lNumber[mPrns[i]%10], signalX[i]-8, signalBottom -5 ,null); + } + } else { + mDrawable.setBounds(new Rect(signalBottom,signalX[i],signalTop,signalX[i] + signalWidth)); + mDrawable.setGradientType(GradientDrawable.LINEAR_GRADIENT); + mDrawable.draw(canvas); + canvas.drawLine(signalTop, signalX[i] + signalWidth/2, signalBottom + mSnrs[i],signalX[i] + signalWidth/2, blackPaint); + canvas.drawBitmap(lNumber[mPrns[i]%100/10], signalBottom -38,signalX[i]-10, null); + canvas.drawBitmap(lNumber[mPrns[i]%10], signalBottom-25,signalX[i]-10, null); + } + mSatellitesInUsed++; + + } - if (0 == mUsedInFixMask) { - mDrawable.setColor(0xff858585); - } else if (0 != (mUsedInFixMask & (1 << (mSatellites - i)))) { - mDrawable.setColor(0xff7bd497); - } else { - mDrawable.setColor(0xffffa300); - } - mDrawable.draw(canvas); - canvas.drawLine(signalX[i] + signalWidth / 2.0f, signalTop, signalX[i] + signalWidth / 2.0f, signalBottom - mSnrs[i], blackPaint); - int n = mPrns[i] % 100 / 10; - if (n > 0) { - canvas.drawBitmap(lNumber[n], signalX[i] - 12.0f, signalBottom - 5.0f, null); - canvas.drawBitmap(lNumber[mPrns[i] % 10], signalX[i] - 1.0f, signalBottom - 5.0f, null); - } else { - canvas.drawBitmap(lNumber[mPrns[i] % 10], signalX[i] - 8.0f, signalBottom - 5.0f, null); - } - } else { - mDrawable.setBounds(new Rect(signalBottom, signalX[i], signalTop, signalX[i] + signalWidth)); - mDrawable.setGradientType(GradientDrawable.LINEAR_GRADIENT); - mDrawable.draw(canvas); + //卫星颗数 + if(mSatellites < 10){ + //canvas.drawBitmap(number[0], text1_x, text1_y,null); + canvas.drawBitmap(number[mSatellites], text1_x, text1_y,null); + } + else{ + canvas.drawBitmap(number[mSatellites%100/10], text1_x, text1_y,null); + canvas.drawBitmap(number[mSatellites%10], text1_x+25, text1_y,null); + } + //时间 + Date date = new Date(); + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); + String s = sdf.format(date); + //System.out.println(s); + canvas.drawBitmap(number[(int)(s.charAt(0)-'0')], text2_x, text2_y,null); + canvas.drawBitmap(number[(int)(s.charAt(1)-'0')], text2_x+20, text2_y,null); + canvas.drawBitmap(dot, text2_x+40, text2_y-2,null); + canvas.drawBitmap(dot, text2_x+40, text2_y+10,null); + canvas.drawBitmap(number[(int)(s.charAt(3)-'0')], text2_x+55, text2_y,null); + canvas.drawBitmap(number[(int)(s.charAt(4)-'0')], text2_x+75, text2_y,null); + canvas.drawBitmap(dot, text2_x+95, text2_y-2,null); + canvas.drawBitmap(dot, text2_x+95, text2_y+10,null); + canvas.drawBitmap(number[(int)(s.charAt(6)-'0')], text2_x+110, text2_y,null); + canvas.drawBitmap(number[(int)(s.charAt(7)-'0')], text2_x+130, text2_y,null); + //方向角 + dirX = ((dirX % 360) + 360) % 360; + s = String.valueOf(dirX); + int startLocation = text3_x; + for(int i = 0 ; i < s.length() ; i++){ + if(s.charAt(i) == '.'){ + canvas.drawBitmap(dot, startLocation, text3_y+12,null); + startLocation +=15 ; + canvas.drawBitmap(number[s.charAt(i+1)-'0'], startLocation, text3_y,null); + break; + } + canvas.drawBitmap(number[s.charAt(i)-'0'], startLocation, text3_y,null); + startLocation +=20 ; + } + //俯仰角 + s = String.valueOf(dirY); + startLocation = text4_x; + for(int i = 0 ; i < s.length() ; i++){ + if(s.charAt(i) == '.'){ + canvas.drawBitmap(dot, startLocation, text4_y+12,null); + startLocation +=15 ; + canvas.drawBitmap(number[s.charAt(i+1)-'0'], startLocation, text4_y,null); + break; + } + canvas.drawBitmap(number[s.charAt(i)-'0'], startLocation, text4_y,null); + startLocation +=20 ; + } + //加速度 + s= String.valueOf(acc); + startLocation = text5_x; + for(int i = 0; i < s.length(); i++ ){ + if(s.charAt(i) == '.'){ + canvas.drawBitmap(dot, startLocation, text5_y+12,null); + startLocation +=15 ; + canvas.drawBitmap(number[s.charAt(i+1)-'0'], startLocation, text5_y,null); + break; + } + canvas.drawBitmap(number[s.charAt(i)-'0'], startLocation, text5_y,null); + startLocation += 20; + } + + //速度 + s= String.valueOf(mSpeed); + startLocation = text6_x - (s.length()-1) * 10; + for(int i = 0; i < s.length() ; i++ ){ + if(s.charAt(i) == '.') { + canvas.drawBitmap(dot, startLocation, text6_y+12,null); + } else { + canvas.drawBitmap(number[s.charAt(i)-'0'], startLocation, text6_y,null); + } + startLocation += 20; + } + } + + private Bitmap decodeResource(Resources resources, int id) { + BitmapFactory.Options opts = new BitmapFactory.Options(); + opts.inTargetDensity = m_nDensity; + return BitmapFactory.decodeResource(resources, id, opts); + } - canvas.drawLine(signalTop, signalX[i] + signalWidth / 2.0f, signalBottom + mSnrs[i], signalX[i] + signalWidth / 2.0f, blackPaint); - canvas.drawBitmap(lNumber[mPrns[i] % 100 / 10], signalBottom - 38.0f, signalX[i] - 10.0f, null); - canvas.drawBitmap(lNumber[mPrns[i] % 10], signalBottom - 25.0f, signalX[i] - 10.0f, null); - } - mSatellitesInUsed++; + public void update(float[] a, float dir[], float[] la) { + m_AccX = a[0]; + m_AccY = a[1]; + m_sensorDir = dir[0]; + if(delayCount % 20 == 0){ + acc = (float) Math.sqrt(la[0]*la[0] + la[1]*la[1] + la[2]*la[2]); + dirX = dir[0]; + dirY = (-dir[1] + 360) % 360; + delayCount = 0; + } + delayCount++; + if(!start){ + if(count == 0){ + initA[0] = a[0]; + initA[1] = a[1]; + count++; + return; + }else if(count < 10){ + initA[0] = (float) (initA[0] * 0.8 + a[0] * 0.2); + initA[1] = (float) (initA[1] * 0.8 + a[1] * 0.2); + count++; + return; + }else{ + start = true; + lastA[0] = initA[0]; + lastA[1] = initA[1]; + } + } + float mod = (a[0] - lastA[0]) * (a[0] - lastA[0]) + (a[1] - lastA[1]) * (a[1] - lastA[1]); + if(mod > 0.1){ + nx = centerX + (a[0] - initA[0]) * 70; + ny = centerY - (a[1] - initA[1]) * 70; + double d = Math.sqrt((nx - x) * (nx - x) + (ny - y) * (ny - y)); + dx = (nx - x) / d; + dy = (ny - y) / d; + lastA[0] = a[0]- initA[0]; + lastA[1] = a[1]- initA[1]; - } + } + float dist = (float) Math.sqrt((x-nx)*(x-nx) + (y-ny)*(y-ny)); + if(dist > 15){ + x += dx * v; + y += dy * v; + } + float temp = (float) Math.sqrt((x-centerX)*(x-centerX) + (y-centerY)*(y-centerY)); + + if(temp > radius){ + x = radius * (x-centerX) / temp; + y = radius * (y-centerY) / temp; + x += centerX; + y += centerY; + } + } + + @Override + public boolean dispatchTouchEvent(MotionEvent ev) { - //卫星颗数 - if (mSatellites < 10) { - //canvas.drawBitmap(number[0], text1_x, text1_y,null); - canvas.drawBitmap(number[mSatellites], text1_x, text1_y, null); - } else { - canvas.drawBitmap(number[mSatellites % 100 / 10], text1_x, text1_y, null); - canvas.drawBitmap(number[mSatellites % 10], text1_x + 25.0f, text1_y, null); - } - //时间 - Date date = new Date(); - SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); - String s = sdf.format(date); - //System.out.println(s); - canvas.drawBitmap(number[s.charAt(0) - '0'], text2_x, text2_y, null); - canvas.drawBitmap(number[s.charAt(1) - '0'], text2_x + 20.0f, text2_y, null); - canvas.drawBitmap(dot, text2_x + 40.0f, text2_y - 2.0f, null); - canvas.drawBitmap(dot, text2_x + 40.0f, text2_y + 10.0f, null); - canvas.drawBitmap(number[s.charAt(3) - '0'], text2_x + 55.0f, text2_y, null); - canvas.drawBitmap(number[s.charAt(4) - '0'], text2_x + 75.0f, text2_y, null); - canvas.drawBitmap(dot, text2_x + 95.0f, text2_y - 2.0f, null); - canvas.drawBitmap(dot, text2_x + 95.0f, text2_y + 10.0f, null); - canvas.drawBitmap(number[s.charAt(6) - '0'], text2_x + 110.0f, text2_y, null); - canvas.drawBitmap(number[s.charAt(7) - '0'], text2_x + 130.0f, text2_y, null); - //方向角 - dirX = ((dirX % 360) + 360) % 360; - s = String.valueOf(dirX); - int startLocation = text3_x; - for (int i = 0; i < s.length(); i++) { - if (s.charAt(i) == '.') { - canvas.drawBitmap(dot, startLocation, text3_y + 12.0f, null); - startLocation += 15; - canvas.drawBitmap(number[s.charAt(i + 1) - '0'], startLocation, text3_y, null); - break; - } - canvas.drawBitmap(number[s.charAt(i) - '0'], startLocation, text3_y, null); - startLocation += 20; - } - //俯仰角 - s = String.valueOf(dirY); - startLocation = text4_x; - for (int i = 0; i < s.length(); i++) { - if (s.charAt(i) == '.') { - canvas.drawBitmap(dot, startLocation, text4_y + 12.0f, null); - startLocation += 15; - canvas.drawBitmap(number[s.charAt(i + 1) - '0'], startLocation, text4_y, null); - break; - } - canvas.drawBitmap(number[s.charAt(i) - '0'], startLocation, text4_y, null); - startLocation += 20; - } - //加速度 - s = String.valueOf(acc); - startLocation = text5_x; - for (int i = 0; i < s.length(); i++) { - if (s.charAt(i) == '.') { - canvas.drawBitmap(dot, startLocation, text5_y + 12.0f, null); - startLocation += 15; - canvas.drawBitmap(number[s.charAt(i + 1) - '0'], startLocation, text5_y, null); - break; - } - canvas.drawBitmap(number[s.charAt(i) - '0'], startLocation, text5_y, null); - startLocation += 20; - } - - //速度 - s = String.valueOf(mSpeed); - startLocation = text6_x - (s.length() - 1) * 10; - for (int i = 0; i < s.length(); i++) { - if (s.charAt(i) == '.') { - canvas.drawBitmap(dot, startLocation, text6_y + 12.0f, null); - } else { - canvas.drawBitmap(number[s.charAt(i) - '0'], startLocation, text6_y, null); - } - startLocation += 20; - } - } - - private Bitmap decodeResource(Resources resources, int id) { - BitmapFactory.Options opts = new BitmapFactory.Options(); - opts.inTargetDensity = m_nDensity; - return BitmapFactory.decodeResource(resources, id, opts); - } - - public void update(float[] a, float[] dir, float[] la) { - m_AccX = a[0]; - m_AccY = a[1]; - m_sensorDir = dir[0]; - if (delayCount % 20 == 0) { - acc = (float) Math.sqrt(la[0] * la[0] + la[1] * la[1] + la[2] * la[2]); - dirX = dir[0]; - dirY = (-dir[1] + 360) % 360; - delayCount = 0; - } - delayCount++; - if (!start) { - if (count == 0) { - initA[0] = a[0]; - initA[1] = a[1]; - count++; - return; - } else if (count < 10) { - initA[0] = (float) (initA[0] * 0.8 + a[0] * 0.2); - initA[1] = (float) (initA[1] * 0.8 + a[1] * 0.2); - count++; - return; - } else { - start = true; - lastA[0] = initA[0]; - lastA[1] = initA[1]; - } - } - float mod = (a[0] - lastA[0]) * (a[0] - lastA[0]) + (a[1] - lastA[1]) * (a[1] - lastA[1]); - if (mod > 0.1) { - nx = centerX + (a[0] - initA[0]) * 70; - ny = centerY - (a[1] - initA[1]) * 70; - double d = Math.sqrt((nx - x) * (nx - x) + (ny - y) * (ny - y)); - dx = (nx - x) / d; - dy = (ny - y) / d; - lastA[0] = a[0] - initA[0]; - lastA[1] = a[1] - initA[1]; - - } - float dist = (float) Math.sqrt((x - nx) * (x - nx) + (y - ny) * (y - ny)); - if (dist > 15) { - x += dx * v; - y += dy * v; - } - float temp = (float) Math.sqrt((x - centerX) * (x - centerX) + (y - centerY) * (y - centerY)); - - if (temp > radius) { - x = radius * (x - centerX) / temp; - y = radius * (y - centerY) / temp; - x += centerX; - y += centerY; - } - } - - @Override - public boolean dispatchTouchEvent(MotionEvent ev) { - - switch (ev.getAction()) { - case MotionEvent.ACTION_DOWN: - int m_nX = (int) ev.getX(); - int m_nY = (int) ev.getY(); - int nDisToCenter = (int) Math.sqrt((m_nScreenWidth / 2.0 - m_nX) * (m_nScreenWidth / 2.0 - m_nX) + (m_nScreenHeight / 2.0 - m_nY) * (m_nScreenHeight / 2.0 - m_nY)); - if (nDisToCenter < radius) { - x = centerX; - y = centerY; - initA[0] = m_AccX; - initA[1] = m_AccY; - } - int nBgW = (int) (fltScale * mbg.getWidth()); - int nBgH = (int) (fltScale * mbg.getHeight()); - float x = (m_nX) / fltScale - (this.getWidth() - nBgW) / 2.0f; - float y = (m_nY) / fltScale - (this.getHeight() - nBgH) / 2.0f; - if (x < settingX && x > settingX - setting.getWidth() && y < settingY && y > settingY - setting.getHeight()) { - this.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); + switch( ev.getAction() ) + { + case MotionEvent.ACTION_DOWN: + int m_nX = (int)ev.getX(); + int m_nY = (int)ev.getY(); + int nDisToCenter =(int) Math.sqrt((m_nScreenWidth/2 - m_nX) * (m_nScreenWidth/2 - m_nX) + (m_nScreenHeight/2 - m_nY) * (m_nScreenHeight/2 - m_nY)); + if(nDisToCenter < radius){ + x = centerX; + y = centerY; + initA[0] = m_AccX; + initA[1] = m_AccY; + } + int nBgW = (int)(fltScale * mbg.getWidth()); + int nBgH = (int)(fltScale * mbg.getHeight()); + float x = (m_nX) / fltScale - (this.getWidth() - nBgW)/2; + float y = (m_nY ) / fltScale -(this.getHeight() - nBgH)/2; + if( xsettingX - setting.getWidth() && ysettingY-setting.getHeight()){ + this.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); // MainInfo.GetInstance().getNaviControler().removeDialog(DialogManager.DIALOG_GPS_TEST_MAIN); // MainInfo.GetInstance().getNaviControler().showDialog(DialogManager.DIALOG_GPS_TEST_MAIN); // MainInfo.GetInstance().getAppInfo().addActionInfo("NaviControler", "gpstest", null); - } - break; + } + break; - case MotionEvent.ACTION_UP: - case MotionEvent.ACTION_MOVE: - break; - } - return true; - } - - public int getGPSSatellites() { - return mSatellites; - } + case MotionEvent.ACTION_UP: + break; + case MotionEvent.ACTION_MOVE: + break; + } + return true; + } + + public int getGPSSatellites() { + return mSatellites; + } + } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/proxy/CommonProxy.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/proxy/CommonProxy.kt index 3c1a833a58..ea1933d029 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/proxy/CommonProxy.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/proxy/CommonProxy.kt @@ -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 { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/proxy/LonLatProxy.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/proxy/LonLatProxy.kt index c9107144e9..efe62ca85f 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/proxy/LonLatProxy.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/proxy/LonLatProxy.kt @@ -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 } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/road/RoadHelper.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/road/RoadHelper.kt index 2ea1d605f5..c8cfcc4621 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/road/RoadHelper.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/road/RoadHelper.kt @@ -14,7 +14,6 @@ import com.zhidaoauto.map.data.road.RoadSign import com.zhidaoauto.map.data.road.RoadSignPostion import com.zhidaoauto.map.data.road.RouteCamera import com.zhidaoauto.map.data.road.RouteLane -import com.zhidaoauto.map.data.road.RouteLine import com.zhidaoauto.map.data.road.RoutePath import com.zhidaoauto.map.data.road.RouteRsu import com.zhidaoauto.map.data.road.RouteStep @@ -35,16 +34,17 @@ import com.zhidaoauto.map.sdk.inner.utils.LogHelper import com.zhidaoauto.map.sdk.inner.utils.TransformUtils import com.zhidaoauto.map.sdk.open.abs.IResult import com.zhidaoauto.map.sdk.open.abs.OnHdDataDownByCityListener -import com.zhidaoauto.map.sdk.open.city.CityCodeInfo -import com.zhidaoauto.map.sdk.open.city.CityCodeModel -import com.zhidaoauto.map.sdk.open.city.CityCodeResult +import com.zhidaoauto.map.sdk.open.logics.city.CityCodeInfo +import com.zhidaoauto.map.sdk.inner.cloud.city.CityCodeModel +import com.zhidaoauto.map.sdk.open.logics.city.CityCodeResult import com.zhidaoauto.map.sdk.open.data.CityInfo import com.zhidaoauto.map.sdk.open.data.MapDataApi -import com.zhidaoauto.map.sdk.open.tools.MapTools +import com.zhidaoauto.map.sdk.open.common.tools.MapTools import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job import kotlinx.coroutines.delay import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.CopyOnWriteArrayList import java.util.concurrent.atomic.AtomicBoolean @@ -78,7 +78,7 @@ class RoadHelper private constructor() { //RTK匹配最小角度 private val minRTKAngle = 5f - private val MAX_CACHE_SIZE = 20 // Set the maximum size of the cache + private val MAX_CACHE_SIZE = 5 // Set the maximum size of the cache //限速相关 var lastSpeed = 60 @@ -88,6 +88,7 @@ class RoadHelper private constructor() { private var mHdDataDownloadListener: ConcurrentHashMap? = null fun release(){ + cancelTask() cacheHdDataProgressJob?.cancel() cacheHdDataProgressJob = null @@ -229,7 +230,7 @@ class RoadHelper private constructor() { private val roadLimitSpeedCache = ConcurrentLRUCache(MAX_CACHE_SIZE) - fun getRoadLimitSpeed(dLon: Double, dLat: Double, fAngle: Float, isCanCancel: Boolean, call:IResult) { + fun getRoadLimitSpeed(dLon: Double, dLat: Double, fAngle: Float, isCanCancel: Boolean, call:IResult):String { // Use input parameters to create a unique cache key val key = "llaGetRoadLimitSpeed_${dLon.toTenDecimalsStr()}_${dLat.toTenDecimalsStr()}_${fAngle.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}$isCanCancel" @@ -238,7 +239,7 @@ class RoadHelper private constructor() { if (cachedValue != null) { // If cached value exists, return it directly call.result(0,cachedValue) - return + return key } // If cached value does not exist, call llaGetRoadLimitSpeed method to get new value @@ -282,10 +283,12 @@ class RoadHelper private constructor() { }) mapBox.llaGetRoadLimitSpeed(dLon, dLat, fAngle,isCanCancel) + return key } - fun getZebraLine(lon: Double,lat: Double,angle: Float,call:IResult){ - RoadResultController.instance.addRoadResultListener("llaGetZebraLine_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${angle.toTenDecimalsStr()}",object :IRoadData{ + fun getZebraLine(lon: Double,lat: Double,angle: Float,isCanCancel: Boolean,call:IResult):String{ + val key ="llaGetZebraLine_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${angle.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}$isCanCancel" + RoadResultController.instance.addRoadResultListener(key,object :IRoadData{ override fun result(code: Int, result: ByteArray?) { @@ -296,12 +299,14 @@ class RoadHelper private constructor() { } }) - mapBox.llaGetZebraLine(lon,lat,angle) + mapBox.llaGetZebraLine(lon,lat,angle,isCanCancel) + return key } - fun getTrafficLight(lon: Double,lat: Double,angle: Float, call:IResult){ - RoadResultController.instance.addRoadResultListener("llaGetTrafficLight_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${angle.toTenDecimalsStr()}",object :IRoadData{ + fun getTrafficLight(lon: Double,lat: Double,angle: Float,isCanCancel: Boolean, call:IResult):String{ + val key = "llaGetTrafficLight_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${angle.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}$isCanCancel" + RoadResultController.instance.addRoadResultListener(key,object :IRoadData{ override fun result(code: Int, result: ByteArray?) { if(CompileConfig.DEBUG){ @@ -311,7 +316,8 @@ class RoadHelper private constructor() { } }) - mapBox.llaGetTrafficLight(lon,lat,angle) + mapBox.llaGetTrafficLight(lon,lat,angle,isCanCancel) + return key } // Set the maximum size of the cache to be MAX_CACHE_SIZE items. @@ -326,14 +332,14 @@ class RoadHelper private constructor() { * @return The center line of the road segment. */ - fun getCenterLine(dLon: Double, dLat: Double, fAngle: Float,isCanCancel: Boolean, call: IResult) { + fun getCenterLine(dLon: Double, dLat: Double, fAngle: Float,isCanCancel: Boolean, call: IResult):String { // Generate a unique key for this request. val cacheKey = "llaGetCenterLine_${dLon.toTenDecimalsStr()}_${dLat.toTenDecimalsStr()}_${fAngle.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}$isCanCancel" // If the center line for this request is already in the cache, return it. centerLineSingleCache.get(cacheKey)?.let { centerLine -> call.result(0,centerLine) - return + return cacheKey } // If the center line is not in the cache, fetch it from the server. @@ -348,44 +354,49 @@ class RoadHelper private constructor() { return } result?.let { - val buf = ByteBufferHelper.bytes2ByteBuffer(result) + CommonController.instance.scope?.launch(Dispatchers.IO) { + val buf = ByteBufferHelper.bytes2ByteBuffer(result) - buf?.let { - val centerLine = CenterLine() - centerLine.id = buf.int.toString() - centerLine.tile_id = buf.int.toString() - centerLine.road_id = buf.int.toString() - centerLine.lane_id = buf.int.toString() - val size = buf.int - val points = ArrayList() - for (i in 0 until size step 2) { - val lonLatPoint = LonLatPoint(buf.long / 1e8, buf.long / 1e8) - points.add(lonLatPoint) - } - centerLine.points = points - val pMatch = LonLatPoint() - MapDataApi.GetDisFromPointToLine(LonLatPoint(dLon, dLat), points, pMatch, 1) - centerLine.angle = pMatch.angle - // Add the result to the cache - centerLineSingleCache.put(cacheKey, centerLine) + buf?.let { + val centerLine = CenterLine() + centerLine.id = buf.int.toString() + centerLine.tile_id = buf.int.toString() + centerLine.road_id = buf.int.toString() + centerLine.lane_id = buf.int.toString() + val size = buf.int + val points = ArrayList() + for (i in 0 until size step 2) { + val lonLatPoint = LonLatPoint(buf.long / 1e8, buf.long / 1e8) + points.add(lonLatPoint) + } + centerLine.points = points + val pMatch = LonLatPoint() + MapDataApi.GetDisFromPointToLine(LonLatPoint(dLon, dLat), points, pMatch, 1) + centerLine.angle = pMatch.angle + // Add the result to the cache + centerLineSingleCache.put(cacheKey, centerLine) - if (CompileConfig.DEBUG) { - Log.d( - TAG, - "roadop--getCenterLine--centerLine: $centerLine" - ) + if (CompileConfig.DEBUG) { + Log.d( + TAG, + "roadop--getCenterLine--centerLine: $centerLine" + ) + } + withContext(Dispatchers.Main){ + call.result(0, centerLine) + } } - call.result(0, centerLine) - return } - } - call.result(1,null) + }?:{ + call.result(1,null) + } } }) mapBox.llaGetCenterLine(dLon, dLat, fAngle,isCanCancel) + return cacheKey } @@ -403,14 +414,14 @@ class RoadHelper private constructor() { * @return A StopLine object that contains information about the stop line, or null if no stop line was found. */ - fun getStopLine(dLon: Double, dLat: Double , fAngle: Float,isCanCancel: Boolean, call: IResult) { + fun getStopLine(dLon: Double, dLat: Double , fAngle: Float,isCanCancel: Boolean, call: IResult):String { val key = "llaStopLine_${dLon.toTenDecimalsStr()}_${dLat.toTenDecimalsStr()}_${fAngle.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}$isCanCancel" // Check if the result is in the cache val cachedResult = stopLineCache.get(key) if (cachedResult != null) { call.result(0,cachedResult) - return + return key } // Get the stop line information from the MapBox SDK. @@ -425,56 +436,65 @@ class RoadHelper private constructor() { return } result?.let { - val buf = ByteBufferHelper.bytes2ByteBuffer(result) - buf?.let { - val tileId = buf.int - if(tileId == 0){ - call.result(1,null) - return - } - val stopLine = StopLine() - stopLine.tile_id = "$tileId" - stopLine.length = buf.int.toDouble() - val roadIdSize = buf.int - val laneIdSize = buf.int - val pointSize = buf.int - val roadIds = ArrayList() - for (i in 0 until roadIdSize) { - val roadId = buf.int.toString() - roadIds.add(roadId) - } - stopLine.road_id = roadIds - val laneIds = ArrayList() - for (i in 0 until laneIdSize) { - val laneId = buf.int.toString() - laneIds.add(laneId) - } - stopLine.lane_id = laneIds - val points = ArrayList() - for (i in 0 until pointSize step 2) { - val lonLatPoint = LonLatPoint(buf.long / 1e8, buf.long / 1e8) - points.add(lonLatPoint) - } - stopLine.points = points + CommonController.instance.scope?.launch(Dispatchers.IO){ + val buf = ByteBufferHelper.bytes2ByteBuffer(result) + buf?.let { + val tileId = buf.int + if(tileId == 0){ + withContext(Dispatchers.Main){ + call.result(1,null) + } + return@launch + } + val stopLine = StopLine() + stopLine.tile_id = "$tileId" + stopLine.length = buf.int.toDouble() + val roadIdSize = buf.int + val laneIdSize = buf.int + val pointSize = buf.int + val roadIds = ArrayList() + for (i in 0 until roadIdSize) { + val roadId = buf.int.toString() + roadIds.add(roadId) + } + stopLine.road_id = roadIds + val laneIds = ArrayList() + for (i in 0 until laneIdSize) { + val laneId = buf.int.toString() + laneIds.add(laneId) + } + stopLine.lane_id = laneIds + val points = ArrayList() + for (i in 0 until pointSize step 2) { + val lonLatPoint = LonLatPoint(buf.long / 1e8, buf.long / 1e8) + points.add(lonLatPoint) + } + stopLine.points = points + + if(stopLine.points.size > 1) { + stopLine.distance = MapDataApi.getNearstFromPointToSegment(dLon, dLat, stopLine.points[0].longitude, stopLine.points[0].latitude, stopLine.points[stopLine.points.size-1].longitude, stopLine.points[stopLine.points.size-1].latitude) * 100000 + } + + // Print the stop line object to the log if debugging is enabled. + if (CompileConfig.DEBUG) { + Log.d(TAG, "roadop--getStopLine--stopLine: $stopLine") + } + stopLineCache.put(key,stopLine) + withContext(Dispatchers.Main){ + call.result(0,stopLine) + } - if(stopLine.points.size > 1) { - stopLine.distance = MapDataApi.getNearstFromPointToSegment(dLon, dLat, stopLine.points[0].longitude, stopLine.points[0].latitude, stopLine.points[stopLine.points.size-1].longitude, stopLine.points[stopLine.points.size-1].latitude) * 100000 } - // Print the stop line object to the log if debugging is enabled. - if (CompileConfig.DEBUG) { - Log.d(TAG, "roadop--getStopLine--stopLine: $stopLine") - } - stopLineCache.put(key,stopLine) - call.result(0,stopLine) - return } + } - call.result(1,null) + } }) mapBox.llaStopLine(dLon, dLat, fAngle,isCanCancel) + return key } @@ -489,14 +509,14 @@ class RoadHelper private constructor() { * @return The road rectangle information. */ - fun getRoadRect(lon: Double, lat: Double, angle: Float,call : IResult) { - val key = "llaMergedRoadRect_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${angle.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}false" + fun getRoadRect(lon: Double, lat: Double, angle: Float,isCanCancel: Boolean,call : IResult):String { + val key = "llaMergedRoadRect_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${angle.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}${isCanCancel}" // Check if the result is in the cache val cachedResult = roadRectCache.get(key) if (cachedResult != null) { call.result(0,cachedResult) - return + return key } // Compute the result if it's not in the cache @@ -517,7 +537,7 @@ class RoadHelper private constructor() { roadRectInfos.angle = buf.long / 1e8 val rectList = ArrayList() val size = buf.int - if(size > 0 && size % 8 == 0) { + if (size > 0 && size % 8 == 0) { for (i in 0 until size step 8) { val rect = RoadRect() rect.topLeft = LonLatPoint(buf.long / 1e8, buf.long / 1e8) @@ -544,7 +564,8 @@ class RoadHelper private constructor() { } }) - mapBox.llaMergedRoadRect(lon, lat, angle,false) + mapBox.llaMergedRoadRect(lon, lat, angle,isCanCancel) + return key } @@ -560,7 +581,7 @@ class RoadHelper private constructor() { //获取行驶方向一定长度的中心线 //dDis:正 行驶方向前方距离 负 行驶方向后方距离 - fun getCenterLineRange(dLon: Double, dlat: Double , fAngle: Float, fDis: Float,isSmooth: Boolean,orders:Int, isCanCancel: Boolean, call:IResult){ + fun getCenterLineRange(dLon: Double, dlat: Double , fAngle: Float, fDis: Float,isSmooth: Boolean,orders:Int, isCanCancel: Boolean, call:IResult):String{ // Combine the four parameters into a single string as the cache key val cacheKey = "llaGetCenterLineRange_${dLon.toTenDecimalsStr()}_${dlat.toTenDecimalsStr()}_${fAngle.toTenDecimalsStr()}_${fDis.toTenDecimalsStr()}_${isSmooth}_${orders}_${RoadResultController.CANCELTAG}$isCanCancel" @@ -568,7 +589,7 @@ class RoadHelper private constructor() { // If yes, return the cached result centerLineCache.get(cacheKey)?.let { call.result(0,it) - return + return cacheKey } RoadResultController.instance.addRoadResultListener(cacheKey,object :IRoadData{ @@ -581,44 +602,48 @@ class RoadHelper private constructor() { return } result?.let { - val buf = ByteBufferHelper.bytes2ByteBuffer(result) - buf?.let { - val centerLine = CenterLine() - centerLine.id = buf.int.toString() - centerLine.tile_id = buf.int.toString() - centerLine.road_id = buf.int.toString() - centerLine.lane_id = buf.int.toString() - val size = buf.int - val points = ArrayList() - for (i in 0 until size step 2) { - val lonLatPoint = LonLatPoint(buf.long / 1e8, buf.long / 1e8) - points.add(lonLatPoint) - } - centerLine.points = points - val pMatch = LonLatPoint() - MapDataApi.GetDisFromPointToLine(LonLatPoint(dLon, dlat), points, pMatch, 1) - centerLine.angle = pMatch.angle - // Add the result to the cache - centerLineCache.put(cacheKey, centerLine) + CommonController.instance.scope?.launch(Dispatchers.IO){ + val buf = ByteBufferHelper.bytes2ByteBuffer(result) - if (CompileConfig.DEBUG) { - LogHelper.info( - TAG, - "roadop--getCenterLineRange--centerLine: $centerLine" - ) + buf?.let { + val centerLine = CenterLine() + centerLine.id = buf.int.toString() + centerLine.tile_id = buf.int.toString() + centerLine.road_id = buf.int.toString() + centerLine.lane_id = buf.int.toString() + val size = buf.int + val points = ArrayList() + for (i in 0 until size step 2) { + val lonLatPoint = LonLatPoint(buf.long / 1e8, buf.long / 1e8) + points.add(lonLatPoint) + } + centerLine.points = points + val pMatch = LonLatPoint() + MapDataApi.GetDisFromPointToLine(LonLatPoint(dLon, dlat), points, pMatch, 1) + centerLine.angle = pMatch.angle + // Add the result to the cache + centerLineCache.put(cacheKey, centerLine) + + if (CompileConfig.DEBUG) { + LogHelper.info( + TAG, + "roadop--getCenterLineRange--centerLine: $centerLine" + ) + } + withContext(Dispatchers.Main){ + call.result(0, centerLine) + } } - call.result(0, centerLine) - return } - } - call.result(1,null) + } } }) mapBox.llaGetCenterLineRange(dLon,dlat,fAngle, fDis,isSmooth,orders,isCanCancel) + return cacheKey } @@ -628,7 +653,7 @@ class RoadHelper private constructor() { //获取行驶方向一定长度的中心线 //dDis:正 行驶方向前方距离 负 行驶方向后方距离 - fun getCenterLineRoadNode(dLon: Double, dLat: Double, fAngle: Float, fDis: Float,isCanCancel: Boolean, call: IResult) { + fun getCenterLineRoadNode(dLon: Double, dLat: Double, fAngle: Float, fDis: Float,isCanCancel: Boolean, call: IResult):String { // Combine the four parameters into a single string as the cache key val start = System.currentTimeMillis() if (CompileConfig.DEBUG) { @@ -643,7 +668,7 @@ class RoadHelper private constructor() { Log.d(TAG, "Roam--op--status--getDataTime: ${cacheKey}, ${System.currentTimeMillis()-start}") } call.result(0,centerLineCache.get(cacheKey)) - return + return cacheKey } // If the result is not cached, calculate it @@ -686,10 +711,12 @@ class RoadHelper private constructor() { }) mapBox.llaGetCenterLineRoadNode(dLon, dLat, fAngle, fDis,isCanCancel) + return cacheKey } - fun getRoadName(dLon: Double, dLat: Double, fAngle: Float,call: IResult){ - RoadResultController.instance.addRoadResultListener("llaGetRoadName_${dLon.toTenDecimalsStr()}_${dLat.toTenDecimalsStr()}_${fAngle.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}false",object :IRoadData{ + fun getRoadName(dLon: Double, dLat: Double, fAngle: Float,isCanCancel: Boolean,call: IResult):String{ + val key = "llaGetRoadName_${dLon.toTenDecimalsStr()}_${dLat.toTenDecimalsStr()}_${fAngle.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}${isCanCancel}" + RoadResultController.instance.addRoadResultListener(key,object :IRoadData{ override fun result(code: Int, result: ByteArray?) { if (CompileConfig.DEBUG) { Log.d(TAG, "roadop--getRoadName--code:${code},result: $result") @@ -718,7 +745,8 @@ class RoadHelper private constructor() { } }) - mapBox.llaGetRoadName(dLon,dLat,fAngle,false) + mapBox.llaGetRoadName(dLon,dLat,fAngle,isCanCancel) + return key } @@ -728,13 +756,13 @@ class RoadHelper private constructor() { * 获取路口信息 */ - fun getCrossRoad(dLon: Double, dLat: Double, fAngle: Float,isCanCancel: Boolean, call: IResult) { + fun getCrossRoad(dLon: Double, dLat: Double, fAngle: Float,isCanCancel: Boolean, call: IResult) :String{ val cacheKey = "llaGetCrossRoad_${dLon.toTenDecimalsStr()}_${dLat.toTenDecimalsStr()}_${fAngle.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}$isCanCancel" // Check if the result is already in the cache crossRoadCache.get(cacheKey)?.let { call.result(0,it) - return + return cacheKey } // Otherwise, call the mapBox.llaGetCrossRoad function to get the result @@ -779,11 +807,13 @@ class RoadHelper private constructor() { }) mapBox.llaGetCrossRoad(dLon, dLat, fAngle,isCanCancel) + return cacheKey } - fun getCrossRoadById(tileId: Int, id: Long,call: IResult>){ - RoadResultController.instance.addRoadResultListener("llaGetCrossRoadById_${tileId}_${id}_${RoadResultController.CANCELTAG}false",object :IRoadData{ + fun getCrossRoadById(tileId: Int, id: Long,isCanCancel: Boolean,call: IResult>):String{ + val key = "llaGetCrossRoadById_${tileId}_${id}_${RoadResultController.CANCELTAG}${isCanCancel}" + RoadResultController.instance.addRoadResultListener(key,object :IRoadData{ override fun result(code: Int, result: ByteArray?) { if (CompileConfig.DEBUG) { Log.d(TAG, "roadop--getCrossRoadById--code:${code},result: $result") @@ -813,7 +843,8 @@ class RoadHelper private constructor() { } }) - mapBox.llaGetCrossRoadById(tileId,id) + mapBox.llaGetCrossRoadById(tileId,id,isCanCancel) + return key } @@ -823,8 +854,8 @@ class RoadHelper private constructor() { mapBox.initFileCacheByCity(lon, lat) } - fun cacheHDDataByCityLonLat(lon: Double, lat: Double,call: IResult){ - val key = "cacheHDDataByCityLonLat_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}false" + fun cacheHDDataByCityLonLat(lon: Double, lat: Double,isCanCancel: Boolean,call: IResult):String{ + val key = "cacheHDDataByCityLonLat_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}${isCanCancel}" RoadResultController.instance.addRoadResultListener(key,object :IRoadData{ override fun result(code: Int, result: ByteArray?) { @@ -847,10 +878,11 @@ class RoadHelper private constructor() { } }) - mapBox.cacheHDDataByCityLonLat(lon, lat) + mapBox.cacheHDDataByCityLonLat(lon, lat,isCanCancel) + return key } - fun cacheHDDataByCity(id: Int,isCanCancel: Boolean, call: IResult){ + private fun cacheHDDataResultByCity(id: Int,isCanCancel: Boolean, call: IResult):String{ val key = "cacheHDDataByCity_${id}_${RoadResultController.CANCELTAG}$isCanCancel" RoadResultController.instance.addRoadResultListener(key,object :IRoadData{ @@ -874,9 +906,10 @@ class RoadHelper private constructor() { } }) mapBox.cacheHDDataByCity(id,isCanCancel) + return key } - fun getCacheProgressByCity(id: Int,call: IResult){ + fun getCacheProgressByCity(id: Int,call: IResult):String{ val key = "getCacheProgressByCity_${id}" RoadResultController.instance.addRoadResultListener(key,object :IRoadData{ override fun result(code: Int, result: ByteArray?) { @@ -900,10 +933,11 @@ class RoadHelper private constructor() { }) mapBox.getCacheProgressByCity(id) + return key } - fun getCityCode(lon: Double, lat: Double, call: IResult){ - val key = "getCityCode_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}false" + fun getCityCode(lon: Double, lat: Double,isCanCancel: Boolean, call: IResult):String{ + val key = "getCityCode_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}${isCanCancel}" RoadResultController.instance.addRoadResultListener(key,object :IRoadData{ override fun result(code: Int, result: ByteArray?) { @@ -911,7 +945,7 @@ class RoadHelper private constructor() { Log.d(TAG, "roadop--getCityCode-${key}-code:${code},result: $result") } if (result?.isEmpty() == true) { - CityCodeModel.getCityCodeByLonLat(lon, lat, object : CityCodeResult{ + CityCodeModel.getCityCodeByLonLat(lon, lat, object : CityCodeResult { override fun result(code: Int, data: CityCodeInfo, message: String?) { if (CompileConfig.DEBUG) { Log.d(TAG, "roadop--getCityCode--code:${code},data: $data") @@ -931,7 +965,7 @@ class RoadHelper private constructor() { buf?.let { val cityCode = buf.int if(cityCode == 0){ - CityCodeModel.getCityCodeByLonLat(lon, lat, object : CityCodeResult{ + CityCodeModel.getCityCodeByLonLat(lon, lat, object : CityCodeResult { override fun result(code: Int, data: CityCodeInfo, message: String?) { if(code == 0){ if (CompileConfig.DEBUG) { @@ -957,7 +991,8 @@ class RoadHelper private constructor() { } }) - mapBox.getCityCode(lon, lat) + mapBox.getCityCode(lon, lat,isCanCancel) + return key } fun cancelCacheHDData() { @@ -968,14 +1003,18 @@ class RoadHelper private constructor() { mapBox.cancelCacheHDData() } - fun isCityDataCached(lon: Double,lat: Double,call: IResult){ - getCityCode(lon, lat,object : IResult { + fun removeRoadApiKey(key:String){ + RoadResultController.instance.removeRoadResultListener(key) + } + + fun isCityDataCached(lon: Double,lat: Double,isCanCancel: Boolean,call: IResult):String{ + val key = getCityCode(lon, lat,isCanCancel,object : IResult { override fun result(code: Int, id: Int?) { if(id == 0) { call.result(1,false) return } - getAllCityCode(object : IResult> { + getAllCityCode(isCanCancel,object : IResult> { override fun result(code: Int, result: ArrayList?) { if(result == null || result.size == 0){ call.result(1,false) @@ -994,10 +1033,11 @@ class RoadHelper private constructor() { } }) + return key } - fun getAllCityCode(call: IResult>) { - val key = "getAllCityCode_${RoadResultController.CANCELTAG}false" + fun getAllCityCode(isCanCancel: Boolean,call: IResult>):String { + val key = "getAllCityCode_${RoadResultController.CANCELTAG}${isCanCancel}" RoadResultController.instance.addRoadResultListener(key,object :IRoadData{ override fun result(code: Int, result: ByteArray?) { @@ -1037,11 +1077,12 @@ class RoadHelper private constructor() { } }) - mapBox.getAllCityCode() + mapBox.getAllCityCode(isCanCancel) + return key } - fun getHdDataVersionByCity(lon: Double,lat: Double,call: IResult){ - val key = "getHdDataVersionByCity_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}false" + fun getHdDataVersionByCity(lon: Double,lat: Double,isCanCancel: Boolean,call: IResult):String{ + val key = "getHdDataVersionByCity_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}${isCanCancel}" RoadResultController.instance.addRoadResultListener(key,object :IRoadData{ override fun result(code: Int, result: ByteArray?) { @@ -1066,11 +1107,13 @@ class RoadHelper private constructor() { call.result(1, null) } }) - mapBox.getHdDataVersionByCity(lon,lat) + mapBox.getHdDataVersionByCity(lon,lat,isCanCancel) + return key } - fun getZebraLineByDistance(dLon: Double, dLat: Double , fAngle: Float, dis: Float,call: IResult>){ - RoadResultController.instance.addRoadResultListener("llaGetZebraLineByDistance_${dLon.toTenDecimalsStr()}_${dLat.toTenDecimalsStr()}_${fAngle.toTenDecimalsStr()}_${dis.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}false",object :IRoadData{ + fun getZebraLineByDistance(dLon: Double, dLat: Double , fAngle: Float, dis: Float,isCanCancel: Boolean,call: IResult>):String{ + val key = "llaGetZebraLineByDistance_${dLon.toTenDecimalsStr()}_${dLat.toTenDecimalsStr()}_${fAngle.toTenDecimalsStr()}_${dis.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}${isCanCancel}" + RoadResultController.instance.addRoadResultListener(key,object :IRoadData{ override fun result(code: Int, result: ByteArray?) { if (CompileConfig.DEBUG) { Log.d(TAG, "roadop--getZebraLineByDistance--code:${code},result: $result") @@ -1112,13 +1155,14 @@ class RoadHelper private constructor() { } }) - mapBox.llaGetZebraLineByDistance(dLon,dLat,fAngle,dis) + mapBox.llaGetZebraLineByDistance(dLon,dLat,fAngle,dis,isCanCancel) + return key } private var mIsExecute: AtomicBoolean = AtomicBoolean(true) private var cacheList = CopyOnWriteArrayList() - fun cacheHDDataByCity(id: Int, listener: OnHdDataDownByCityListener){ + fun cacheHDDataByCity(id: Int, isCanCancel: Boolean,listener: OnHdDataDownByCityListener){ addHdDataDownListener(id,listener) if(id == 0) { dispatchHdDataDownStateListener(id, 0) @@ -1132,7 +1176,7 @@ class RoadHelper private constructor() { cancelCacheHDData() cacheList.add(id) - cacheHDDataByCity(id,false,object : IResult { + cacheHDDataResultByCity(id,isCanCancel,object : IResult { override fun result(code: Int, result: Boolean?) { mIsExecute.set(result?:false) if (CompileConfig.DEBUG) { @@ -1178,14 +1222,14 @@ class RoadHelper private constructor() { } - fun cacheHDDataByCityLonLat(lon: Double, lat: Double, listener: OnHdDataDownByCityListener){ + fun cacheHDDataByCityLonLat(lon: Double, lat: Double,isCanCancel: Boolean, listener: OnHdDataDownByCityListener){ if (TransformUtils.outOfChina(lat, lon)) { addHdDataDownListener(0,listener) dispatchHdDataDownStateListener(0, 0) removeHdDataDownListener(0) return } - getCityCode(lon, lat, object : IResult { + getCityCode(lon, lat,false, object : IResult { override fun result(code: Int, result: Int?) { if (result == 0) { addHdDataDownListener(0,listener) @@ -1197,7 +1241,7 @@ class RoadHelper private constructor() { Log.i(TAG, "cacheHDDataByCityLonLat--op--id: $result") } result?.let { - cacheHDDataByCity(result, listener) + cacheHDDataByCity(result, isCanCancel,listener) } } @@ -1250,13 +1294,13 @@ class RoadHelper private constructor() { } } - fun getRouteInfo(routeList : ArrayList , call:IResult){ + fun getRouteInfo(routeList : ArrayList , isCanCancel: Boolean,call:IResult):String{ var key = StringBuffer("llaGetRoutePath_") for(lonlat in routeList){ key.append("${lonlat.longitude.toTenDecimalsStr()}_${lonlat.latitude.toTenDecimalsStr()}_") } - key.append("${RoadResultController.CANCELTAG}false") + key.append("${RoadResultController.CANCELTAG}${isCanCancel}") RoadResultController.instance.addRoadResultListener(key.toString(),object :IRoadData{ override fun result(code: Int, result: ByteArray?) { if (CompileConfig.DEBUG) { @@ -1267,155 +1311,162 @@ class RoadHelper private constructor() { return } result?.let { - val buf = ByteBufferHelper.bytes2ByteBuffer(result) - buf?.let { - val routePath = RoutePath() - val list = ArrayList() - val size = buf.int - for(i in 0 until size){ - val routeStep = RouteStep() - routeStep.id = buf.long.toInt() - routeStep.tileId = buf.int - routeStep.type = buf.int - routeStep.name = ByteBufferHelper.buf2Str(buf)?:"" - routeStep.limitSpeed = buf.int - val routeLane = RouteLane() - routeLane.laneId = buf.int - routeLane.laneWidth = buf.long/1e8.toFloat() - val lonLatSize = buf.int - val lonlats = ArrayList() - for(j in 0 until lonLatSize step 2){ - val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8) - lonlats.add(lonLatPoint) - } - routeLane.lanePoints = lonlats - routeStep.lanes = routeLane - val crossSize = buf.int - val crossPoints = ArrayList() - for(k in 0 until crossSize step 2){ - val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8) - crossPoints.add(lonLatPoint) - } - routeStep.points = crossPoints - val stopLines = ArrayList() - val stopLines_size = buf.int - for(m in 0 until stopLines_size) { - val stopLine = RouteStopLine() - stopLine.length = buf.long / 1e8 - val stopSize = buf.int - val stopPoints = ArrayList() - for (l in 0 until stopSize step 2) { - val lonLatPoint = LonLatPoint(buf.long / 1e8, buf.long / 1e8) - stopPoints.add(lonLatPoint) - } - stopLine.stopLinePoints = stopPoints - stopLines.add(stopLine) - } - routeStep.stopLine = stopLines - - var zebraLines = ArrayList() - val zebraLine_size = buf.int - for(m in 0 until zebraLine_size){ - val routeZebraLine = RouteZebraLine() - routeZebraLine.id = buf.int - routeZebraLine.dis = buf.long/1e8.toFloat() - val zebraLine_pts = buf.int - val zebraLinePoints = ArrayList() - for(n in 0 until zebraLine_pts step 2){ + CommonController.instance.scope?.launch(Dispatchers.IO) { + val buf = ByteBufferHelper.bytes2ByteBuffer(result) + buf?.let { + val routePath = RoutePath() + val list = ArrayList() + val size = buf.int + for(i in 0 until size){ + val routeStep = RouteStep() + routeStep.id = buf.long.toInt() + routeStep.tileId = buf.int + routeStep.type = buf.int + routeStep.name = ByteBufferHelper.buf2Str(buf)?:"" + routeStep.limitSpeed = buf.int + val routeLane = RouteLane() + routeLane.laneId = buf.int + routeLane.laneWidth = buf.long/1e8.toFloat() + val lonLatSize = buf.int + val lonlats = ArrayList() + for(j in 0 until lonLatSize step 2){ val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8) - zebraLinePoints.add(lonLatPoint) + lonlats.add(lonLatPoint) } - routeZebraLine.zebraLinePoints = zebraLinePoints - zebraLines.add(routeZebraLine) - } - routeStep.zebraLines = zebraLines - - var trafficLights = ArrayList() - val trafficLight_size = buf.int - for(o in 0 until trafficLight_size){ - val routeTrafficLight = RouteTrafficLight() - routeTrafficLight.id = buf.int - routeTrafficLight.type = buf.int - routeTrafficLight.shape = buf.int - val trafficLight_pts = buf.int - val trafficLightPoints = ArrayList() - for(p in 0 until trafficLight_pts step 2){ + routeLane.lanePoints = lonlats + routeStep.lanes = routeLane + val crossSize = buf.int + val crossPoints = ArrayList() + for(k in 0 until crossSize step 2){ val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8) - trafficLightPoints.add(lonLatPoint) + crossPoints.add(lonLatPoint) } - routeTrafficLight.trafficLightPoints = trafficLightPoints - trafficLights.add(routeTrafficLight) - } - routeStep.trafficLights = trafficLights - - var cameras = ArrayList() - val camera_size = buf.int - for(q in 0 until camera_size){ - val routeCamera = RouteCamera() - routeCamera.id = buf.int - routeCamera.type = buf.int - routeCamera.shape = buf.int - val camera_pts = buf.int - val cameraPoints = ArrayList() - for(r in 0 until camera_pts step 2){ - val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8) - cameraPoints.add(lonLatPoint) + routeStep.points = crossPoints + val stopLines = ArrayList() + val stopLines_size = buf.int + for(m in 0 until stopLines_size) { + val stopLine = RouteStopLine() + stopLine.length = buf.long / 1e8 + val stopSize = buf.int + val stopPoints = ArrayList() + for (l in 0 until stopSize step 2) { + val lonLatPoint = LonLatPoint(buf.long / 1e8, buf.long / 1e8) + stopPoints.add(lonLatPoint) + } + stopLine.stopLinePoints = stopPoints + stopLines.add(stopLine) } - routeCamera.cameraPoints = cameraPoints - cameras.add(routeCamera) - } - routeStep.cameras = cameras + routeStep.stopLine = stopLines - var rsus = ArrayList() - val rsu_size = buf.int - for(s in 0 until rsu_size){ - val routeRsu = RouteRsu() - routeRsu.id = buf.long.toInt() - routeRsu.type = buf.int - routeRsu.shape = buf.int - val routeRsu_pts = buf.int - val routeRsuPoints = ArrayList() - for(t in 0 until routeRsu_pts step 2){ - val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8) - routeRsuPoints.add(lonLatPoint) + var zebraLines = ArrayList() + val zebraLine_size = buf.int + for(m in 0 until zebraLine_size){ + val routeZebraLine = RouteZebraLine() + routeZebraLine.id = buf.int + routeZebraLine.dis = buf.long/1e8.toFloat() + val zebraLine_pts = buf.int + val zebraLinePoints = ArrayList() + for(n in 0 until zebraLine_pts step 2){ + val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8) + zebraLinePoints.add(lonLatPoint) + } + routeZebraLine.zebraLinePoints = zebraLinePoints + zebraLines.add(routeZebraLine) } - routeRsu.rsuPoints = routeRsuPoints - rsus.add(routeRsu) - } - routeStep.rsus = rsus - list.add(routeStep) - } + routeStep.zebraLines = zebraLines - if(list.isNotEmpty()){ - routePath.steps = list - if (CompileConfig.DEBUG) { - Log.d(TAG, "roadop--getRouteInfo--routePath:${routePath}") + var trafficLights = ArrayList() + val trafficLight_size = buf.int + for(o in 0 until trafficLight_size){ + val routeTrafficLight = RouteTrafficLight() + routeTrafficLight.id = buf.int + routeTrafficLight.type = buf.int + routeTrafficLight.shape = buf.int + val trafficLight_pts = buf.int + val trafficLightPoints = ArrayList() + for(p in 0 until trafficLight_pts step 2){ + val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8) + trafficLightPoints.add(lonLatPoint) + } + routeTrafficLight.trafficLightPoints = trafficLightPoints + trafficLights.add(routeTrafficLight) + } + routeStep.trafficLights = trafficLights + + var cameras = ArrayList() + val camera_size = buf.int + for(q in 0 until camera_size){ + val routeCamera = RouteCamera() + routeCamera.id = buf.int + routeCamera.type = buf.int + routeCamera.shape = buf.int + val camera_pts = buf.int + val cameraPoints = ArrayList() + for(r in 0 until camera_pts step 2){ + val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8) + cameraPoints.add(lonLatPoint) + } + routeCamera.cameraPoints = cameraPoints + cameras.add(routeCamera) + } + routeStep.cameras = cameras + + var rsus = ArrayList() + val rsu_size = buf.int + for(s in 0 until rsu_size){ + val routeRsu = RouteRsu() + routeRsu.id = buf.long.toInt() + routeRsu.type = buf.int + routeRsu.shape = buf.int + val routeRsu_pts = buf.int + val routeRsuPoints = ArrayList() + for(t in 0 until routeRsu_pts step 2){ + val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8) + routeRsuPoints.add(lonLatPoint) + } + routeRsu.rsuPoints = routeRsuPoints + rsus.add(routeRsu) + } + routeStep.rsus = rsus + list.add(routeStep) + } + + if(list.isNotEmpty()){ + routePath.steps = list + if (CompileConfig.DEBUG) { + Log.d(TAG, "roadop--getRouteInfo--routePath:${routePath}") + } + withContext(Dispatchers.Main){ + call.result(0, routePath) + } } - call.result(0, routePath) - return } } + + }?:{ + call.result(1,null) } - call.result(1,null) + } }) val data = MapTools.listToArray(routeList,false) try { - mapBox.llaGetRoutePath(data) + mapBox.llaGetRoutePath(data,isCanCancel) }catch (e: Exception){ if (CompileConfig.DEBUG) { Log.e(TAG, e.toString()) } } + return key.toString() } - fun isInRoadSideFenceRegion(lon: Double, lat: Double, call: IResult){ + fun isInRoadSideFenceRegion(lon: Double, lat: Double,isCanCancel: Boolean, call: IResult):String{ val time = System.currentTimeMillis() - val key = "isInRoadSideFenceRegion_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}false" + val key = "isInRoadSideFenceRegion_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}${isCanCancel}" RoadResultController.instance.addRoadResultListener(key,object :IRoadData{ override fun result(code: Int, result: ByteArray?) { @@ -1439,7 +1490,8 @@ class RoadHelper private constructor() { call.result(code,0) } }) - mapBox.isInRoadSideFenceRegion(lon, lat) + mapBox.isInRoadSideFenceRegion(lon, lat,isCanCancel) + return key } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/road/RoadResultController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/road/RoadResultController.kt index 045bbbe772..00a99d8c29 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/road/RoadResultController.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/road/RoadResultController.kt @@ -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: ") diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/search/GeocoderSearchHelper.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/search/GeocoderSearchHelper.kt index 2a7b95dc32..54899f1dd1 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/search/GeocoderSearchHelper.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/search/GeocoderSearchHelper.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/search/InputSearchHelper.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/search/InputSearchHelper.kt index 655ac3ace5..b4d6531103 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/search/InputSearchHelper.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/search/InputSearchHelper.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/search/SearchHelper.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/search/SearchHelper.kt index fb18b9168f..c1749432c7 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/search/SearchHelper.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/search/SearchHelper.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/use/Clerk.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/use/Clerk.kt index 9b3facb18b..f652e4be8e 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/use/Clerk.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/use/Clerk.kt @@ -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? + fun getFromLocationName(geocodeQuery: com.zhidaoauto.map.sdk.open.logics.query.GeocodeQuery?): List? - 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?) } \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/abs/search/IInputtipsSearch.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/abs/search/IInputtipsSearch.kt index 99dcc9d724..a482d7f371 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/abs/search/IInputtipsSearch.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/abs/search/IInputtipsSearch.kt @@ -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() diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/abs/search/IPoiSearch.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/abs/search/IPoiSearch.kt index d6db44b34a..9838bbae68 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/abs/search/IPoiSearch.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/abs/search/IPoiSearch.kt @@ -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?) diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/BaseDialog.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/BaseDialog.kt similarity index 94% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/BaseDialog.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/BaseDialog.kt index 8e1f7dc8d7..8920c6c933 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/BaseDialog.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/BaseDialog.kt @@ -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() {} diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/BindView.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/BindView.kt similarity index 67% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/BindView.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/BindView.kt index cd267b6d16..b0a0872cbd 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/BindView.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/BindView.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.dialog +package com.zhidaoauto.map.sdk.open.common.dialog import android.view.View diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/BlurView.java b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/BlurView.java similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/BlurView.java rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/BlurView.java index 745cee3c84..f73a03ec88 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/BlurView.java +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/BlurView.java @@ -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); } } \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/CustomDialog.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/CustomDialog.kt similarity index 97% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/CustomDialog.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/CustomDialog.kt index 48263a1d31..50d38816e0 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/CustomDialog.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/CustomDialog.kt @@ -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{ diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/DialogHelper.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/DialogHelper.kt similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/DialogHelper.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/DialogHelper.kt index ba29555680..65c026c216 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/DialogHelper.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/DialogHelper.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/DialogLifeCycleListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/DialogLifeCycleListener.kt similarity index 76% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/DialogLifeCycleListener.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/DialogLifeCycleListener.kt index d6d984ecc4..4cc63abcae 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/DialogLifeCycleListener.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/DialogLifeCycleListener.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.dialog +package com.zhidaoauto.map.sdk.open.common.dialog import android.app.Dialog diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/DialogSettings.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/DialogSettings.kt similarity index 97% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/DialogSettings.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/DialogSettings.kt index 44e006efd8..0f5a32e195 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/DialogSettings.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/DialogSettings.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/InputDialog.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/InputDialog.kt similarity index 99% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/InputDialog.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/InputDialog.kt index 4bcf2ad322..805e08f259 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/InputDialog.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/InputDialog.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/InputDialogOkButtonClickListener.java b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/InputDialogOkButtonClickListener.java similarity index 72% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/InputDialogOkButtonClickListener.java rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/InputDialogOkButtonClickListener.java index 03151f68c8..01b46a60c7 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/InputDialogOkButtonClickListener.java +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/InputDialogOkButtonClickListener.java @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.dialog; +package com.zhidaoauto.map.sdk.open.common.dialog; import android.app.Dialog; diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/InputInfo.java b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/InputInfo.java similarity index 92% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/InputInfo.java rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/InputInfo.java index 8380ef8c77..b100d8711f 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/InputInfo.java +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/InputInfo.java @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.dialog; +package com.zhidaoauto.map.sdk.open.common.dialog; import android.text.InputType; diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/OnBackPressListener.java b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/OnBackPressListener.java similarity index 70% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/OnBackPressListener.java rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/OnBackPressListener.java index ca20bdc6f9..fa8b51c57b 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/OnBackPressListener.java +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/OnBackPressListener.java @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.dialog; +package com.zhidaoauto.map.sdk.open.common.dialog; import android.app.AlertDialog; diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/OnDismissListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/OnDismissListener.kt similarity index 80% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/OnDismissListener.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/OnDismissListener.kt index 653d0a1f91..896b418fe5 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/OnDismissListener.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/OnDismissListener.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.dialog +package com.zhidaoauto.map.sdk.open.common.dialog /** * Author: @Kongzue diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/ProgressView.java b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/ProgressView.java similarity index 99% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/ProgressView.java rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/ProgressView.java index bbf03ce6fe..3a93a98266 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/ProgressView.java +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/ProgressView.java @@ -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; diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/TextInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/TextInfo.kt similarity index 94% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/TextInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/TextInfo.kt index b660af6930..93b7c24a57 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/TextInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/TextInfo.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/TipDialog.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/TipDialog.kt similarity index 97% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/TipDialog.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/TipDialog.kt index f325757a3b..9ab7a4bd63 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/TipDialog.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/TipDialog.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/WaitDialog.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/WaitDialog.kt similarity index 97% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/WaitDialog.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/WaitDialog.kt index 6eb1b5a834..fc9a16b0d5 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/dialog/WaitDialog.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/dialog/WaitDialog.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/exception/MapException.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/exception/MapException.kt similarity index 99% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/exception/MapException.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/exception/MapException.kt index 6c27fecd6d..dfe752bfa2 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/exception/MapException.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/exception/MapException.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/exception/NotImplementException.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/exception/NotImplementException.kt similarity index 74% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/exception/NotImplementException.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/exception/NotImplementException.kt index 56d1693d09..1752b8b32d 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/exception/NotImplementException.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/exception/NotImplementException.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.exception +package com.zhidaoauto.map.sdk.open.common.exception /** * 当前未实现的异常 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/exception/RuntimeRemoteException.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/exception/RuntimeRemoteException.kt similarity index 58% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/exception/RuntimeRemoteException.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/exception/RuntimeRemoteException.kt index e10b30082b..1bbd0a2c5c 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/exception/RuntimeRemoteException.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/exception/RuntimeRemoteException.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.exception +package com.zhidaoauto.map.sdk.open.common.exception class RuntimeRemoteException(exception: Throwable) : RuntimeException() { } \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/BitmapTools.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/BitmapTools.kt similarity index 82% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/BitmapTools.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/BitmapTools.kt index de6ee2075d..8c474df41c 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/BitmapTools.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/BitmapTools.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/MD5Utils.java b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/MD5Utils.java similarity index 83% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/MD5Utils.java rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/MD5Utils.java index a54e3bce29..31f2e462d1 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/MD5Utils.java +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/MD5Utils.java @@ -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)){ diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/MapTools.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/MapTools.kt similarity index 99% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/MapTools.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/MapTools.kt index 956e29fd73..619dcb1e2f 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/MapTools.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/MapTools.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/MonitorPressApi.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/MonitorPressApi.kt similarity index 97% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/MonitorPressApi.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/MonitorPressApi.kt index 50b8650ba7..d7d16a9caf 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/MonitorPressApi.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/MonitorPressApi.kt @@ -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()) } } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/RecorderUtils.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/RecorderUtils.kt similarity index 99% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/RecorderUtils.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/RecorderUtils.kt index 0cab5f1d63..6761d3387d 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/RecorderUtils.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/RecorderUtils.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/TaskManager.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/TaskManager.kt similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/TaskManager.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/TaskManager.kt index ce9bf7ebb6..7772540c23 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/TaskManager.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/TaskManager.kt @@ -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 { override fun result(code: Int, result: CenterLine?) { } - }) - RoadHelper.getInstance()?.getCenterLineRoadNode( + },true) + MapDataApi.getCenterLineRoadNode( lonlatPoint.latitude, lonlatPoint.latitude, lonlatPoint.angle.toFloat(), 300f, - true, object : IResult { 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 { 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 { 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> { + MapDataApi.getAllCityCode(object : IResult> { override fun result(code: Int, result: ArrayList?) { } - }) + },true) } fun monitorGetAllCityCode(tv: TextView) { - RoadHelper.getInstance()?.getAllCityCode(object : IResult> { + MapDataApi.getAllCityCode(object : IResult> { override fun result(code: Int, result: ArrayList?) { 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 { 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 { 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() val currentLineList = CopyOnWriteArrayList() - 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)) { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/ThreadPoolUtils.java b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/ThreadPoolUtils.java similarity index 92% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/ThreadPoolUtils.java rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/ThreadPoolUtils.java index 4133a09f37..4adf18d08f 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/ThreadPoolUtils.java +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/ThreadPoolUtils.java @@ -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; diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/VisibleRegion.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/VisibleRegion.kt similarity index 83% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/VisibleRegion.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/VisibleRegion.kt index 99f432a3dc..3f38a712e8 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/tools/VisibleRegion.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/common/tools/VisibleRegion.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/data/MapDataApi.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/data/MapDataApi.kt index 6f2c99e798..dff2435656 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/data/MapDataApi.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/data/MapDataApi.kt @@ -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 -// 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 + for (info in runningServices) { + if (info.service.className == ServiceName) { + return true + } + } return false } - - /** * 获取道路关键点数据 * + * @param lonLatPoints 道路上的经纬度点列表 + * @param bGetAllPoints 是否获取所有关键点 + * @return 匹配的关键点列表 */ - fun getMatchRoadInfo( - lonLatPoints: List, - bGetAllPoints: Boolean - ): List? { + fun getMatchRoadInfo(lonLatPoints: List, bGetAllPoints: Boolean): List? { 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? { Recorder.add("roadop-getLimitSpeed:$tileId,$routeId") return RoadHelper.getInstance()?.getLaneInfo(tileId, routeId) } - // 获取点到线段的距离 - fun GetDisFromPointToLine( ptOrg:LonLatPoint, pLine:ArrayList, ptMatch:LonLatPoint, nSegmentOrder:Int):Double { + /** + * 获取点到线段的距离 + * + * @param ptOrg 原始点 + * @param pLine 线段的点列表 + * @param ptMatch 匹配点 + * @param nSegmentOrder 线段的序号 + * @return 点到线段的距离 + */ + fun GetDisFromPointToLine(ptOrg: LonLatPoint, pLine: ArrayList, 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){ + /** + * 获取限速接口 + * + * @param lon 经度 + * @param lat 纬度 + * @param angle 航向角 + * @param call 结果回调 + * @param isCanCancel 是否允许取消操作 + * @return 操作结果的字符串 + */ + fun getLimitSpeed(lon: Double, lat: Double, angle: Float, call: IResult, 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) { + fun getStopLineInfo(lon: Double, lat: Double, angle: Float, call: IResult, 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) { + fun getCenterLineRangeInfo(lon: Double, lat: Double, angle: Float, dis: Float, isSmooth: Boolean, orders: Int, call: IResult, 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){ + fun getCenterLineRoadNode(lon: Double, lat: Double, angle: Float, dis: Float, call: IResult, 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){ + /** + * 获取道路名称信息 + * + * @param lon 经度 + * @param lat 纬度 + * @param angle 航向角 + * @param call 结果回调 + * @param isCanCancel 是否允许取消操作 + * @return 操作结果的字符串 + */ + fun getRoadName(lon: Double, lat: Double, angle: Float, call: IResult, 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){ + fun getCrossRoad(dLon: Double, dLat: Double, fAngle: Float, call: IResult, 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>){ - 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>, 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) { - RoadHelper.getInstance()?.getRoadRect(lon, lat, angle,call) + fun getRoadRectInfo(lon: Double, lat: Double, angle: Float, call: IResult, 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) { + fun getCenterLineInfo(lon: Double, lat: Double, angle: Float, call: IResult, 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>){ + /** + * 根据距离获取斑马线信息 + * + * @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>, 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, lineOther: ArrayList): Pair { return MathUtils.getIntersection(lineSelf, lineOther) } - //获取动态线 - fun getDynamicLinePoints(centerLonLatPoint: LonLatPoint, pointList: MutableList): MutableList?{ + + /** + * 获取动态线上的点 + * + * @param centerLonLatPoint 动态线的中心点 + * @param pointList 线上的点列表 + * @return 动态线上的最近点列表 + */ + fun getDynamicLinePoints(centerLonLatPoint: LonLatPoint, pointList: MutableList): MutableList? { 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>){ - if(CompileConfig.DEBUG){ + fun getAllCityCode(call: IResult>, 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){ - if(CompileConfig.DEBUG){ + /** + * 根据经纬度获取城市编码 + * + * @param lon 经度 + * @param lat 纬度 + * @param call 结果回调 + * @param isCanCancel 是否允许取消操作 + * @return 操作结果的字符串 + */ + fun getCityCode(lon: Double, lat: Double, call: IResult, 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){ - if(CompileConfig.DEBUG){ + /** + * 判断城市数据是否已缓存 + * + * @param lon 经度 + * @param lat 纬度 + * @param call 结果回调 + * @param isCanCancel 是否允许取消操作 + * @return 操作结果的字符串 + */ + fun isCacheCity(lon: Double, lat: Double, call: IResult, 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){ - if(CompileConfig.DEBUG){ + fun getHdDataVersionByCity(lon: Double, lat: Double, call: IResult, 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){ - RoadHelper.getInstance()?.isInRoadSideFenceRegion(lon,lat, call) + /** + * 判断点是否在道路边界围栏区域内 + * + * @param lon 经度 + * @param lat 纬度 + * @param call 结果回调 + * @param isCanCancel 是否允许取消操作 + * @return 操作结果的字符串 + */ + fun isInRoadSideFenceRegion(lon: Double, lat: Double, call: IResult, isCanCancel: Boolean = false): String? { + return RoadHelper.getInstance()?.isInRoadSideFenceRegion(lon, lat, isCanCancel, call) } - - fun getRouteInfo(routeList : ArrayList,call:IResult ){ - RoadHelper.getInstance()?.getRouteInfo(routeList,call) + /** + * 获取路线信息 + * + * @param routeList 路线点列表 + * @param call 结果回调 + * @param isCanCancel 是否允许取消操作 + * @return 操作结果的字符串 + */ + fun getRouteInfo(routeList: ArrayList, call: IResult, 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, 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, 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) + } + + diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/business/DeadZoneHelper.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/helpers/DeadZoneHelper.kt similarity index 94% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/business/DeadZoneHelper.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/helpers/DeadZoneHelper.kt index 60532dcbd2..aa8e44f145 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/business/DeadZoneHelper.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/helpers/DeadZoneHelper.kt @@ -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 { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/business/PointCloudHelper.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/helpers/PointCloudHelper.kt similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/business/PointCloudHelper.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/helpers/PointCloudHelper.kt index bee361237e..a79f1408a9 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/business/PointCloudHelper.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/helpers/PointCloudHelper.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/LogLevels.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/LogLevels.kt similarity index 72% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/LogLevels.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/LogLevels.kt index 006130fae1..30775e11a4 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/LogLevels.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/LogLevels.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open +package com.zhidaoauto.map.sdk.open.logics enum class LogLevels( val type: Int diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/CameraPosition.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/CameraPosition.kt similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/CameraPosition.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/CameraPosition.kt index 4d748d2801..53dd435867 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/CameraPosition.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/CameraPosition.kt @@ -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) } } } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/CameraUpdate.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/CameraUpdate.kt similarity index 58% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/CameraUpdate.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/CameraUpdate.kt index 074809c6e2..30140cb60b 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/CameraUpdate.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/CameraUpdate.kt @@ -1,3 +1,3 @@ -package com.zhidaoauto.map.sdk.open.camera +package com.zhidaoauto.map.sdk.open.logics.camera class CameraUpdate(val cameraUpdateFactoryDelegate: MapCameraMessage) \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/CameraUpdateFactory.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/CameraUpdateFactory.kt similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/CameraUpdateFactory.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/CameraUpdateFactory.kt index e230439dc1..357d3db6ef 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/CameraUpdateFactory.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/CameraUpdateFactory.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/LatLngBounds.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/LatLngBounds.kt similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/LatLngBounds.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/LatLngBounds.kt index cfa3f36e07..eb33d120be 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/LatLngBounds.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/LatLngBounds.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/MapCameraMessage.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/MapCameraMessage.kt similarity index 93% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/MapCameraMessage.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/MapCameraMessage.kt index 4e9b8f3ca8..8d5b29dd5a 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/camera/MapCameraMessage.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/camera/MapCameraMessage.kt @@ -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 } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/circle/CircleController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/circle/CircleController.kt similarity index 87% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/circle/CircleController.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/circle/CircleController.kt index 5855f18370..4f9be3fcb8 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/circle/CircleController.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/circle/CircleController.kt @@ -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 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/circle/CircleOptions.java b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/circle/CircleOptions.java similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/circle/CircleOptions.java rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/circle/CircleOptions.java index 73f7751787..8851aa5ee0 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/circle/CircleOptions.java +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/circle/CircleOptions.java @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.circle; +package com.zhidaoauto.map.sdk.open.logics.circle; import com.zhidaoauto.map.data.point.LonLatPoint; diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/CityCode.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/city/CityCode.kt similarity index 87% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/CityCode.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/city/CityCode.kt index eb423a10c2..9448d22371 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/CityCode.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/city/CityCode.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open +package com.zhidaoauto.map.sdk.open.logics.city enum class CityCode( val type: Int diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/city/CityCodeInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/city/CityCodeInfo.kt similarity index 88% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/city/CityCodeInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/city/CityCodeInfo.kt index 590d102927..c3ee9fc17c 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/city/CityCodeInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/city/CityCodeInfo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.city +package com.zhidaoauto.map.sdk.open.logics.city class CityCodeInfo { val id:Int = 0// 城市主键 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/city/CityCodeResult.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/city/CityCodeResult.kt similarity index 65% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/city/CityCodeResult.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/city/CityCodeResult.kt index a4da9a6d1e..bf9f0174f8 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/city/CityCodeResult.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/city/CityCodeResult.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.city +package com.zhidaoauto.map.sdk.open.logics.city interface CityCodeResult { fun result(code:Int, data: CityCodeInfo, message: String?) diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/deadzone/DeadZone.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/deadzone/DeadZone.kt similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/deadzone/DeadZone.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/deadzone/DeadZone.kt index 5489034101..aa79f6f690 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/deadzone/DeadZone.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/deadzone/DeadZone.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.deadzone +package com.zhidaoauto.map.sdk.open.logics.deadzone import android.util.Log import com.alibaba.fastjson.JSON diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/deadzone/DeadZoneOptions.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/deadzone/DeadZoneOptions.kt similarity index 86% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/deadzone/DeadZoneOptions.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/deadzone/DeadZoneOptions.kt index 7db12e4bfa..aad1233094 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/deadzone/DeadZoneOptions.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/deadzone/DeadZoneOptions.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.deadzone +package com.zhidaoauto.map.sdk.open.logics.deadzone import com.autonavi.nge.map.LonLat import com.zhidaoauto.map.data.point.LonLatPoint @@ -27,7 +27,7 @@ class DeadZoneOptions { this.id = UUID.randomUUID().toString() } - fun setPosition(list:List?):DeadZoneOptions{ + fun setPosition(list:List?): DeadZoneOptions { list?.let { try { val lonLats = ArrayList() @@ -55,7 +55,7 @@ class DeadZoneOptions { } - fun setGps(gps:Boolean):DeadZoneOptions{ + fun setGps(gps:Boolean): DeadZoneOptions { this.isGps = gps return this } @@ -64,7 +64,7 @@ class DeadZoneOptions { return isGps } - fun setVisible(visible:Boolean):DeadZoneOptions{ + fun setVisible(visible:Boolean): DeadZoneOptions { this.visible = visible return this } @@ -73,7 +73,7 @@ class DeadZoneOptions { return visible } - fun setId(id:String):DeadZoneOptions{ + fun setId(id:String): DeadZoneOptions { this.id = id return this } @@ -82,7 +82,7 @@ class DeadZoneOptions { return id } - fun setColor(color:Int):DeadZoneOptions{ + fun setColor(color:Int): DeadZoneOptions { this.color = color return this } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/location/LocationClient.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/location/LocationClient.kt similarity index 99% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/location/LocationClient.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/location/LocationClient.kt index e3f98bf47d..43ecb45ece 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/location/LocationClient.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/location/LocationClient.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.location +package com.zhidaoauto.map.sdk.open.logics.location import android.Manifest import android.content.Context diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/location/MogoLocation.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/location/MogoLocation.kt similarity index 95% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/location/MogoLocation.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/location/MogoLocation.kt index 0ec364fa5d..4175c450b4 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/location/MogoLocation.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/location/MogoLocation.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.location +package com.zhidaoauto.map.sdk.open.logics.location import java.io.Serializable @@ -37,7 +37,7 @@ class MogoLocation: Serializable { } - fun copy():MogoLocation{ + fun copy(): MogoLocation { val mogoLocation = MogoLocation() mogoLocation.satelliteTime = satelliteTime mogoLocation.speed = speed diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/location/MyLocationStyle.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/location/MyLocationStyle.kt similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/location/MyLocationStyle.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/location/MyLocationStyle.kt index b1fbe14624..003b407bde 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/location/MyLocationStyle.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/location/MyLocationStyle.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.location +package com.zhidaoauto.map.sdk.open.logics.location import android.content.Context import android.graphics.Bitmap @@ -14,8 +14,8 @@ import com.zhidaoauto.map.sdk.inner.abs.IMarkerController import com.zhidaoauto.map.sdk.inner.utils.BitmapUtils import com.zhidaoauto.map.sdk.inner.utils.TransformUtils import com.zhidaoauto.map.sdk.open.abs.view.IMapStyleParams -import com.zhidaoauto.map.sdk.open.marker.Marker -import com.zhidaoauto.map.sdk.open.marker.MarkerOptions +import com.zhidaoauto.map.sdk.open.renders.marker.Marker +import com.zhidaoauto.map.sdk.open.renders.marker.MarkerOptions import java.util.concurrent.atomic.AtomicBoolean class MyLocationStyle( diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/location/RTKAutopilotLocationBean.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/location/RTKAutopilotLocationBean.kt similarity index 97% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/location/RTKAutopilotLocationBean.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/location/RTKAutopilotLocationBean.kt index 3de9401763..1c6aeef7bc 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/location/RTKAutopilotLocationBean.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/location/RTKAutopilotLocationBean.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.location +package com.zhidaoauto.map.sdk.open.logics.location import com.alibaba.fastjson.annotation.JSONField import java.io.Serializable diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/BroadcastMode.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/BroadcastMode.kt similarity index 74% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/BroadcastMode.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/BroadcastMode.kt index 2ee9d5cdbd..1ef7eb2931 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/BroadcastMode.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/BroadcastMode.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav +package com.zhidaoauto.map.sdk.open.logics.nav /** * 语音播报模式 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/INavi.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/INavi.kt similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/INavi.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/INavi.kt index 55d066b8ed..14e9aa409a 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/INavi.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/INavi.kt @@ -1,15 +1,15 @@ -package com.zhidaoauto.map.sdk.open.nav +package com.zhidaoauto.map.sdk.open.logics.nav import android.location.Location import com.zhidaoauto.map.data.point.LonLatPoint -import com.zhidaoauto.map.sdk.open.nav.abs.AimlessModeListener -import com.zhidaoauto.map.sdk.open.nav.abs.NaviListener -import com.zhidaoauto.map.sdk.open.nav.abs.ParallelRoadListener -import com.zhidaoauto.map.sdk.open.nav.model.NaviCarInfo -import com.zhidaoauto.map.sdk.open.nav.model.NaviOnlineCarHailingType -import com.zhidaoauto.map.sdk.open.nav.model.NaviPath -import com.zhidaoauto.map.sdk.open.nav.model.NaviSetting -import com.zhidaoauto.map.sdk.open.nav.model.TrafficStatus +import com.zhidaoauto.map.sdk.open.logics.nav.abs.AimlessModeListener +import com.zhidaoauto.map.sdk.open.logics.nav.abs.NaviListener +import com.zhidaoauto.map.sdk.open.logics.nav.abs.ParallelRoadListener +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviCarInfo +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviOnlineCarHailingType +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviPath +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviSetting +import com.zhidaoauto.map.sdk.open.logics.nav.model.TrafficStatus interface INavi { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NavAutoHelper.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NavAutoHelper.kt similarity index 81% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NavAutoHelper.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NavAutoHelper.kt index 6171591108..464a40ebe9 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NavAutoHelper.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NavAutoHelper.kt @@ -1,20 +1,20 @@ -package com.zhidaoauto.map.sdk.open.nav +package com.zhidaoauto.map.sdk.open.logics.nav import android.location.Location import android.util.Log import com.zhidaoauto.map.data.point.LonLatPoint import com.zhidaoauto.map.sdk.inner.CompileConfig import com.zhidaoauto.map.sdk.inner.proxy.CommonProxy -import com.zhidaoauto.map.sdk.open.nav.abs.AimlessModeListener -import com.zhidaoauto.map.sdk.open.nav.abs.NaviListener -import com.zhidaoauto.map.sdk.open.nav.abs.ParallelRoadListener -import com.zhidaoauto.map.sdk.open.nav.model.NaviCarInfo -import com.zhidaoauto.map.sdk.open.nav.model.NaviOnlineCarHailingType -import com.zhidaoauto.map.sdk.open.nav.model.NaviPath -import com.zhidaoauto.map.sdk.open.nav.model.NaviSetting -import com.zhidaoauto.map.sdk.open.nav.model.TrafficStatus +import com.zhidaoauto.map.sdk.open.logics.nav.abs.AimlessModeListener +import com.zhidaoauto.map.sdk.open.logics.nav.abs.NaviListener +import com.zhidaoauto.map.sdk.open.logics.nav.abs.ParallelRoadListener +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviCarInfo +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviOnlineCarHailingType +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviPath +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviSetting +import com.zhidaoauto.map.sdk.open.logics.nav.model.TrafficStatus -class NavAutoHelper : INavi { +class NavAutoHelper : com.zhidaoauto.map.sdk.open.logics.nav.INavi { private val TAG = javaClass.simpleName @@ -30,22 +30,33 @@ class NavAutoHelper : INavi { } override fun strategyConvert(avoidCongestion: Boolean, avoidHighway: Boolean, avoidCost: Boolean, prioritiseHighway: Boolean, multipleRoute: Boolean): Int { - var strategy: Int = PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_DEFAULT + var strategy: Int = + com.zhidaoauto.map.sdk.open.logics.nav.PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_DEFAULT try { when (((if (avoidCongestion) "1" else "0") + (if (avoidHighway) "1" else "0") + (if (avoidCost) "1" else "0") + if (prioritiseHighway) "1" else "0").toInt()) { - 0 -> strategy = PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_DEFAULT - 1 -> strategy = PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_PRIORITY_HIGHSPEED - 10 -> strategy = PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_AVOID_COST + 0 -> strategy = + com.zhidaoauto.map.sdk.open.logics.nav.PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_DEFAULT + 1 -> strategy = + com.zhidaoauto.map.sdk.open.logics.nav.PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_PRIORITY_HIGHSPEED + 10 -> strategy = + com.zhidaoauto.map.sdk.open.logics.nav.PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_AVOID_COST 11 -> throw IllegalArgumentException("高速优先与避免收费不能同时为true") - 100 -> strategy = PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_AVOID_HIGHSPEED + 100 -> strategy = + com.zhidaoauto.map.sdk.open.logics.nav.PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_AVOID_HIGHSPEED 101 -> throw IllegalArgumentException("高速优先与不走高速不能同时为true") - 110 -> strategy = PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_AVOID_HIGHTSPEED_COST - 1000 -> strategy = PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_AVOID_CONGESTION - 1001 -> strategy = PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_PRIORITY_HIGHSPEED_AVOID_CONGESTION - 1010 -> strategy = PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_AVOID_COST_CONGESTION - 1100 -> strategy = PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_AVOID_HIGHSPEED_CONGESTION - 1110 -> strategy = PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_AVOID_HIGHSPEED_COST_CONGESTION + 110 -> strategy = + com.zhidaoauto.map.sdk.open.logics.nav.PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_AVOID_HIGHTSPEED_COST + 1000 -> strategy = + com.zhidaoauto.map.sdk.open.logics.nav.PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_AVOID_CONGESTION + 1001 -> strategy = + com.zhidaoauto.map.sdk.open.logics.nav.PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_PRIORITY_HIGHSPEED_AVOID_CONGESTION + 1010 -> strategy = + com.zhidaoauto.map.sdk.open.logics.nav.PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_AVOID_COST_CONGESTION + 1100 -> strategy = + com.zhidaoauto.map.sdk.open.logics.nav.PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_AVOID_HIGHSPEED_CONGESTION + 1110 -> strategy = + com.zhidaoauto.map.sdk.open.logics.nav.PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_AVOID_HIGHSPEED_COST_CONGESTION } } catch (e: Exception) { e.printStackTrace() diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NavInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NavInfo.kt similarity index 92% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NavInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NavInfo.kt index ab3df66ed7..dfe5fc14d0 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NavInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NavInfo.kt @@ -1,8 +1,8 @@ -package com.zhidaoauto.map.sdk.open.nav +package com.zhidaoauto.map.sdk.open.logics.nav import android.graphics.Bitmap -import com.zhidaoauto.map.sdk.open.nav.model.NaviExitDirectionInfo -import com.zhidaoauto.map.sdk.open.nav.model.NaviNotAvoidInfo +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviExitDirectionInfo +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviNotAvoidInfo class NavInfo { //路线id diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NavPoi.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NavPoi.kt similarity index 92% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NavPoi.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NavPoi.kt index 477e7c5f6c..8d1a8b60d8 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NavPoi.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NavPoi.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav +package com.zhidaoauto.map.sdk.open.logics.nav import java.io.Serializable diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NaviAutoView.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NaviAutoView.kt similarity index 97% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NaviAutoView.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NaviAutoView.kt index 67eb621144..65936d0170 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NaviAutoView.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NaviAutoView.kt @@ -12,10 +12,10 @@ //import com.zhidaoauto.map.sdk.inner.controller.CommonController //import com.zhidaoauto.map.sdk.inner.nav.NaviController //import com.zhidaoauto.map.sdk.inner.obj.NavMsg -//import com.zhidaoauto.map.sdk.open.location.MogoLocation -//import com.zhidaoauto.map.sdk.open.nav.abs.NaviViewListener -//import com.zhidaoauto.map.sdk.open.nav.abs.OnPolylineClickListener -//import com.zhidaoauto.map.sdk.open.nav.view.* +//import com.zhidaoauto.map.sdk.open.logics.MogoLocation +//import com.zhidaoauto.map.sdk.open.logics.nav.abs.NaviViewListener +//import com.zhidaoauto.map.sdk.open.logics.nav.abs.OnPolylineClickListener +//import com.zhidaoauto.map.sdk.open.logics.nav.view.* //import com.zhidaoauto.map.sdk.open.view.MapAutoView // //class NaviAutoView : MapAutoView, Guidanceinterface { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NaviType.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NaviType.kt similarity index 76% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NaviType.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NaviType.kt index 422cf8c73f..9a249a533c 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NaviType.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NaviType.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav +package com.zhidaoauto.map.sdk.open.logics.nav enum class NaviType(val value: Int) { NONE(-1),//未开始导航 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NaviViewOptions.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NaviViewOptions.kt similarity index 99% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NaviViewOptions.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NaviViewOptions.kt index 4392005d38..2ccb6d6db1 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NaviViewOptions.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NaviViewOptions.kt @@ -1,8 +1,8 @@ -package com.zhidaoauto.map.sdk.open.nav +package com.zhidaoauto.map.sdk.open.logics.nav import android.graphics.Bitmap import android.graphics.Rect -import com.zhidaoauto.map.sdk.open.nav.model.RouteOverlayOptions +import com.zhidaoauto.map.sdk.open.logics.nav.model.RouteOverlayOptions class NaviViewOptions { //HUD正向显示(数值:1) diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NaviViewShowMode.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NaviViewShowMode.kt similarity index 81% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NaviViewShowMode.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NaviViewShowMode.kt index 449b77aa92..3d1b6f29a1 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/NaviViewShowMode.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/NaviViewShowMode.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav +package com.zhidaoauto.map.sdk.open.logics.nav object NaviViewShowMode { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/PathPlanningStrategy.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/PathPlanningStrategy.kt similarity index 95% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/PathPlanningStrategy.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/PathPlanningStrategy.kt index 7ba1366bee..ee89ef6486 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/PathPlanningStrategy.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/PathPlanningStrategy.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav +package com.zhidaoauto.map.sdk.open.logics.nav object PathPlanningStrategy { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/AimlessModeListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/AimlessModeListener.kt similarity index 75% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/AimlessModeListener.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/AimlessModeListener.kt index 5234490ecf..d30f4d7c2d 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/AimlessModeListener.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/AimlessModeListener.kt @@ -1,8 +1,8 @@ -package com.zhidaoauto.map.sdk.open.nav.abs +package com.zhidaoauto.map.sdk.open.logics.nav.abs -import com.zhidaoauto.map.sdk.open.nav.model.AimLessModeCongestionInfo -import com.zhidaoauto.map.sdk.open.nav.model.AimLessModeStat -import com.zhidaoauto.map.sdk.open.nav.model.NaviTrafficFacilityInfo +import com.zhidaoauto.map.sdk.open.logics.nav.model.AimLessModeCongestionInfo +import com.zhidaoauto.map.sdk.open.logics.nav.model.AimLessModeStat +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviTrafficFacilityInfo interface AimlessModeListener { //巡航模式(无路线规划)下,道路设施信息更新回调,回调为空时,表示当前没有道路信息 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/NaviListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/NaviListener.kt similarity index 88% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/NaviListener.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/NaviListener.kt index 3849270bd9..2706f689a0 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/NaviListener.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/NaviListener.kt @@ -1,14 +1,14 @@ -package com.zhidaoauto.map.sdk.open.nav.abs +package com.zhidaoauto.map.sdk.open.logics.nav.abs -import com.zhidaoauto.map.sdk.open.location.MogoLocation -import com.zhidaoauto.map.sdk.open.nav.NavInfo -import com.zhidaoauto.map.sdk.open.nav.model.CalcRouteResult -import com.zhidaoauto.map.sdk.open.nav.model.LaneInfo -import com.zhidaoauto.map.sdk.open.nav.model.ModelCross -import com.zhidaoauto.map.sdk.open.nav.model.NaviCameraInfo -import com.zhidaoauto.map.sdk.open.nav.model.NaviCross -import com.zhidaoauto.map.sdk.open.nav.model.NaviRouteNotifyData -import com.zhidaoauto.map.sdk.open.nav.model.ServiceAreaInfo +import com.zhidaoauto.map.sdk.open.logics.location.MogoLocation +import com.zhidaoauto.map.sdk.open.logics.nav.NavInfo +import com.zhidaoauto.map.sdk.open.logics.nav.model.CalcRouteResult +import com.zhidaoauto.map.sdk.open.logics.nav.model.LaneInfo +import com.zhidaoauto.map.sdk.open.logics.nav.model.ModelCross +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviCameraInfo +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviCross +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviRouteNotifyData +import com.zhidaoauto.map.sdk.open.logics.nav.model.ServiceAreaInfo interface NaviListener { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/NaviViewListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/NaviViewListener.kt similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/NaviViewListener.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/NaviViewListener.kt index d4b1d885a8..2bb3f8d80f 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/NaviViewListener.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/NaviViewListener.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.abs +package com.zhidaoauto.map.sdk.open.logics.nav.abs interface NaviViewListener { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/OnPolylineClickListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/OnPolylineClickListener.kt new file mode 100644 index 0000000000..416383755f --- /dev/null +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/OnPolylineClickListener.kt @@ -0,0 +1,8 @@ +package com.zhidaoauto.map.sdk.open.logics.nav.abs + +import com.zhidaoauto.map.sdk.open.renders.poyline.Polyline + +interface OnPolylineClickListener { + fun onPolylineClick(var1: Polyline?) + +} \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/ParallelRoadListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/ParallelRoadListener.kt similarity index 63% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/ParallelRoadListener.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/ParallelRoadListener.kt index 92c6e4b3ba..c7558864dd 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/ParallelRoadListener.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/abs/ParallelRoadListener.kt @@ -1,6 +1,6 @@ -package com.zhidaoauto.map.sdk.open.nav.abs +package com.zhidaoauto.map.sdk.open.logics.nav.abs -import com.zhidaoauto.map.sdk.open.nav.model.NaviParallelRoadStatus +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviParallelRoadStatus interface ParallelRoadListener { //通知当前可以进行平行道路切换,包括主路、辅路以及高架桥上、高架桥下 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/AimLessModeCongestionInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/AimLessModeCongestionInfo.kt similarity index 92% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/AimLessModeCongestionInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/AimLessModeCongestionInfo.kt index cce6980874..676f9a8fe8 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/AimLessModeCongestionInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/AimLessModeCongestionInfo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model class AimLessModeCongestionInfo { //该条道路的拥堵信息数组 仅当拥堵长度大于500米且拥堵时间大于5分钟时,服务才下发拥堵路段形状点 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/AimLessModeStat.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/AimLessModeStat.kt similarity index 91% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/AimLessModeStat.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/AimLessModeStat.kt index 0bc76c2ff7..64204561c9 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/AimLessModeStat.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/AimLessModeStat.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model /* * 巡航模式(无路线规划)统计类 */ diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/CalcRouteResult.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/CalcRouteResult.kt similarity index 91% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/CalcRouteResult.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/CalcRouteResult.kt index 0781f790e3..c5f531c69a 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/CalcRouteResult.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/CalcRouteResult.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model class CalcRouteResult { var errorCode = 0//算路错误码,0为算路成功 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/CongestionLink.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/CongestionLink.kt similarity index 83% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/CongestionLink.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/CongestionLink.kt index e640dc1e50..283207afce 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/CongestionLink.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/CongestionLink.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model import com.zhidaoauto.map.data.point.LonLatPoint diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/LaneInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/LaneInfo.kt similarity index 75% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/LaneInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/LaneInfo.kt index 223d710b56..df86be9bbb 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/LaneInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/LaneInfo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model class LaneInfo { var backgroundLane: IntArray? = null //背景车道 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/ModelCross.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/ModelCross.kt similarity index 63% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/ModelCross.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/ModelCross.kt index 7bad79819a..b204c6a6af 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/ModelCross.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/ModelCross.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model class ModelCross { var picBuf1: ByteArray? = null //导航模型路口放大图数据 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviCameraInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviCameraInfo.kt similarity index 94% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviCameraInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviCameraInfo.kt index 2ae7f5a247..2fe596ce14 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviCameraInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviCameraInfo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model /* * 导航过程中的摄像头信息类。 */ diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviCarInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviCarInfo.kt similarity index 95% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviCarInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviCarInfo.kt index 54bad76663..2dd88b59fd 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviCarInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviCarInfo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model class NaviCarInfo { //车辆的车牌号码. diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviCross.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviCross.kt similarity index 86% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviCross.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviCross.kt index befbb8409c..d25ca31f72 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviCross.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviCross.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model import android.graphics.Bitmap diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviExitDirectionInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviExitDirectionInfo.kt similarity index 91% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviExitDirectionInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviExitDirectionInfo.kt index 41f08949ef..54db4d219a 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviExitDirectionInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviExitDirectionInfo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model // class NaviExitDirectionInfo { //出口名称信息 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviForbiddenInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviForbiddenInfo.kt similarity index 95% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviForbiddenInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviForbiddenInfo.kt index b9cd22449f..67405173a6 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviForbiddenInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviForbiddenInfo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model import java.util.LinkedList diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviGuide.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviGuide.kt similarity index 89% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviGuide.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviGuide.kt index 67f1f382dd..0f3f6af1e5 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviGuide.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviGuide.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model import com.zhidaoauto.map.data.point.LonLatPoint diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviLimitInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviLimitInfo.kt similarity index 86% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviLimitInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviLimitInfo.kt index 66bbcbce93..f4b4f6f44d 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviLimitInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviLimitInfo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model /* * 导航限制信息(例如 货车) */ diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviLink.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviLink.kt similarity index 95% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviLink.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviLink.kt index 06292b20a6..2b6dc799d8 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviLink.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviLink.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model import com.zhidaoauto.map.data.point.LonLatPoint diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviNotAvoidInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviNotAvoidInfo.kt similarity index 93% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviNotAvoidInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviNotAvoidInfo.kt index 9682db9df7..8e2c79be31 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviNotAvoidInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviNotAvoidInfo.kt @@ -1,6 +1,6 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model -import com.zhidaoauto.map.sdk.open.location.MogoLocation +import com.zhidaoauto.map.sdk.open.logics.location.MogoLocation class NaviNotAvoidInfo { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviOnlineCarHailingType.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviOnlineCarHailingType.kt similarity index 87% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviOnlineCarHailingType.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviOnlineCarHailingType.kt index 0f940d38c3..bb0aba83ea 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviOnlineCarHailingType.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviOnlineCarHailingType.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model /* * NONE * 非网约车模式, 即正常的默认模式 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviParallelRoadStatus.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviParallelRoadStatus.kt similarity index 93% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviParallelRoadStatus.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviParallelRoadStatus.kt index bf9e5d52a1..59ad081c4d 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviParallelRoadStatus.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviParallelRoadStatus.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model class NaviParallelRoadStatus { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviPath.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviPath.kt similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviPath.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviPath.kt index 0c0f1eddbb..cd216728ca 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviPath.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviPath.kt @@ -1,7 +1,7 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model import com.zhidaoauto.map.data.point.LonLatPoint -import com.zhidaoauto.map.sdk.open.camera.LatLngBounds +import com.zhidaoauto.map.sdk.open.logics.camera.LatLngBounds class NaviPath { var allLength = 0 //当前导航路线的总长度。 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviRouteGuideGroup.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviRouteGuideGroup.kt similarity index 94% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviRouteGuideGroup.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviRouteGuideGroup.kt index 597d513579..8ee78fcc40 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviRouteGuideGroup.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviRouteGuideGroup.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model import com.zhidaoauto.map.data.point.LonLatPoint diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviRouteGuideSegment.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviRouteGuideSegment.kt similarity index 80% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviRouteGuideSegment.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviRouteGuideSegment.kt index 91c5a59d89..59d5c2d341 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviRouteGuideSegment.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviRouteGuideSegment.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model class NaviRouteGuideSegment { var stepIconType = 0 //该详情分段的转向 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviRouteNotifyData.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviRouteNotifyData.kt similarity index 91% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviRouteNotifyData.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviRouteNotifyData.kt index 6401ab89b5..71cd123fef 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviRouteNotifyData.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviRouteNotifyData.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model class NaviRouteNotifyData { var notifyType = 0 //通知类型 具体类型 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviSetting.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviSetting.kt similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviSetting.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviSetting.kt index fdfd06b2d4..682813d944 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviSetting.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviSetting.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model import com.zhidaoauto.map.sdk.inner.common.NavHelper diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviStep.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviStep.kt similarity index 95% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviStep.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviStep.kt index f155daf24b..f5e6de809c 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviStep.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviStep.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model import com.zhidaoauto.map.data.point.LonLatPoint diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviTrafficFacilityInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviTrafficFacilityInfo.kt similarity index 83% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviTrafficFacilityInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviTrafficFacilityInfo.kt index fc9b678d19..bc65f74bbc 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/NaviTrafficFacilityInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/NaviTrafficFacilityInfo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model class NaviTrafficFacilityInfo { var longitude = 0.0 //道路设施经度 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/RestrictionInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/RestrictionInfo.kt similarity index 81% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/RestrictionInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/RestrictionInfo.kt index ad7420fac3..54249b9f57 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/RestrictionInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/RestrictionInfo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model class RestrictionInfo { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/RouteOverlayOptions.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/RouteOverlayOptions.kt similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/RouteOverlayOptions.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/RouteOverlayOptions.kt index 171b9e932c..66c7d99735 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/RouteOverlayOptions.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/RouteOverlayOptions.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model import android.graphics.Bitmap import android.graphics.Rect diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/ServiceAreaInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/ServiceAreaInfo.kt similarity index 84% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/ServiceAreaInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/ServiceAreaInfo.kt index cdfbf60a8e..871ab64a45 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/ServiceAreaInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/ServiceAreaInfo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model import com.zhidaoauto.map.data.point.LonLatPoint diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/TrafficIncidentInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/TrafficIncidentInfo.kt similarity index 78% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/TrafficIncidentInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/TrafficIncidentInfo.kt index 94045f6616..a9b8564aa1 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/TrafficIncidentInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/TrafficIncidentInfo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model class TrafficIncidentInfo { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/TrafficStatus.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/TrafficStatus.kt similarity index 89% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/TrafficStatus.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/TrafficStatus.kt index 4c189cb0d5..b68794202f 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/model/TrafficStatus.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/model/TrafficStatus.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.model +package com.zhidaoauto.map.sdk.open.logics.nav.model class TrafficStatus { var linkIndex = 0 //当前路况在整条路线的link下标位置 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/DirectionView.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/DirectionView.kt similarity index 97% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/DirectionView.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/DirectionView.kt index f7acdbfa72..acf733dd82 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/DirectionView.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/DirectionView.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.view +package com.zhidaoauto.map.sdk.open.logics.nav.view import android.annotation.SuppressLint import android.content.Context diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/DriveWayView.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/DriveWayView.kt similarity index 81% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/DriveWayView.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/DriveWayView.kt index 06288b399b..02e2df2b48 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/DriveWayView.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/DriveWayView.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.view +package com.zhidaoauto.map.sdk.open.logics.nav.view class DriveWayView { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/NextTurnTipView.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/NextTurnTipView.kt similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/NextTurnTipView.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/NextTurnTipView.kt index b9b1be667c..bd67980ad1 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/NextTurnTipView.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/NextTurnTipView.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.view +package com.zhidaoauto.map.sdk.open.logics.nav.view import android.content.Context import android.content.res.Resources diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/OverviewButtonView.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/OverviewButtonView.kt similarity index 95% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/OverviewButtonView.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/OverviewButtonView.kt index 2ce2220fcd..a9dc0a49fe 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/OverviewButtonView.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/OverviewButtonView.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.view +package com.zhidaoauto.map.sdk.open.logics.nav.view import android.content.Context import android.util.AttributeSet diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/RouteOverLay.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/RouteOverLay.kt similarity index 55% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/RouteOverLay.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/RouteOverLay.kt index 689ee32600..25e3dfbc0d 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/RouteOverLay.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/RouteOverLay.kt @@ -1,14 +1,14 @@ -package com.zhidaoauto.map.sdk.open.nav.view +package com.zhidaoauto.map.sdk.open.logics.nav.view import android.content.Context import android.graphics.Bitmap import com.zhidaoauto.map.data.point.LonLatPoint -import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptor -import com.zhidaoauto.map.sdk.open.marker.Marker -import com.zhidaoauto.map.sdk.open.nav.model.NaviPath -import com.zhidaoauto.map.sdk.open.nav.model.RouteOverlayOptions -import com.zhidaoauto.map.sdk.open.poyline.Polyline -import com.zhidaoauto.map.sdk.open.poyline.PolylineOptions +import com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor +import com.zhidaoauto.map.sdk.open.renders.marker.Marker +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviPath +import com.zhidaoauto.map.sdk.open.logics.nav.model.RouteOverlayOptions +import com.zhidaoauto.map.sdk.open.renders.poyline.Polyline +import com.zhidaoauto.map.sdk.open.renders.poyline.PolylineOptions class RouteOverLay{ private var startMarker: Marker? = null @@ -22,19 +22,19 @@ class RouteOverLay{ private var endBitmap: Bitmap? = null private var wayBitmap: Bitmap? = null private var footBitmap: Bitmap? = null - private var arrowOnRoute: BitmapDescriptor? = null - private var normalRoute: BitmapDescriptor? = null - private var unknownTraffic: BitmapDescriptor? = null - private var smoothTraffic: BitmapDescriptor? = null - private var slowTraffic: BitmapDescriptor? = null - private var jamTraffic: BitmapDescriptor? = null - private var veryJamTraffic: BitmapDescriptor? = null - private var fairWayRes: BitmapDescriptor? = null - private var passRoute: BitmapDescriptor? = null - private var passFairWayRes: BitmapDescriptor? = null - private var passDefaultRes: BitmapDescriptor? = null - private var trafficLightRes: BitmapDescriptor? = null - private val wayPoisRes: Array = arrayOfNulls(3) + private var arrowOnRoute: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor? = null + private var normalRoute: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor? = null + private var unknownTraffic: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor? = null + private var smoothTraffic: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor? = null + private var slowTraffic: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor? = null + private var jamTraffic: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor? = null + private var veryJamTraffic: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor? = null + private var fairWayRes: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor? = null + private var passRoute: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor? = null + private var passFairWayRes: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor? = null + private var passDefaultRes: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor? = null + private var trafficLightRes: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor? = null + private val wayPoisRes: Array = arrayOfNulls(3) private var mRouteOverlayOptions: RouteOverlayOptions? = null private var mPassDefaultPolyline: Polyline? = null var mTrafficColorfulPolyline: Polyline? = null @@ -50,7 +50,7 @@ class RouteOverLay{ private val mLatLngsOfPath: MutableList = ArrayList() private val carLinkCoods: MutableList = ArrayList() private val mCustomPolyLines: MutableList = ArrayList() - protected var mLineTextureMap: HashMap = HashMap() + protected var mLineTextureMap: HashMap = HashMap() private var arrowColor = -1 private var arrowSideColor = 1990523135 private var turnArrowIs3D = true diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/TmcBarView.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/TmcBarView.kt similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/TmcBarView.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/TmcBarView.kt index f8acfcbdee..29a7314542 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/TmcBarView.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/TmcBarView.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.view +package com.zhidaoauto.map.sdk.open.logics.nav.view import android.content.Context import android.graphics.* @@ -6,7 +6,7 @@ import android.os.Build import android.util.AttributeSet import android.view.View import android.widget.ImageView -import com.zhidaoauto.map.sdk.open.nav.model.TrafficStatus +import com.zhidaoauto.map.sdk.open.logics.nav.model.TrafficStatus import java.util.* import kotlin.math.roundToInt diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/TrafficButtonView.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/TrafficButtonView.kt similarity index 97% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/TrafficButtonView.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/TrafficButtonView.kt index 86dba5bcd8..32837c81cf 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/TrafficButtonView.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/TrafficButtonView.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.view +package com.zhidaoauto.map.sdk.open.logics.nav.view import android.content.Context import android.graphics.Bitmap diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/TrafficProgressBar.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/TrafficProgressBar.kt similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/TrafficProgressBar.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/TrafficProgressBar.kt index e728517218..902f795d23 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/TrafficProgressBar.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/TrafficProgressBar.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.view +package com.zhidaoauto.map.sdk.open.logics.nav.view import android.content.Context import android.graphics.Color @@ -6,7 +6,7 @@ import android.util.AttributeSet import android.view.LayoutInflater import android.widget.FrameLayout import com.zhidaoauto.map.sdk.R -import com.zhidaoauto.map.sdk.open.nav.model.TrafficStatus +import com.zhidaoauto.map.sdk.open.logics.nav.model.TrafficStatus import kotlinx.android.synthetic.main.view_trafficbar.view.tmcBarCar import kotlinx.android.synthetic.main.view_trafficbar.view.tmcBarTxt import kotlinx.android.synthetic.main.view_trafficbar.view.tmcBarView diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/ZoomButtonView.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/ZoomButtonView.kt similarity index 97% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/ZoomButtonView.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/ZoomButtonView.kt index 2226730f57..6fed5bd609 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/ZoomButtonView.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/ZoomButtonView.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.nav.view +package com.zhidaoauto.map.sdk.open.logics.nav.view import android.content.Context import android.util.AttributeSet diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/ZoomInIntersectionView.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/ZoomInIntersectionView.kt similarity index 90% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/ZoomInIntersectionView.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/ZoomInIntersectionView.kt index 53822a9076..4dbbdb4912 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/view/ZoomInIntersectionView.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/nav/view/ZoomInIntersectionView.kt @@ -1,11 +1,11 @@ -package com.zhidaoauto.map.sdk.open.nav.view +package com.zhidaoauto.map.sdk.open.logics.nav.view import android.content.Context import android.graphics.Bitmap import android.util.AttributeSet import android.view.MotionEvent import android.widget.ImageView -import com.zhidaoauto.map.sdk.open.nav.model.NaviCross +import com.zhidaoauto.map.sdk.open.logics.nav.model.NaviCross class ZoomInIntersectionView : ImageView { private var zoomInBitmap: Bitmap? = null diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/navi/NaviResponse.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/navi/NaviResponse.kt similarity index 63% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/navi/NaviResponse.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/navi/NaviResponse.kt index 90df5d5aaa..d91aa3dbf4 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/navi/NaviResponse.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/navi/NaviResponse.kt @@ -1,7 +1,7 @@ -package com.zhidaoauto.map.sdk.open.navi +package com.zhidaoauto.map.sdk.open.logics.navi data class NaviResponse( - val routeSolution:NaviPath, + val routeSolution: NaviPath, ) data class NaviPath( diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/GeocodeAddress.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/GeocodeAddress.kt similarity index 93% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/GeocodeAddress.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/GeocodeAddress.kt index d8e33edd32..eb81bf04f7 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/GeocodeAddress.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/GeocodeAddress.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query import com.zhidaoauto.map.data.point.LonLatPoint diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/GeocodeQuery.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/GeocodeQuery.kt similarity index 81% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/GeocodeQuery.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/GeocodeQuery.kt index a15389cf55..a8da6aac66 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/GeocodeQuery.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/GeocodeQuery.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query class GeocodeQuery{ var locationName: String? = null diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/GeocodeResult.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/GeocodeResult.kt new file mode 100644 index 0000000000..b90ee4aa5c --- /dev/null +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/GeocodeResult.kt @@ -0,0 +1,18 @@ +package com.zhidaoauto.map.sdk.open.logics.query + + +class GeocodeResult( + geocodeAddressList: List +) { + var geocodeAddressList: List = ArrayList() + + init { + this.geocodeAddressList = geocodeAddressList + } + + override fun toString(): String { + return "GeocodeResult(geocodeAddressList=$geocodeAddressList)" + } + + +} \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/GeocodeSearch.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/GeocodeSearch.kt similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/GeocodeSearch.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/GeocodeSearch.kt index 8f3a83a00d..e92eea4694 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/GeocodeSearch.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/GeocodeSearch.kt @@ -3,7 +3,7 @@ //import android.content.Context //import com.zhidaoauto.map.sdk.inner.search.GeocoderSearchHelper //import com.zhidaoauto.map.sdk.open.abs.search.IGeocodeSearch -//import com.zhidaoauto.map.sdk.open.exception.MapException +//import com.zhidaoauto.map.sdk.open.common.MapException // //class GeocodeSearch(context: Context) { // private var mIGeocodeSearch: IGeocodeSearch? = null diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/IndoorData.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/IndoorData.kt similarity index 67% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/IndoorData.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/IndoorData.kt index a963b87617..31c2c58dab 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/IndoorData.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/IndoorData.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query class IndoorData { var poiId: String? = null diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/Inputtips.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/Inputtips.kt similarity index 95% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/Inputtips.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/Inputtips.kt index 8765c98f07..2e1255ea9e 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/Inputtips.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/Inputtips.kt @@ -3,7 +3,7 @@ //import android.content.Context //import com.zhidaoauto.map.sdk.inner.search.InputSearchHelper //import com.zhidaoauto.map.sdk.open.abs.search.IInputtipsSearch -//import com.zhidaoauto.map.sdk.open.exception.MapException +//import com.zhidaoauto.map.sdk.open.common.MapException // //class Inputtips(context: Context, query: InputtipsQuery) { // private var inputtipsSearch: IInputtipsSearch diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/InputtipsListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/InputtipsListener.kt new file mode 100644 index 0000000000..a3c96b0090 --- /dev/null +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/InputtipsListener.kt @@ -0,0 +1,5 @@ +package com.zhidaoauto.map.sdk.open.logics.query + +interface InputtipsListener { + fun onGetInputtips(tipList: List?, code: Int) +} \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/InputtipsQuery.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/InputtipsQuery.kt similarity index 86% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/InputtipsQuery.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/InputtipsQuery.kt index 140621fb6f..6448466996 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/InputtipsQuery.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/InputtipsQuery.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query import com.zhidaoauto.map.data.point.LonLatPoint diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/OnGeocodeSearchListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/OnGeocodeSearchListener.kt new file mode 100644 index 0000000000..954513d82f --- /dev/null +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/OnGeocodeSearchListener.kt @@ -0,0 +1,6 @@ +package com.zhidaoauto.map.sdk.open.logics.query + +interface OnGeocodeSearchListener { + fun onRegeocodeSearched(result: com.zhidaoauto.map.sdk.open.logics.query.RegeocodeResult?, code: Int) + fun onGeocodeSearched(result: com.zhidaoauto.map.sdk.open.logics.query.GeocodeResult?, code: Int) +} \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/OnPoiSearchListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/OnPoiSearchListener.kt new file mode 100644 index 0000000000..c2508c74f8 --- /dev/null +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/OnPoiSearchListener.kt @@ -0,0 +1,14 @@ +package com.zhidaoauto.map.sdk.open.logics.query + + +interface OnPoiSearchListener { + fun onPoiSearched(poiSearchResult: com.zhidaoauto.map.sdk.open.logics.query.PoiSearchResult?, code: Int) + fun onPoiItemSearched( + poiItem: com.zhidaoauto.map.sdk.open.logics.query.PoiItem?, + code: Int + ) + fun onPoiCategorySearched( + list: List?, + code: Int + ) +} \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/Photo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/Photo.kt similarity index 60% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/Photo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/Photo.kt index bf3e8c6b17..7e4ea7d65a 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/Photo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/Photo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query class Photo { var title: String? = null diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiCategory.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiCategory.kt similarity index 78% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiCategory.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiCategory.kt index fde09a3417..8d6254c3d8 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiCategory.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiCategory.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query class PoiCategory{ diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiItem.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiItem.kt similarity index 78% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiItem.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiItem.kt index d6bf444cbf..f2c76f2624 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiItem.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiItem.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query import com.zhidaoauto.map.data.point.LonLatPoint @@ -22,14 +22,14 @@ class PoiItem { var cityName: String? = null var adName: String? = null var indoorMap = false - var indoorData: IndoorData? = null + var indoorData: com.zhidaoauto.map.sdk.open.logics.query.IndoorData? = null var provinceCode: String? = null var businessArea: String? = null var parkingType: String? = null - var subPois: List = ArrayList() - var photos: List = - ArrayList() - var poiExtension: PoiItemExtension? = null + var subPois: List = ArrayList() + var photos: List = + ArrayList() + var poiExtension: com.zhidaoauto.map.sdk.open.logics.query.PoiItemExtension? = null var typeCode: String? = null var shopID: String? = null override fun equals(var1: Any?): Boolean { @@ -41,7 +41,7 @@ class PoiItem { false } else { var var2 = - var1 as PoiItem + var1 as com.zhidaoauto.map.sdk.open.logics.query.PoiItem if (poiId == null) { if (var2.poiId != null) { return false diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiItemExtension.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiItemExtension.kt similarity index 82% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiItemExtension.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiItemExtension.kt index dfe16393f9..d3251b6a61 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiItemExtension.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiItemExtension.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query class PoiItemExtension { var opentime: String? = null diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiSearch.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiSearch.kt similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiSearch.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiSearch.kt index c1d18b2b86..9d21ea5a5d 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiSearch.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiSearch.kt @@ -3,7 +3,7 @@ //import android.content.Context //import com.zhidaoauto.map.sdk.inner.search.SearchHelper //import com.zhidaoauto.map.sdk.open.abs.search.IPoiSearch -//import com.zhidaoauto.map.sdk.open.exception.MapException +//import com.zhidaoauto.map.sdk.open.common.MapException // //class PoiSearch( // context: Context?, diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiSearchItem.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiSearchItem.kt similarity index 51% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiSearchItem.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiSearchItem.kt index 3009279b71..0578ed092e 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiSearchItem.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiSearchItem.kt @@ -1,10 +1,10 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query class PoiSearchItem { - var poi: PoiItem? = null + var poi: com.zhidaoauto.map.sdk.open.logics.query.PoiItem? = null var orderId: Int = -1 - constructor(poi: PoiItem,orderId: Int) { + constructor(poi: com.zhidaoauto.map.sdk.open.logics.query.PoiItem, orderId: Int) { this.poi = poi this.orderId = orderId } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiSearchResult.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiSearchResult.kt similarity index 95% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiSearchResult.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiSearchResult.kt index fcc732cd1c..eaadfbf372 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/PoiSearchResult.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/PoiSearchResult.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query class PoiSearchResult private constructor( val query: Query, diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/Query.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/Query.kt similarity index 99% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/Query.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/Query.kt index 40b1f0d644..dbf96ec997 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/Query.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/Query.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query import android.util.Log import com.zhidaoauto.map.data.point.LonLatPoint diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/RegeocodeAddress.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/RegeocodeAddress.kt similarity index 85% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/RegeocodeAddress.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/RegeocodeAddress.kt index 02612f26a2..180e1ce8e3 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/RegeocodeAddress.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/RegeocodeAddress.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query class RegeocodeAddress { var poiId: String? = null @@ -12,7 +12,7 @@ class RegeocodeAddress { var cityCode: String? = null var adCode: String? = null var towncode: String? = null - var poiList: List? = null + var poiList: List? = null var country: String? = null override fun toString(): String { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/RegeocodeQuery.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/RegeocodeQuery.kt similarity index 86% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/RegeocodeQuery.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/RegeocodeQuery.kt index f4a1b83906..4ffcc6fcc6 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/RegeocodeQuery.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/RegeocodeQuery.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query import com.zhidaoauto.map.data.point.LonLatPoint diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/RegeocodeResult.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/RegeocodeResult.kt similarity index 86% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/RegeocodeResult.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/RegeocodeResult.kt index 81e75bc369..d985abe922 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/RegeocodeResult.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/RegeocodeResult.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query class RegeocodeResult( diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/SubPoiItem.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/SubPoiItem.kt similarity index 85% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/SubPoiItem.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/SubPoiItem.kt index 95629d5b5c..112aeb4f5f 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/SubPoiItem.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/SubPoiItem.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query import com.zhidaoauto.map.data.point.LonLatPoint diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/SuggestionCity.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/SuggestionCity.kt similarity index 72% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/SuggestionCity.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/SuggestionCity.kt index 3beff4b525..45e5d577f9 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/SuggestionCity.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/SuggestionCity.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query class SuggestionCity( val CityName: String, diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/Tip.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/Tip.kt similarity index 88% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/Tip.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/Tip.kt index a554635959..151db2f7d6 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/Tip.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/query/Tip.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.query +package com.zhidaoauto.map.sdk.open.logics.query import com.zhidaoauto.map.data.point.LonLatPoint import java.io.Serializable diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/style/CustomMapStyleOptions.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/style/CustomMapStyleOptions.kt similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/style/CustomMapStyleOptions.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/style/CustomMapStyleOptions.kt index a4e5fc4439..68fd7f931d 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/style/CustomMapStyleOptions.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/style/CustomMapStyleOptions.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.style +package com.zhidaoauto.map.sdk.open.logics.style class CustomMapStyleOptions { private var styleDataPath: String? = null//自定义样式路径 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/weather/WeatherInfo.kt similarity index 92% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/weather/WeatherInfo.kt index e608a07fae..d7ab2b92e5 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/weather/WeatherInfo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.weather +package com.zhidaoauto.map.sdk.open.logics.weather class WeatherInfo { val province:String = ""// 省份名 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherResult.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/weather/WeatherResult.kt similarity index 64% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherResult.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/weather/WeatherResult.kt index 055ceb1dc1..bcc3518fe0 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherResult.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/weather/WeatherResult.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.weather +package com.zhidaoauto.map.sdk.open.logics.weather interface WeatherResult { fun result(code:Int, data: WeatherInfo?, message: String?) diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherType.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/weather/WeatherType.kt similarity index 50% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherType.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/weather/WeatherType.kt index 4a9b6c3192..d296fe35d0 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/weather/WeatherType.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/logics/weather/WeatherType.kt @@ -1,9 +1,10 @@ -package com.zhidaoauto.map.sdk.open.weather +package com.zhidaoauto.map.sdk.open.logics.weather enum class WeatherType( val type: String ) { DEFULT("0"), RAIN("1"), - SNOW("2") + SNOW("2"), + CLOUDY("3") } \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/OnPolylineClickListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/OnPolylineClickListener.kt deleted file mode 100644 index fbbcfde585..0000000000 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/nav/abs/OnPolylineClickListener.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.zhidaoauto.map.sdk.open.nav.abs - -import com.zhidaoauto.map.sdk.open.poyline.Polyline - -interface OnPolylineClickListener { - fun onPolylineClick(var1: Polyline?) - -} \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/GeocodeResult.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/GeocodeResult.kt deleted file mode 100644 index 97f7d4eb30..0000000000 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/GeocodeResult.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.zhidaoauto.map.sdk.open.query - - -class GeocodeResult( - geocodeAddressList: List -) { - var geocodeAddressList: List = ArrayList() - - init { - this.geocodeAddressList = geocodeAddressList - } - - override fun toString(): String { - return "GeocodeResult(geocodeAddressList=$geocodeAddressList)" - } - - -} \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/InputtipsListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/InputtipsListener.kt deleted file mode 100644 index af70151039..0000000000 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/InputtipsListener.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.zhidaoauto.map.sdk.open.query - -interface InputtipsListener { - fun onGetInputtips(tipList: List?, code: Int) -} \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/OnGeocodeSearchListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/OnGeocodeSearchListener.kt deleted file mode 100644 index 43478b3037..0000000000 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/OnGeocodeSearchListener.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.zhidaoauto.map.sdk.open.query - -interface OnGeocodeSearchListener { - fun onRegeocodeSearched(result: RegeocodeResult?, code: Int) - fun onGeocodeSearched(result: GeocodeResult?, code: Int) -} \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/OnPoiSearchListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/OnPoiSearchListener.kt deleted file mode 100644 index d460d48e3b..0000000000 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/query/OnPoiSearchListener.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.zhidaoauto.map.sdk.open.query - - -interface OnPoiSearchListener { - fun onPoiSearched(poiSearchResult: PoiSearchResult?, code: Int) - fun onPoiItemSearched( - poiItem: PoiItem?, - code: Int - ) - fun onPoiCategorySearched( - list: List?, - code: Int - ) -} \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/Animation.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/Animation.kt similarity index 91% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/Animation.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/Animation.kt index cc0b6c60e0..a3d153ae31 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/Animation.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/Animation.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker import com.zhidaoauto.map.sdk.open.abs.marker.MarkerAnimationListener diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/BatchMarkerOptions.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/BatchMarkerOptions.kt similarity index 71% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/BatchMarkerOptions.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/BatchMarkerOptions.kt index 2078842001..2711d88268 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/BatchMarkerOptions.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/BatchMarkerOptions.kt @@ -1,9 +1,9 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker class BatchMarkerOptions { // 他车数据列表 - var list:ArrayList? = null + var list:ArrayList? = null // 他车数据拼接字符串 var othersStr:String = "" // 是否延时处理 1= 延迟 0 =不延迟 @@ -29,9 +29,13 @@ class BatchMarkerOptions { var averageFlag: Int = 1 //回调标记 var callbackFlag: Int = 0 + //是否显示他车底部光圈 + var isDisplayOtherAnim:Int = 0 + //他车底部光圈资源 + var otherAnimRes:String = "" - constructor(list:ArrayList?){ + constructor(list:ArrayList?){ this.list = list } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/BitmapDescriptor.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/BitmapDescriptor.kt similarity index 69% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/BitmapDescriptor.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/BitmapDescriptor.kt index 0f15b8b557..433df1ed9f 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/BitmapDescriptor.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/BitmapDescriptor.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker import android.graphics.Bitmap import android.os.Parcel @@ -33,23 +33,23 @@ public class BitmapDescriptor : Parcelable, Cloneable { this.bitmap = bitmap } - public override fun clone(): BitmapDescriptor { + public override fun clone(): com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor { bitmap?.let { return try { - BitmapDescriptor( + com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor( Bitmap.createBitmap(it), width, height ) } catch (var3: Throwable) { - return BitmapDescriptor( + return com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor( Bitmap.createBitmap(it), width, height ) } } - return BitmapDescriptor(bitmap) + return com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor(bitmap) } /** @@ -61,7 +61,7 @@ public class BitmapDescriptor : Parcelable, Cloneable { return ByteArray(0) } val bytes = it.byteCount - val buf = ByteBuffer.allocateDirect(bytes) + var buf = ByteBuffer.allocateDirect(bytes) it.copyPixelsToBuffer(buf) // it.recycle() return buf.array() @@ -90,13 +90,13 @@ public class BitmapDescriptor : Parcelable, Cloneable { } companion object { - @JvmField val CREATOR: Parcelable.Creator = - object : Parcelable.Creator { - override fun createFromParcel(`in`: Parcel): BitmapDescriptor? { - return BitmapDescriptor(`in`) + @JvmField val CREATOR: Parcelable.Creator = + object : Parcelable.Creator { + override fun createFromParcel(`in`: Parcel): com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor? { + return com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor(`in`) } - override fun newArray(size: Int): Array { + override fun newArray(size: Int): Array { return arrayOfNulls(size) } } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/BitmapDescriptorFactory.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/BitmapDescriptorFactory.kt similarity index 80% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/BitmapDescriptorFactory.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/BitmapDescriptorFactory.kt index 8c4e6c58b8..0c7b3d69ee 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/BitmapDescriptorFactory.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/BitmapDescriptorFactory.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker import android.content.Context import android.graphics.Bitmap @@ -13,13 +13,18 @@ import java.io.IOException object BitmapDescriptorFactory { //图片转换 - fun fromBitmap(bitmap: Bitmap): BitmapDescriptor { - return BitmapDescriptor(bitmap) + fun fromBitmap(bitmap: Bitmap): com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor { + return com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor(bitmap) } //图片资源转换 - fun fromResource(context:Context,@DrawableRes resId: Int): BitmapDescriptor { - return BitmapDescriptor(BitmapFactory.decodeResource(context.resources,resId)) + fun fromResource(context:Context,@DrawableRes resId: Int): com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor { + return com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor( + BitmapFactory.decodeResource( + context.resources, + resId + ) + ) } fun from3DResource(context:Context,resId: Int) :ByteArray?{ @@ -55,8 +60,8 @@ object BitmapDescriptorFactory { return totBuffer } - fun fromView(view: View): BitmapDescriptor { - return BitmapDescriptor(convertViewToBitmap(view)) + fun fromView(view: View): com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor { + return com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor(convertViewToBitmap(view)) } fun convertViewToBitmap(view: View): Bitmap { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/CarInfo.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/CarInfo.kt similarity index 84% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/CarInfo.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/CarInfo.kt index c223737056..c30a5664c6 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/CarInfo.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/CarInfo.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker /** * @param id diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/CarManager.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/CarManager.kt similarity index 99% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/CarManager.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/CarManager.kt index df3c64c0c3..4674980d35 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/CarManager.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/CarManager.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker import com.zhidaoauto.map.sdk.inner.abs.IMapController import com.zhidaoauto.map.sdk.inner.utils.OBB diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/InfoWindowParams.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/InfoWindowParams.kt similarity index 79% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/InfoWindowParams.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/InfoWindowParams.kt index 644a1a5a02..13caa91f59 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/InfoWindowParams.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/InfoWindowParams.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker import android.view.View diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/Marker.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/Marker.kt similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/Marker.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/Marker.kt index d62723fef6..cc17fb6825 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/Marker.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/Marker.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker import android.content.Context @@ -25,8 +25,8 @@ import com.zhidaoauto.map.sdk.inner.utils.MathUtils import com.zhidaoauto.map.sdk.open.abs.marker.InfoWindowAdapter import com.zhidaoauto.map.sdk.open.abs.marker.MarkerAnimationListener import com.zhidaoauto.map.sdk.open.abs.marker.OnMarkerDragListener -import com.zhidaoauto.map.sdk.open.tools.MD5Utils -import com.zhidaoauto.map.sdk.open.tools.MapTools +import com.zhidaoauto.map.sdk.open.common.tools.MD5Utils +import com.zhidaoauto.map.sdk.open.common.tools.MapTools import org.json.JSONArray import org.json.JSONObject import kotlin.math.absoluteValue @@ -51,7 +51,7 @@ public class Marker(private var markerOptions: MarkerOptions,private var mMapCon private var mInfoWindowAdapter: InfoWindowAdapter? = null private var markerAnimationListenerList: ArrayList? = null - private var markerAnimationMap: HashMap = HashMap() + private var markerAnimationMap: HashMap = HashMap() private var isExecuteAnimation: Boolean = false private var historyLocationList: ArrayList? = null @@ -60,7 +60,7 @@ public class Marker(private var markerOptions: MarkerOptions,private var mMapCon override fun handleMessage(msg: Message) { super.handleMessage(msg) val type = msg.arg1 - val animation: Animation? = markerAnimationMap[type] + val animation: com.zhidaoauto.map.sdk.open.renders.marker.Animation? = markerAnimationMap[type] animation?.let { val listener: MarkerAnimationListener? = animation.getAnimationListener() when (msg.arg2) { @@ -735,7 +735,7 @@ public class Marker(private var markerOptions: MarkerOptions,private var mMapCon mMapController?.addScaleAnimationToAnchor(id, animation.scaleStart, animation.scaleEnd, duration) } - private fun addMarkerAnimation(animation: Animation) { + private fun addMarkerAnimation(animation: com.zhidaoauto.map.sdk.open.renders.marker.Animation) { animation.getAnimationListener()?.let { when (animation) { is MarkerTranslateAnimation -> @@ -807,7 +807,7 @@ public class Marker(private var markerOptions: MarkerOptions,private var mMapCon mMapController?.getContext()?.let {context-> val markerView = BitmapDescriptorFactory.from3DResource(context, icon) markerView?.let { - MD5Utils.getInstance() + MD5Utils.getInstanse() val anchor3dName = MD5Utils.getMD5String(markerView) if (mMarkerCall?.containMarkerIcon(anchor3dName) == false) { if (CompileConfig.DEBUG) { @@ -833,11 +833,11 @@ public class Marker(private var markerOptions: MarkerOptions,private var mMapCon throw RuntimeException("最多支持10个3D模型") } }else { - val icons = animation.getIcons() as ArrayList + val icons = animation.getIcons() as ArrayList if (icons != null) { for (icon in icons) { val markerView = icon.getBytes() - MD5Utils.getInstance() + MD5Utils.getInstanse() val markerIconName = MD5Utils.getMD5String(markerView) if (mMarkerCall?.containMarkerIcon(markerIconName) == false) { if (CompileConfig.DEBUG) { @@ -884,10 +884,18 @@ public class Marker(private var markerOptions: MarkerOptions,private var mMapCon } /** - * @param colorType 上色类型 1=由原色变为指定色 2=由指定色变为原色 + * @param colorType 上色类型 + * 1=由原色变为指定色 有方向 + * 2=由指定色变为原色 有方向 + * 3=由原色变为指定色 无方向 + * 4=由指定色变为原色 无方向 * @param color 颜色 * @param time 渐变过程时间 * @param angle 角度 范围(0,90,180,270) + * angle==0 车前到车尾 + * angle==90 左侧到右侧 + * angle==180 车尾到车前 + * angle==270 右侧到左侧 */ fun setMarkerFlash(colorType: Int, color: String, time: Float, angle: Float){ markerOptions.colorType(colorType) diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerBatchData.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerBatchData.kt similarity index 90% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerBatchData.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerBatchData.kt index f104d68729..227bb2845f 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerBatchData.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerBatchData.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker class MarkerBatchData { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerCacheController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerCacheController.kt similarity index 97% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerCacheController.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerCacheController.kt index 889d42f666..cdecaa7f65 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerCacheController.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerCacheController.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker import android.util.Log import com.zhidaoauto.map.data.point.LonLatPoint @@ -51,7 +51,7 @@ class MarkerCacheController(private val mapAutoView: MapAutoView) { private var lastPreTime = 0L //显示infowindow - var showInfo: Boolean = false + var showInfo: Boolean = true init { lastPreTime = 0L @@ -444,10 +444,10 @@ class MarkerCacheController(private val mapAutoView: MapAutoView) { while (isExecuting.get()) { if (dataStrategy) { - if (!timeList.isEmpty() && !cacheMap.isEmpty()) { + if (!timeList.isEmpty() && !cacheDataSetMap.isEmpty()) { for (frameTime in timeList) { if (System.currentTimeMillis() - frameTime >= cacheInterval) { - val dataSet = cacheMap.remove(frameTime) + val dataSet = cacheDataSetMap.remove(frameTime) if (lastTime != frameTime) { updateMarker(dataSet) lastTime = frameTime @@ -462,10 +462,10 @@ class MarkerCacheController(private val mapAutoView: MapAutoView) { } } else { - if (!timeList.isEmpty() && !cacheDataSetMap.isEmpty()) { + if (!timeList.isEmpty() && !cacheMap.isEmpty()) { for (frameTime in timeList) { if (System.currentTimeMillis() - frameTime >= cacheInterval) { - val dataSet = cacheDataSetMap.remove(frameTime) + val dataSet = cacheMap.remove(frameTime) if (lastTime != frameTime) { updateMarker(dataSet) lastTime = frameTime @@ -506,12 +506,14 @@ class MarkerCacheController(private val mapAutoView: MapAutoView) { mLastLocationTime = System.currentTimeMillis() if (batchData.others != null) { val list = ArrayList(batchData.others!!) - val batchMarkerOptions = BatchMarkerOptions() + val batchMarkerOptions = com.zhidaoauto.map.sdk.open.renders.marker.BatchMarkerOptions() batchMarkerOptions.list = list batchMarkerOptions.delayStrategy = delayStrategy batchMarkerOptions.ruleAngle = ruleAngle batchMarkerOptions.controlIcon = controlIcon batchMarkerOptions.duration = duration + batchMarkerOptions.isDisplayOtherAnim = batchData.centerMarkerOptions?.isDisplayOtherCarRes ?: 0 + batchMarkerOptions.otherAnimRes = batchData.centerMarkerOptions?.otherCarRes ?: "" batchMarkerOptions.deleteRule = if (deleteStrategy) { 1 } else { @@ -555,7 +557,7 @@ class MarkerCacheController(private val mapAutoView: MapAutoView) { mLastLocationTime = System.currentTimeMillis() val satelliteTime: Long = localDataSet.centerMarkerOptions?.satelliteTime ?: System.currentTimeMillis() - val batchMarkerOptions = BatchMarkerOptions() + val batchMarkerOptions = com.zhidaoauto.map.sdk.open.renders.marker.BatchMarkerOptions() batchMarkerOptions.othersStr = localDataSet.others!! batchMarkerOptions.delayStrategy = delayStrategy batchMarkerOptions.ruleAngle = ruleAngle diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerController.kt similarity index 75% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerController.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerController.kt index 4af81a5992..5791aa29b2 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerController.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerController.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker import android.util.Log import com.alibaba.fastjson.JSON @@ -11,9 +11,11 @@ import com.zhidaoauto.map.sdk.inner.utils.OperationUtils import com.zhidaoauto.map.sdk.open.abs.OnRenderListener import com.zhidaoauto.map.sdk.open.abs.marker.InfoWindowAdapter import com.zhidaoauto.map.sdk.open.data.MapDataApi -import com.zhidaoauto.map.sdk.open.tools.MD5Utils +import com.zhidaoauto.map.sdk.open.common.tools.MD5Utils +import io.netty.buffer.Unpooled import org.json.JSONArray import org.json.JSONObject +import java.nio.charset.StandardCharsets class MarkerController(mapController: IMapController) : IMarkerController { @@ -138,43 +140,15 @@ class MarkerController(mapController: IMapController) : IMarkerController { mMarkerCall.removeInfoViewClick(id) } + /** * 批量更新他车 */ - override fun updateBatchMarkerPositon(batchMarkerOptions: BatchMarkerOptions){ + override fun updateBatchMarkerPositon(batchMarkerOptions: com.zhidaoauto.map.sdk.open.renders.marker.BatchMarkerOptions){ mMapController.getClerk()?.add("${batchMarkerOptions.list?.size},${batchMarkerOptions.othersStr.length}") - - var otherStr = batchMarkerOptions.othersStr + val byteBuffer = Unpooled.buffer() var duration:Int = batchMarkerOptions.duration - if(batchMarkerOptions.list?.isNotEmpty() == true){ - val otherBuffer = StringBuffer() - batchMarkerOptions.list?.let { - for(markerOption in it){ - if(!MapDataApi.isRightLonLat(markerOption.lon,markerOption.lat)){ - continue - } - //id,lon,lat,alt,angle,model,duration - otherBuffer.append(markerOption.id).append(",") - .append(markerOption.lon).append(",") - .append(markerOption.lat).append(",") - .append(markerOption.alt).append(",") - .append(markerOption.rotateAngle).append(",") - .append(markerOption.markerType).append(",") - .append(duration).append(",") - .append(markerOption.color).append(",") - .append(markerOption.text.trim()).append(",") - .append(markerOption.status).append(",") - .append(markerOption.grayScale).append(",") - } - if(otherBuffer.length>1){ - otherBuffer.deleteCharAt(otherBuffer.length-1) - otherStr = otherBuffer.toString() - } - } - } - - if(batchMarkerOptions.isReset){ mLastBatchSatelliteTime = 0 } @@ -187,29 +161,63 @@ class MarkerController(mapController: IMapController) : IMarkerController { } mLastBatchSatelliteTime = batchMarkerOptions.satelliteTime } - - val buffer = StringBuffer() - buffer.append(System.currentTimeMillis()).append(",") + byteBuffer.writeLongLE(System.currentTimeMillis()) if(batchMarkerOptions.delayStrategy){ - buffer.append("1").append(",") + byteBuffer.writeIntLE(1) }else{ - buffer.append("0").append(",") + byteBuffer.writeIntLE(0) + } + byteBuffer.writeLongLE((batchMarkerOptions.ruleAngle * 1e8).toLong()) + byteBuffer.writeIntLE(batchMarkerOptions.controlIcon) + byteBuffer.writeIntLE(batchMarkerOptions.deleteRule) + byteBuffer.writeIntLE(batchMarkerOptions.duration) + byteBuffer.writeIntLE(batchMarkerOptions.showInfo) + byteBuffer.writeIntLE(batchMarkerOptions.isReplaceDuration) + byteBuffer.writeIntLE(batchMarkerOptions.averageFlag) + byteBuffer.writeIntLE(batchMarkerOptions.callbackFlag) + byteBuffer.writeIntLE(batchMarkerOptions.isDisplayOtherAnim) + byteBuffer.writeIntLE(batchMarkerOptions.otherAnimRes.trim().length) + byteBuffer.writeCharSequence(batchMarkerOptions.otherAnimRes.trim(), StandardCharsets.UTF_8) + if(batchMarkerOptions.list?.isNotEmpty() == true){ + byteBuffer.writeIntLE(batchMarkerOptions.list!!.size) + batchMarkerOptions.list?.let { + for(markerOption in it){ + if(!MapDataApi.isRightLonLat(markerOption.lon,markerOption.lat)){ + continue + } + var id = markerOption.uuid.trim() + if(id.isEmpty()){ + id = "${markerOption.id}".trim() + } + val idUtf8Bytes = id.toByteArray(StandardCharsets.UTF_8) + if(idUtf8Bytes.size == 0){ + continue + } + byteBuffer.writeIntLE(idUtf8Bytes.size) + byteBuffer.writeCharSequence(id,StandardCharsets.UTF_8) + byteBuffer.writeLongLE((markerOption.lon * 1e8).toLong()) + byteBuffer.writeLongLE((markerOption.lat * 1e8).toLong()) + byteBuffer.writeLongLE((markerOption.alt * 1e8).toLong()) + byteBuffer.writeLongLE((markerOption.rotateAngle * 1e8).toLong()) + byteBuffer.writeIntLE(markerOption.markerType) + byteBuffer.writeIntLE(duration) + byteBuffer.writeIntLE(markerOption.color.length) + byteBuffer.writeCharSequence(markerOption.color,StandardCharsets.UTF_8) + byteBuffer.writeIntLE(markerOption.colorType) + val textUtf8Bytes = markerOption.text.trim().toByteArray(StandardCharsets.UTF_8) + byteBuffer.writeIntLE(textUtf8Bytes.size) + byteBuffer.writeCharSequence(markerOption.text.trim(),StandardCharsets.UTF_8) + byteBuffer.writeIntLE(markerOption.status) + byteBuffer.writeIntLE(markerOption.grayScale) + } + } } - buffer.append(batchMarkerOptions.ruleAngle).append(",") - buffer.append(batchMarkerOptions.controlIcon).append(",") - buffer.append(batchMarkerOptions.deleteRule).append(",") - buffer.append(duration).append(",") - buffer.append(batchMarkerOptions.showInfo).append(",") - buffer.append(batchMarkerOptions.isReplaceDuration).append(",") - buffer.append(batchMarkerOptions.averageFlag).append(",") - buffer.append(batchMarkerOptions.callbackFlag).append(",") - buffer.append(otherStr) if(CompileConfig.DEBUG){ Log.i(TAG, "updateBatchMarkerPositon: list:${batchMarkerOptions.list?.size}--") } //处理相关逻辑 - mMapController.updateBatchAnchorPositon(buffer.toString()) + mMapController.updateBatchAnchorPositon(byteBuffer.array()) } var isUpdate = false @@ -256,7 +264,7 @@ class MarkerController(mapController: IMapController) : IMarkerController { } val markerView = OperationUtils.fromRawResource(modelRes,mMapController.getContext()) if(markerView != null){ - MD5Utils.getInstance() + MD5Utils.getInstanse() val modelKey = MD5Utils.getMD5String(markerView) mMarkerCall.addMarkerIconCache(modelRes,modelKey) diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerDataSet.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerDataSet.kt similarity index 91% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerDataSet.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerDataSet.kt index 9fb414f473..8d07068f7a 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerDataSet.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerDataSet.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker class MarkerDataSet { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerFlashAnimation.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerFlashAnimation.kt similarity index 64% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerFlashAnimation.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerFlashAnimation.kt index 115b4d8e69..ea482a98fd 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerFlashAnimation.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerFlashAnimation.kt @@ -1,7 +1,7 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker -class MarkerFlashAnimation(icons: ArrayList<*>) : Animation() { +class MarkerFlashAnimation(icons: ArrayList<*>) : com.zhidaoauto.map.sdk.open.renders.marker.Animation() { private var icons: ArrayList<*>? = icons private var duration:Long = 0 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerInfo.java b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerInfo.java similarity index 97% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerInfo.java rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerInfo.java index f6ea6c8fed..e61f2ce579 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerInfo.java +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerInfo.java @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker; +package com.zhidaoauto.map.sdk.open.renders.marker; import com.alibaba.fastjson.annotation.JSONField; diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerOptions.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerOptions.kt similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerOptions.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerOptions.kt index f8fd225863..2a63a67b90 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerOptions.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerOptions.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker import android.graphics.Bitmap import android.text.TextUtils @@ -13,7 +13,7 @@ import com.zhidaoauto.map.sdk.inner.abs.IMarkerCall import com.zhidaoauto.map.sdk.inner.proxy.CommonProxy import com.zhidaoauto.map.sdk.inner.utils.OperationUtils import com.zhidaoauto.map.sdk.open.data.MapDataApi -import com.zhidaoauto.map.sdk.open.tools.MD5Utils +import com.zhidaoauto.map.sdk.open.common.tools.MD5Utils import java.util.UUID @@ -205,12 +205,12 @@ class MarkerOptions { } - fun updateInfowindowBitmap(markerInfoBitmap: BitmapDescriptor,mapController: IMapController?): MarkerOptions { + fun updateInfowindowBitmap(markerInfoBitmap: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor, mapController: IMapController?): MarkerOptions { val markerInfoView = markerInfoBitmap.getBytes() if(markerInfoView.isEmpty()){ return this } - MD5Utils.getInstance() + MD5Utils.getInstanse() val markerInfoMd5 = MD5Utils.getMD5String(markerInfoView) if(!markerInfoUseCache){ if(!TextUtils.isEmpty(markerInfoName) && !TextUtils.equals(markerInfoMd5,markerInfoName)){ @@ -236,7 +236,7 @@ class MarkerOptions { fun markerIcon(bitmap: Bitmap,mapController: IMapController?): MarkerOptions { val markerBitmap = BitmapDescriptorFactory.fromBitmap(bitmap) val markerView = markerBitmap.getBytes() - MD5Utils.getInstance() + MD5Utils.getInstanse() val markerIconName = MD5Utils.getMD5String(markerView) this.markerIconName = markerIconName this.vrIcon = false @@ -287,9 +287,9 @@ class MarkerOptions { return markerInfoName } - fun markerIcon(markerBitmap: BitmapDescriptor,mapController: IMapController?): MarkerOptions { + fun markerIcon(markerBitmap: com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptor, mapController: IMapController?): MarkerOptions { val markerView = markerBitmap.getBytes() - MD5Utils.getInstance() + MD5Utils.getInstanse() val markerIconName = MD5Utils.getMD5String(markerView) this.markerIconName = markerIconName this.vrIcon = false @@ -316,7 +316,7 @@ class MarkerOptions { mapController?.getContext()?.let { val markerView = BitmapDescriptorFactory.from3DResource(it, icon) markerView?.let { - MD5Utils.getInstance() + MD5Utils.getInstanse() val anchor3dName = MD5Utils.getMD5String(markerView) this.icons.add(anchor3dName) if (mapController.getMarkerCall()?.containMarkerIcon(anchor3dName) == false) { @@ -340,9 +340,9 @@ class MarkerOptions { } }else { - for (icon in icons as ArrayList ) { + for (icon in icons as ArrayList ) { val markerView = icon.getBytes() - MD5Utils.getInstance() + MD5Utils.getInstanse() val markerIconName = MD5Utils.getMD5String(markerView) this.icons.add(markerIconName) if (mapController?.getMarkerCall()?.containMarkerIcon(markerIconName) == false) { @@ -382,7 +382,7 @@ class MarkerOptions { mapController?.getContext()?.let { val markerBitmap = BitmapDescriptorFactory.fromResource(it, resId) val markerView = markerBitmap.getBytes() - MD5Utils.getInstance() + MD5Utils.getInstanse() val markerIconName = MD5Utils.getMD5String(markerView) this.markerIconName = markerIconName this.vrIcon = false @@ -412,7 +412,7 @@ class MarkerOptions { } if(markerView != null) { - MD5Utils.getInstance() + MD5Utils.getInstanse() val anchor3dName = MD5Utils.getMD5String(markerView) if (mapController?.getMarkerCall()?.containMarkerIcon(anchor3dName) == false) { @@ -461,7 +461,7 @@ class MarkerOptions { } val markerView = OperationUtils.fromRawResource(resId,mapController?.getContext()) if(markerView != null) { - MD5Utils.getInstance() + MD5Utils.getInstanse() val anchor3dName = MD5Utils.getMD5String(markerView) if (mapController?.getMarkerCall()?.containMarkerIcon(anchor3dName) == false) { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerRotateAnimation.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerRotateAnimation.kt similarity index 73% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerRotateAnimation.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerRotateAnimation.kt index 2f32f1ef1f..80832963b4 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerRotateAnimation.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerRotateAnimation.kt @@ -1,8 +1,8 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker -class MarkerRotateAnimation(private var startAng: Float, private var endAng: Float) : Animation() { +class MarkerRotateAnimation(private var startAng: Float, private var endAng: Float) : com.zhidaoauto.map.sdk.open.renders.marker.Animation() { private var duration:Long = 0 fun setDuration(duration: Long) { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerScaleAnimation.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerScaleAnimation.kt similarity index 67% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerScaleAnimation.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerScaleAnimation.kt index 65475510b1..1654970014 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerScaleAnimation.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerScaleAnimation.kt @@ -1,7 +1,7 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker -class MarkerScaleAnimation(var scaleStart: Float, var scaleEnd: Float) : Animation() { +class MarkerScaleAnimation(var scaleStart: Float, var scaleEnd: Float) : com.zhidaoauto.map.sdk.open.renders.marker.Animation() { private var duration: Long = 0 fun setDuration(duration: Long) { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerSimpleData.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerSimpleData.kt similarity index 55% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerSimpleData.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerSimpleData.kt index 74d6e8dfbe..9347795496 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerSimpleData.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerSimpleData.kt @@ -1,8 +1,10 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker class MarkerSimpleData { + var uuid: String = "" + var id: Long = 0 //经度 var lon:Double = 0.0 @@ -22,6 +24,8 @@ class MarkerSimpleData { var time: Long = 0L //颜色 var color: String = "" + //颜色设置类型 0 直接替换 1=由原色变为指定色 有方向 * 2=由指定色变为原色 有方向 * 3=由原色变为指定色 无方向 * 4=由指定色变为原色 无方向 + var colorType: Int = 0 //文本 var text: String = "" //状态 @@ -32,7 +36,7 @@ class MarkerSimpleData { override fun toString(): String { - return "MarkerSimpleData(id=$id, lon=$lon, lat=$lat, alt=$alt, speed=$speed, rotateAngle=$rotateAngle, markerType=$markerType, time=$time, color=$color)" + return "MarkerSimpleData(uuid=$uuid,id=$id, lon=$lon, lat=$lat, alt=$alt, speed=$speed, rotateAngle=$rotateAngle, markerType=$markerType, time=$time, color=$color)" } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerSimpleOptions.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerSimpleOptions.kt similarity index 81% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerSimpleOptions.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerSimpleOptions.kt index 0793d29195..f1aa265a84 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerSimpleOptions.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerSimpleOptions.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker class MarkerSimpleOptions { @@ -22,7 +22,10 @@ class MarkerSimpleOptions { var time: Long = 0 //数据接受时间 var satelliteTime: Long = 0 - + //是否显示他车动画 + var isDisplayOtherCarRes:Int = 0 + //他车动画资源 + var otherCarRes:String = "" constructor() { } constructor(id: String) { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerTranslateAnimation.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerTranslateAnimation.kt similarity index 82% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerTranslateAnimation.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerTranslateAnimation.kt index 29fcdb7d03..b93ed3a51d 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MarkerTranslateAnimation.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MarkerTranslateAnimation.kt @@ -1,8 +1,8 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker import com.zhidaoauto.map.data.point.LonLatPoint -class MarkerTranslateAnimation: Animation { +class MarkerTranslateAnimation: com.zhidaoauto.map.sdk.open.renders.marker.Animation { private var lonLatPoints = ArrayList() private var duration:Long = 0 diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MultiPointController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MultiPointController.kt similarity index 97% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MultiPointController.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MultiPointController.kt index b1dcbd2d49..d249c129ab 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MultiPointController.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MultiPointController.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker import com.alibaba.fastjson.JSONObject import com.zhidaoauto.map.data.point.LonLatPoint diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MultiPointOverlayOptions.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MultiPointOverlayOptions.kt similarity index 90% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MultiPointOverlayOptions.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MultiPointOverlayOptions.kt index fb906bd31f..ab34ef2ca1 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/MultiPointOverlayOptions.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/MultiPointOverlayOptions.kt @@ -1,10 +1,10 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker import android.util.Log import com.zhidaoauto.map.sdk.inner.CompileConfig.DEBUG import com.zhidaoauto.map.sdk.inner.abs.IMapController -import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptorFactory.fromResource -import com.zhidaoauto.map.sdk.open.tools.MD5Utils +import com.zhidaoauto.map.sdk.open.renders.marker.BitmapDescriptorFactory.fromResource +import com.zhidaoauto.map.sdk.open.common.tools.MD5Utils import java.util.UUID class MultiPointOverlayOptions { @@ -23,7 +23,7 @@ class MultiPointOverlayOptions { mapController?.getContext()?.let { val descriptor = fromResource(it, icon) val markerBytes = descriptor.getBytes() - MD5Utils.getInstance() + MD5Utils.getInstanse() this.markerIconName = MD5Utils.getMD5String(markerBytes) if (mapController.getMarkerCall()?.containMarkerIcon(markerIconName) == false) { if(DEBUG){ diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/OnAnimationListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/OnAnimationListener.kt similarity index 63% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/OnAnimationListener.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/OnAnimationListener.kt index 57a846bca6..fbc21c5ef3 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/OnAnimationListener.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/OnAnimationListener.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker interface OnAnimationListener { fun onAnimationFinish(markerId: String, type: Int) diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/OnInfoWindowClickListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/OnInfoWindowClickListener.kt similarity index 61% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/OnInfoWindowClickListener.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/OnInfoWindowClickListener.kt index 150a42a7dc..2d7a5ea0d2 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/OnInfoWindowClickListener.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/OnInfoWindowClickListener.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker interface OnInfoWindowClickListener { fun onInfoWindowClick(marker: Marker) diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/OnMarkClickListener.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/OnMarkClickListener.kt similarity index 57% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/OnMarkClickListener.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/OnMarkClickListener.kt index 00af6c5b10..fafac28742 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/marker/OnMarkClickListener.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/marker/OnMarkClickListener.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.marker +package com.zhidaoauto.map.sdk.open.renders.marker interface OnMarkClickListener { fun onMarkClick(marker: Marker) diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/polygon/Polygon3D.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/polygon/Polygon3D.kt similarity index 97% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/polygon/Polygon3D.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/polygon/Polygon3D.kt index 7022ecd6c9..bac14cc6bd 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/polygon/Polygon3D.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/polygon/Polygon3D.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.polygon +package com.zhidaoauto.map.sdk.open.renders.polygon import com.zhidaoauto.map.data.point.LonLatPoint import com.zhidaoauto.map.sdk.inner.abs.IMapController diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/polygon/Polygon3DHelper.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/polygon/Polygon3DHelper.kt similarity index 92% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/polygon/Polygon3DHelper.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/polygon/Polygon3DHelper.kt index f5a73d6c55..33b0bfa0f1 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/polygon/Polygon3DHelper.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/polygon/Polygon3DHelper.kt @@ -1,6 +1,6 @@ -package com.zhidaoauto.map.sdk.open.polygon +package com.zhidaoauto.map.sdk.open.renders.polygon -import com.zhidaoauto.map.sdk.open.tools.MapTools +import com.zhidaoauto.map.sdk.open.common.tools.MapTools import com.zhidaoauto.map.sdk.open.view.MapAutoView diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/polygon/Polygon3DOption.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/polygon/Polygon3DOption.kt similarity index 96% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/polygon/Polygon3DOption.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/polygon/Polygon3DOption.kt index 6902eddac7..f9975ff0a3 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/polygon/Polygon3DOption.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/polygon/Polygon3DOption.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.polygon +package com.zhidaoauto.map.sdk.open.renders.polygon import com.zhidaoauto.map.data.point.LonLatPoint import java.util.UUID diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/poyline/Polyline.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/poyline/Polyline.kt similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/poyline/Polyline.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/poyline/Polyline.kt index 8453d9ddd9..442df37194 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/poyline/Polyline.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/poyline/Polyline.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.poyline +package com.zhidaoauto.map.sdk.open.renders.poyline import com.alibaba.fastjson.JSON import com.alibaba.fastjson.JSONException diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/poyline/PolylineOptions.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/poyline/PolylineOptions.kt similarity index 98% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/poyline/PolylineOptions.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/poyline/PolylineOptions.kt index 021bc7a8d2..d472cffd49 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/poyline/PolylineOptions.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/renders/poyline/PolylineOptions.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open.poyline +package com.zhidaoauto.map.sdk.open.renders.poyline import android.graphics.Bitmap import android.util.Log @@ -8,7 +8,7 @@ import com.zhidaoauto.map.data.point.LonLatPoint import com.zhidaoauto.map.sdk.inner.abs.IMapController import com.zhidaoauto.map.sdk.inner.proxy.CommonProxy.Companion.getInstance import com.zhidaoauto.map.sdk.open.data.MapDataApi -import com.zhidaoauto.map.sdk.open.tools.BitmapTools.bitmapToByteArray +import com.zhidaoauto.map.sdk.open.common.tools.BitmapTools.bitmapToByteArray import java.util.UUID class PolylineOptions { diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/HDTypes.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/HDTypes.kt similarity index 95% rename from libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/HDTypes.kt rename to libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/HDTypes.kt index bc2d9a8daa..7e9091247e 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/HDTypes.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/HDTypes.kt @@ -1,4 +1,4 @@ -package com.zhidaoauto.map.sdk.open +package com.zhidaoauto.map.sdk.open.view enum class HDTypes( val type: Int diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/MapAutoView.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/MapAutoView.kt index 58bc5cdd24..f512e0bfcd 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/MapAutoView.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/MapAutoView.kt @@ -9,7 +9,6 @@ import android.util.AttributeSet import android.util.Log import android.widget.FrameLayout import com.autonavi.nge.map.* -import com.zhidao.map.net.api.Result import com.zhidaoauto.map.data.point.LonLatPoint import com.zhidaoauto.map.data.road.* import com.zhidaoauto.map.sdk.R @@ -21,6 +20,7 @@ import com.zhidaoauto.map.sdk.inner.location.LocationHelper import com.zhidaoauto.map.sdk.inner.map.MapController import com.zhidaoauto.map.sdk.inner.map.MapHdDataHelper import com.zhidaoauto.map.sdk.inner.map.MapStyleHelper +import com.zhidaoauto.map.sdk.inner.map.WeatherController import com.zhidaoauto.map.sdk.inner.panel.PanelManager import com.zhidaoauto.map.sdk.inner.road.RoadHelper import com.zhidaoauto.map.sdk.inner.traffic.TrafficHelper @@ -32,16 +32,14 @@ import com.zhidaoauto.map.sdk.open.MapAutoApi import com.zhidaoauto.map.sdk.open.MapParams import com.zhidaoauto.map.sdk.open.abs.* import com.zhidaoauto.map.sdk.open.abs.view.IMapStyleParams +import com.zhidaoauto.map.sdk.open.common.tools.MapTools import com.zhidaoauto.map.sdk.open.data.MapDataApi -import com.zhidaoauto.map.sdk.open.location.LocationClient -import com.zhidaoauto.map.sdk.open.location.LonLatPointListener -import com.zhidaoauto.map.sdk.open.location.MogoLocation -import com.zhidaoauto.map.sdk.open.marker.MarkerController -import com.zhidaoauto.map.sdk.open.marker.OnMarkClickListener -import com.zhidaoauto.map.sdk.open.tools.MapTools +import com.zhidaoauto.map.sdk.open.logics.location.LocationClient +import com.zhidaoauto.map.sdk.open.logics.location.LonLatPointListener +import com.zhidaoauto.map.sdk.open.logics.location.MogoLocation +import com.zhidaoauto.map.sdk.open.renders.marker.MarkerController +import com.zhidaoauto.map.sdk.open.renders.marker.OnMarkClickListener import com.zhidaoauto.map.sdk.open.view.MapStyleParams.Companion.MAP_PERSPECTIVE_3D -import com.zhidaoauto.map.sdk.open.weather.WeatherRepository -import com.zhidaoauto.map.sdk.open.weather.WeatherType import kotlinx.coroutines.* import java.util.* @@ -78,9 +76,9 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio private var mLocationHeading: Double = 0.0 //The status of init - private var isFirst = true + private var mIsFirst = true //The model of lock the car - private var lockMode: Boolean = true + private var mLockMode: Boolean = true //The moving status of animal private var isMoveAnim: Boolean = true @@ -90,19 +88,17 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio private var mTrafficHelper: TrafficHelper? = null //The last time of update - private var lastUpdateTime: Long = 0 + private var mLastUpdateTime: Long = 0 //The last of the last time of update - private var againLastUpdateTime: Long = 0 + private var mAgainLastUpdateTime: Long = 0 //The last time of load the info of the road private var mLastTimeRoadInfo = 0L //The interval time of load the info of the road private var mIntervalTimeRoadInfo = 3000L //The job of load the info of the road - private var roadInfoJob: Job? = null + private var mRoadInfoJob: Job? = null //The job of update Cache - private var updateCacheJob: Job? = null - //The job of update weather - private var updateWeatherJob: Job? = null + private var mUpdateCacheJob: Job? = null //The message of the update style of the map private val MSG_MAP_STYLE = 0 @@ -117,13 +113,13 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio private var mSunriseSunset: SunriseSunset? = null //The animation interval of Map - private var duration = 100 + private var mDuration = 100 //whether to set weather - private var isWeatherEnable = true - private var isFirstLocation = true - private var loopFlag: Boolean = false - private val weatherRepository by lazy { WeatherRepository() } - private var isFirstInit = true + private var mIsWeatherEnable = true + //The controller of weather + private var mWeatherController: IWeatherController? = null + + private var mIsFirstInit = true private var mDeviationAngle = 0f //The location information of the last loaded road data @@ -161,34 +157,62 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio init(context) } + /** + * 从XML属性中获取地图样式参数 + * @param context 上下文环境 + * @param attrs XML属性集合 + */ private fun obtainMapStyleParams(context: Context, attrs: AttributeSet?){ // 获取自定义属性值 val typedArray = context.obtainStyledAttributes(attrs, R.styleable.MapAutoView) + // 缩放级别,默认值为20,如果值小于9或大于23,则将其设为20 var zoom = typedArray.getInt(R.styleable.MapAutoView_zoom, 20) if(zoom < 9 || zoom > 23){ zoom = 20 } + // 车辆位置,默认为中间 val carPosition = typedArray.getFloat(R.styleable.MapAutoView_carPosition, ConstantExt.MAP_STYLE_VR_POSITION_MIDDLE) + // 是否自动切换 val isAutoSwitch = typedArray.getBoolean(R.styleable.MapAutoView_isAutoSwitch, false) + // 是否自动定位 val isAutoLocation = typedArray.getBoolean(R.styleable.MapAutoView_isAutoLocation, true) + // 地图样式模式,默认为夜间VR模式 val styleMode = typedArray.getInt(R.styleable.MapAutoView_styleMode, MapAutoApi.MAP_STYLE_NIGHT_VR) + // 透视模式,默认为3D val perspectiveMode = typedArray.getInt(R.styleable.MapAutoView_perspectiveMode, MAP_PERSPECTIVE_3D) + // VR透视模式 val vrPerspectiveMode = typedArray.getFloat(R.styleable.MapAutoView_vrPerspectiveMode, ConstantExt.MAP_STYLE_VR_OVER_LOOK_ANGLE_MIDDLE) + // VR角度模式 val vrAngleMode = typedArray.getInt(R.styleable.MapAutoView_vrAngleMode, ConstantExt.MAP_STYLE_VR_ANGLE_MIDDLE) + // 是否切换视角 val isSwitchViewAngle = typedArray.getBoolean(R.styleable.MapAutoView_isSwitchViewAngle, false) + // VR眼睛高度 val vrEyeHeight = typedArray.getFloat(R.styleable.MapAutoView_vrEyeHeight, ConstantExt.MAP_STYLE_VR_EYE_HEIGHT_MIDDLE) + // 缩放值 val zoomVal = typedArray.getFloat(R.styleable.MapAutoView_zoomVal, ConstantExt.MAP_STYLE_VR_ZOOM_VAL_MIDDLE) + // 位置变化最小距离 val minDistanceForPosition = typedArray.getFloat(R.styleable.MapAutoView_minDistanceForPosition, 0.02f) + // 是否启用阴影 val isShadowEnable = typedArray.getBoolean(R.styleable.MapAutoView_isShadowEnable, true) + // 地图样式名称 val styleName = typedArray.getString(R.styleable.MapAutoView_styleName) ?: "" + // 默认透视模式 val defaultPerspective = typedArray.getInt(R.styleable.MapAutoView_default_perspective, ConstantExt.MAP_STYLE_VR_ANGLE_MIDDLE) + // 是否启用天空盒 val isSkyBoxEnable = typedArray.getBoolean(R.styleable.MapAutoView_isSkyBoxEnable, false) + // 是否启用天气 val isWeatherEnable = typedArray.getBoolean(R.styleable.MapAutoView_isWeatherEnable, true) + // 位置图标3D资源 val locationIcon3DRes = typedArray.getResourceId(R.styleable.MapAutoView_locationIcon3DRes, R.raw.car) + // 位置图标资源 val locationIconRes = typedArray.getResourceId(R.styleable.MapAutoView_locationIconRes, R.mipmap.map_custom_self_car_night) + // 是否显示动画 val isDisplayAnim = typedArray.getBoolean(R.styleable.MapAutoView_isDisplayAnim, true) + // 回收TypedArray,以避免内存泄漏 typedArray.recycle() + // 创建地图样式参数对象 val mapStyleParams = MapStyleParams() + // 设置地图样式参数 mapStyleParams.setZoom(zoom) mapStyleParams.setCarPosition(carPosition) mapStyleParams.setAutoSwitch(isAutoSwitch) @@ -209,9 +233,11 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio mapStyleParams.setLocationIconRes(locationIconRes) mapStyleParams.setLocationIcon3DRes(locationIcon3DRes) mapStyleParams.setIsDisplayAnim(isDisplayAnim) + // 将地图样式参数设置到当前对象中 this.mMapStyleParams = mapStyleParams } + /** * init map */ @@ -222,7 +248,6 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio if(mMapStyleParams == null){ mMapStyleParams = MapStyleParams() } -// CommonController.instance.init(context) handlerInitMapView() locationClient = LocationClient(context,mMapController) locationClient?.outputLocationEnable(true) @@ -232,10 +257,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio locationClient?.start() } } - isWeatherEnable = mMapStyleParams?.isWeatherEnable()?:true - - -// mTrafficHelper = TrafficHelper() + mIsWeatherEnable = mMapStyleParams?.isWeatherEnable()?:true } /** @@ -285,7 +307,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio override fun setLockCar(lock: Boolean) { if (CompileConfig.DEBUG) { - Log.i(TAG, "autoop-lockop-mapop-lockcarop--setLockCar:${lockMode}-->${lock}:${Thread.currentThread().id}") + Log.i(TAG, "autoop-lockop-mapop-lockcarop--setLockCar:${mLockMode}-->${lock}:${Thread.currentThread().id}") } mMapController?.setLockSelfCar(lock) if (!lock) { @@ -297,11 +319,11 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio setCenter() } } - lockMode = lock + mLockMode = lock } override fun getLockCar(): Boolean { - return lockMode + return mLockMode } private fun initMapView() { @@ -344,7 +366,8 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio if (CompileConfig.DEBUG) { Log.i(TAG, "autoop-mapop-initMapView--over") } -// mHandler.sendEmptyMessage(MSG_MAP_STYLE) + mWeatherController = WeatherController(this@MapAutoView) + mWeatherController?.setWeahterEnable(mIsWeatherEnable) } fun onLocationChanged(mogoLocation: MogoLocation) { @@ -398,8 +421,8 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio if(CompileConfig.DEBUG) { Log.i(TAG, "autoop-locationop-lockop-onLocationChanged-location:${lonLatPoint}") } - if (isFirst || getLockCar()) { - isFirst = false + if (mIsFirst || getLockCar()) { + mIsFirst = false //The loading status of the map if (isLoad()) { // The loaded status @@ -436,29 +459,17 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio mogoLocation.heading= lonLatPoint.angle mEventController?.dispatchMapChangeListener(mogoLocation) extendLocationChanged(mogoLocation) - if(lastUpdateTime != 0L){ - againLastUpdateTime = lastUpdateTime + if(mLastUpdateTime != 0L){ + mAgainLastUpdateTime = mLastUpdateTime } - lastUpdateTime = System.currentTimeMillis() + mLastUpdateTime = System.currentTimeMillis() getRoadInfo(mogoLocation) isInRoadSideFenceRegion(mogoLocation) - if(isFirstInit){ - isFirstInit = false + if(mIsFirstInit){ + mIsFirstInit = false updateCacheByCityCode(mogoLocation) } - isWeatherEnable = mMapStyleParams?.isWeatherEnable()?:true - if(isWeatherEnable && isFirstLocation){ - isFirstLocation = false - loopFlag = true - getWeatherInfo() - }else if(!isWeatherEnable && loopFlag){ - loopFlag = false - isFirstLocation = true - updateWeatherJob?.cancel() - mMapController?.setWeatherType(WeatherType.DEFULT.type) - - - } + mWeatherController?.updateLocation(lonLatPoint.longitude,lonLatPoint.latitude) } fun setCenter() { @@ -529,11 +540,11 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio override fun getLastUpdateTime(): Long{ - return lastUpdateTime + return mLastUpdateTime } override fun getAgainLastUpdateTime(): Long{ - return againLastUpdateTime + return mAgainLastUpdateTime } override fun switchStyle(style: Int) { @@ -542,18 +553,18 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio private fun updateMapPosition(lonLatPoint: LonLatPoint) { - duration = lonLatPoint.duration + mDuration = lonLatPoint.duration mLocationLat = lonLatPoint.latitude mLocationLon = lonLatPoint.longitude mLocationAlt = lonLatPoint.altitude.toFloat() mLocationHeading = lonLatPoint.angle val heading = lonLatPoint.angle - if (CompileConfig.DEBUG) { - Log.i(TAG, "autoop--centerop--lockcarop:-start:${lonLatPoint}") - } +// if (CompileConfig.DEBUG) { +// Log.i(TAG, "autoop--centerop--lockcarop:-start:${lonLatPoint}") +// } if (!isMoveAnim) { - duration = 100 + mDuration = 100 } var modeHeading = -heading.toFloat() mMapStyleParams?.let { @@ -574,11 +585,8 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio } - mMapController?.animateTo(lonLatPoint.longitude, lonLatPoint.latitude, lonLatPoint.altitude.toFloat(), modeHeading, duration) + mMapController?.animateTo(lonLatPoint.longitude, lonLatPoint.latitude, lonLatPoint.altitude.toFloat(), modeHeading, mDuration) - if (CompileConfig.DEBUG) { - Log.i(TAG, "headingop --:::${heading},${modeHeading},") - } // When operating the map, the center of the map does not move according to the vehicle position if (!isMoveAnim) { isMoveAnim = true @@ -625,11 +633,10 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio mHandler.removeCallbacksAndMessages(null) locationClient?.destory() mMapAutoViewHelper?.clearPel() - roadInfoJob?.cancel() - updateCacheJob?.cancel() + mRoadInfoJob?.cancel() + mUpdateCacheJob?.cancel() - loopFlag = false - updateWeatherJob?.cancel() + mWeatherController?.destory() mPanelManager = null mMapController = null @@ -980,11 +987,10 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio // mLastRoadLonLatPoint = LonLatPoint(mogoLocation.lon,mogoLocation.lat) // 获取车道中心线数据 - RoadHelper.getInstance()?.getCenterLine( + MapDataApi.getCenterLineInfo( mogoLocation.lon, mogoLocation.lat, mogoLocation.heading.toFloat(), - true, object : IResult { override fun result(code: Int, result: CenterLine?) { @@ -994,29 +1000,27 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio result?.lane_id ) } - }) - RoadHelper.getInstance()?.getStopLine( + },true) + MapDataApi.getStopLineInfo( mogoLocation.lon, mogoLocation.lat, mogoLocation.heading.toFloat(), - true, object : IResult { override fun result(code: Int, result: StopLine?) { mEventController?.dispatchStopLineInfo(result) } - }) - RoadHelper.getInstance()?.getCrossRoad( + },true) + MapDataApi.getCrossRoad( mogoLocation.lon, mogoLocation.lat, mogoLocation.heading.toFloat(), - true, object : IResult { override fun result(code: Int, result: RoadCross?) { mEventController?.dispatchRoadCrossInfo(result) } - }) + },true) } } @@ -1048,7 +1052,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio RoadHelper.getInstance()?.cancelTask() } } - RoadHelper.getInstance()?.isInRoadSideFenceRegion( + MapDataApi.isInRoadSideFenceRegion( mogoLocation.lon, mogoLocation.lat, object : IResult { @@ -1059,7 +1063,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio mEventController?.dispatchRoadSideFenceRegionListener(it) } } - }) + },true) } @@ -1070,52 +1074,19 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio } fun setWeatherEnable(isEnable: Boolean){ - isWeatherEnable = isEnable + mIsWeatherEnable = isEnable mMapStyleParams?.setWeatherEnable(isEnable) + mWeatherController?.setWeahterEnable(isEnable) } private fun updateCacheByCityCode(mogoLocation: MogoLocation){ - updateCacheJob?.cancel() - updateCacheJob = mMapController?.getScope()?.launch(Dispatchers.IO) { + mUpdateCacheJob?.cancel() + mUpdateCacheJob = mMapController?.getScope()?.launch(Dispatchers.IO) { RoadHelper.getInstance()?.initFileCacheByCity(mogoLocation.lon,mogoLocation.lat) } } - private fun getWeatherInfo(){ - updateWeatherJob?.cancel() - updateWeatherJob = mMapController?.getScope()?.launch(Dispatchers.IO) { - while (loopFlag) { - if (MapDataApi.isRightLonLat(mLocationLon, mLocationLat)) { - val result = weatherRepository.getInfo(mLocationLon, mLocationLat) - if (CompileConfig.DEBUG) { - Log.d(TAG, "getWeatherInfo--result: $result") - } - - if (result is Result.Success) { - val weatherInfo = result.data - val rainSet = setOf("小雨", "中雨", "大雨","暴雨") - val snowSet = setOf("小雪", "中雪", "大雪","暴雪") - if(rainSet.contains(weatherInfo.weather)) { - mMapController?.setWeatherType(WeatherType.RAIN.type) - }else if(snowSet.contains(weatherInfo.weather)){ - mMapController?.setWeatherType(WeatherType.SNOW.type) - }else{ - mMapController?.setWeatherType(WeatherType.DEFULT.type) - } - delay(15 * 60 * 1000) - - } else { - if (CompileConfig.DEBUG) { - Log.d(TAG, "获取天气信息失败!") - } - } - } - delay(10000) - } - } - } - /** * 设置正北模式地图偏转角度 * @param deviationAngle @@ -1123,5 +1094,8 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio fun setDeviationAngle(deviationAngle:Float){ mDeviationAngle = deviationAngle } + fun getMapView():MapView?{ + return mMapView; + } } \ No newline at end of file diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/MapAutoViewHelper.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/MapAutoViewHelper.kt index 5c578b505f..fd5b3fa772 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/MapAutoViewHelper.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/MapAutoViewHelper.kt @@ -10,27 +10,27 @@ import com.zhidaoauto.map.sdk.inner.proxy.CommonProxy import com.zhidaoauto.map.sdk.inner.utils.TransformUtils import com.zhidaoauto.map.sdk.open.MapAutoApi import com.zhidaoauto.map.sdk.open.abs.marker.InfoWindowAdapter -import com.zhidaoauto.map.sdk.open.camera.CameraPosition -import com.zhidaoauto.map.sdk.open.camera.CameraUpdate -import com.zhidaoauto.map.sdk.open.camera.MapCameraMessage -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.exception.NotImplementException -import com.zhidaoauto.map.sdk.open.location.MogoLocation -import com.zhidaoauto.map.sdk.open.location.MyLocationStyle -import com.zhidaoauto.map.sdk.open.marker.Marker -import com.zhidaoauto.map.sdk.open.marker.MarkerOptions -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.WeatherResult +import com.zhidaoauto.map.sdk.open.logics.camera.CameraPosition +import com.zhidaoauto.map.sdk.open.logics.camera.CameraUpdate +import com.zhidaoauto.map.sdk.open.logics.camera.MapCameraMessage +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.common.exception.NotImplementException +import com.zhidaoauto.map.sdk.open.logics.location.MogoLocation +import com.zhidaoauto.map.sdk.open.logics.location.MyLocationStyle +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.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.open.logics.weather.WeatherResult class MapAutoViewHelper(mapAutoView: MapAutoView) { private val mMapAutoView: MapAutoView - companion object{ + companion object { private const val TAG = "MapAutoViewHelper" } @@ -427,7 +427,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) { /** * 设置地图模式 * - * @param stylemode 视图模式 0: 日间模式 1:夜间模式 2:SATEL模式 3:日间导航模式 4:夜间导航模式 5:夜间vr模式 6 默认白天模式 7 小巴车白天VR 8 Taxi白天 + * @param stylemode 视图模式 0: 日间模式 1:夜间模式 2:SATEL模式 3:日间导航模式 4:夜间导航模式 */ fun setMapStyle(stylemode: Int) { if (CompileConfig.DEBUG) { @@ -543,13 +543,20 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) { } //关闭所有手势 - fun setAllGesturesEnabled(boolean: Boolean) { + fun setAllGesturesEnabled(flag: Boolean) { mMapAutoView.getClerk()?.add() - setZoomGesturesEnabled(boolean) - setScrollGesturesEnabled(boolean) - setTiltGesturesEnabled(boolean) - setRotateGesturesEnabled(boolean) + mMapAutoView.getMapController()?.setCanZoom(flag) + mMapAutoView.getMapController()?.setScroll(flag) + mMapAutoView.getMapController()?.setFling(flag) + mMapAutoView.getMapController()?.setRotate(flag) + } + /** + * 设置地图的触摸事件开关 + * @param flag + */ + fun setTouchEnable(flag:Boolean){ + mMapAutoView.isEnabled = flag } /** @@ -1523,7 +1530,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) { mMapAutoView.getMapStyleParams()?.setVrAngleDefaultMode(mode) } - //设置显示高精元素 + fun setHDTypeVisible(type: IntArray?){ mMapAutoView.getMapController()?.setHDTypeVisible(type) } diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/MapStyleParams.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/MapStyleParams.kt index c97ec09675..f5d3ef15de 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/MapStyleParams.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/open/view/MapStyleParams.kt @@ -3,7 +3,6 @@ package com.zhidaoauto.map.sdk.open.view import com.zhidaoauto.map.sdk.R import com.zhidaoauto.map.sdk.inner.common.ConstantExt import com.zhidaoauto.map.sdk.inner.map.MapController -import com.zhidaoauto.map.sdk.open.HDTypes import com.zhidaoauto.map.sdk.open.MapAutoApi import com.zhidaoauto.map.sdk.open.abs.view.IMapStyleParams @@ -101,7 +100,7 @@ class MapStyleParams: IMapStyleParams { private var isWeatherEnable = false //是否使用光圈 - private var isDisplayAnim = true + private var isDisplayAnim = false companion object { diff --git a/libraries/mapmodule/src/main/res/layout/dialog_wait.xml b/libraries/mapmodule/src/main/res/layout/dialog_wait.xml index 9374ab3398..1305ae6ee8 100644 --- a/libraries/mapmodule/src/main/res/layout/dialog_wait.xml +++ b/libraries/mapmodule/src/main/res/layout/dialog_wait.xml @@ -33,7 +33,7 @@ android:layout_marginTop="13dp" android:layout_marginRight="15dp"> - diff --git a/libraries/mapmodule/src/main/res/layout/view_trafficbar.xml b/libraries/mapmodule/src/main/res/layout/view_trafficbar.xml index f5615934a9..1a1a76b84f 100644 --- a/libraries/mapmodule/src/main/res/layout/view_trafficbar.xml +++ b/libraries/mapmodule/src/main/res/layout/view_trafficbar.xml @@ -8,7 +8,7 @@ android:layout_height="match_parent" android:layout_marginBottom="24dp"> -