[map-sdk]merge地图版本 3.2.1.4
This commit is contained in:
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
#Fri Sep 22 11:53:55 CST 2023
|
#Fri Sep 22 11:53:55 CST 2023
|
||||||
distributionBase=GRADLE_USER_HOME
|
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
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ class MapBox {
|
|||||||
external fun cancelTask()
|
external fun cancelTask()
|
||||||
external fun llaRelease()
|
external fun llaRelease()
|
||||||
|
|
||||||
|
external fun isInRoadSideFenceRegion(lon: Double, lat: Double, isCancel: Boolean = false)
|
||||||
|
|
||||||
fun resultCallbackByteStream(key: String?, result: ByteArray?) {
|
fun resultCallbackByteStream(key: String?, result: ByteArray?) {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
// Log.d(TAG, "roadop--resultCallbackDouble: " +"key:" + key + " + " result:"+ result.length);
|
// Log.d(TAG, "roadop--resultCallbackDouble: " +"key:" + key + " + " result:"+ result.length);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//package com.autonavi.nge.dm;
|
package com.autonavi.nge.dm;//package com.autonavi.nge.dm;
|
||||||
//
|
//
|
||||||
//import android.os.RemoteException;
|
//import android.os.RemoteException;
|
||||||
//import android.util.Log;
|
//import android.util.Log;
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ public class SharedMemoryService {
|
|||||||
|
|
||||||
private void init(Context context) {
|
private void init(Context context) {
|
||||||
|
|
||||||
HDMapProvider.setDataFileSource(MapHelper.INSTANCE.getMMapParams().getDataFileSource());
|
|
||||||
HDMapProvider.setDataRedisSource(MapHelper.INSTANCE.getMMapParams().getDataRedisFileSource());
|
HDMapProvider.setDataRedisSource(MapHelper.INSTANCE.getMMapParams().getDataRedisFileSource());
|
||||||
if (!TextUtils.isEmpty(MapHelper.INSTANCE.getMMapParams().getHdMapPath())) {
|
if (!TextUtils.isEmpty(MapHelper.INSTANCE.getMMapParams().getHdMapPath())) {
|
||||||
HDMapProvider.setDataDir(MapHelper.INSTANCE.getMMapParams().getHdMapPath());
|
HDMapProvider.setDataDir(MapHelper.INSTANCE.getMMapParams().getHdMapPath());
|
||||||
@@ -65,6 +64,7 @@ public class SharedMemoryService {
|
|||||||
Log.i(TAG, "autoop-dir:" + dir+",SharedMemory--cachePath:"+cachePath);
|
Log.i(TAG, "autoop-dir:" + dir+",SharedMemory--cachePath:"+cachePath);
|
||||||
}
|
}
|
||||||
initSharedMemory_Native(dir,MapHelper.INSTANCE.getMMapParams().getStyleDir(),cachePath,MapHelper.INSTANCE.getMMapParams().getQZoneFilterArray());
|
initSharedMemory_Native(dir,MapHelper.INSTANCE.getMMapParams().getStyleDir(),cachePath,MapHelper.INSTANCE.getMMapParams().getQZoneFilterArray());
|
||||||
|
HDMapProvider.setDataFileSource(MapHelper.INSTANCE.getMMapParams().getDataFileSource());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//package com.autonavi.nge.guidance;
|
package com.autonavi.nge.guidance;//package com.autonavi.nge.guidance;
|
||||||
//
|
//
|
||||||
//import android.util.Log;
|
//import android.util.Log;
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -713,10 +713,10 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
|||||||
// setStyleDir("sdcard/shmdata/style")
|
// setStyleDir("sdcard/shmdata/style")
|
||||||
val styleMode = mMapStyleParams.getStyleMode()
|
val styleMode = mMapStyleParams.getStyleMode()
|
||||||
val dir = Constant.nDSDataPath
|
val dir = Constant.nDSDataPath
|
||||||
mMapEngine.setIsEnableShadow(mMapStyleParams.isShadowEnable())
|
|
||||||
if(!loadP(dir)){
|
if(!loadP(dir)){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
mMapEngine.setIsEnableShadow(mMapStyleParams.isShadowEnable())
|
||||||
loadOverCallbak()
|
loadOverCallbak()
|
||||||
if(mMapStyleParams.getHDVisibileArray().isNotEmpty()){
|
if(mMapStyleParams.getHDVisibileArray().isNotEmpty()){
|
||||||
mMapEngine.setHDTypeVisibile(mMapStyleParams.getHDVisibileArray())
|
mMapEngine.setHDTypeVisibile(mMapStyleParams.getHDVisibileArray())
|
||||||
@@ -975,7 +975,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
|||||||
//Marker Event
|
//Marker Event
|
||||||
markerEvent(e)
|
markerEvent(e)
|
||||||
|
|
||||||
if (mEventController?.isMarkClickListenerListEmpty() == false) {
|
if (mEventController?.isMapClickListenerListEmpty() == false) {
|
||||||
val x = e.x.toInt()
|
val x = e.x.toInt()
|
||||||
val y = e.y.toInt()
|
val y = e.y.toInt()
|
||||||
val latLonPoint = MapTools.fromScreenLocation(Point(x, y),mMapController)
|
val latLonPoint = MapTools.fromScreenLocation(Point(x, y),mMapController)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import com.zhidaoauto.map.sdk.open.abs.OnMapTouchListener
|
|||||||
import com.zhidaoauto.map.sdk.open.abs.OnMapViewVisualAngleChangeListener
|
import com.zhidaoauto.map.sdk.open.abs.OnMapViewVisualAngleChangeListener
|
||||||
import com.zhidaoauto.map.sdk.open.abs.OnRenderListener
|
import com.zhidaoauto.map.sdk.open.abs.OnRenderListener
|
||||||
import com.zhidaoauto.map.sdk.open.abs.OnRoadInfoListener
|
import com.zhidaoauto.map.sdk.open.abs.OnRoadInfoListener
|
||||||
|
import com.zhidaoauto.map.sdk.open.abs.OnRoadSideFenceRegionListener
|
||||||
import com.zhidaoauto.map.sdk.open.abs.OnRoamStatusListener
|
import com.zhidaoauto.map.sdk.open.abs.OnRoamStatusListener
|
||||||
import com.zhidaoauto.map.sdk.open.abs.OnScrollListener
|
import com.zhidaoauto.map.sdk.open.abs.OnScrollListener
|
||||||
import com.zhidaoauto.map.sdk.open.abs.log.ILog
|
import com.zhidaoauto.map.sdk.open.abs.log.ILog
|
||||||
@@ -84,4 +85,8 @@ interface IEventController {
|
|||||||
fun removeRoamStatusListener(onRoamStatusListener: OnRoamStatusListener)
|
fun removeRoamStatusListener(onRoamStatusListener: OnRoamStatusListener)
|
||||||
|
|
||||||
fun dispatchRoamStatusListener(status: Int, msg: String)
|
fun dispatchRoamStatusListener(status: Int, msg: String)
|
||||||
|
|
||||||
|
fun addRoadSideFenceRegionListener(onRoadSideFenceRegionListener: OnRoadSideFenceRegionListener)
|
||||||
|
fun removeRoadSideFenceRegionListener(onRoadSideFenceRegionListener: OnRoadSideFenceRegionListener)
|
||||||
|
fun dispatchRoadSideFenceRegionListener(status: Int)
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@ package com.zhidaoauto.map.sdk.inner.byteh;
|
|||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
@@ -41,7 +40,7 @@ public class PayloadDecoder {
|
|||||||
|
|
||||||
case "java.lang.Character":
|
case "java.lang.Character":
|
||||||
case "char":
|
case "char":
|
||||||
CharSequence charSequence = buffer.readCharSequence(fieldWrapper.getCodecProprety().length(), StandardCharsets.UTF_8);
|
CharSequence charSequence = buffer.readCharSequence(fieldWrapper.getCodecProprety().length(), Charset.forName("UTF-8"));
|
||||||
field.set(instance, charSequence);
|
field.set(instance, charSequence);
|
||||||
break;
|
break;
|
||||||
case "java.lang.Byte":
|
case "java.lang.Byte":
|
||||||
@@ -75,7 +74,7 @@ public class PayloadDecoder {
|
|||||||
field.set(instance, readDouble);
|
field.set(instance, readDouble);
|
||||||
break;
|
break;
|
||||||
case "java.lang.String":
|
case "java.lang.String":
|
||||||
String readString = buffer.readCharSequence(fieldWrapper.getCodecProprety().length(), StandardCharsets.UTF_8).toString();
|
String readString = buffer.readCharSequence(fieldWrapper.getCodecProprety().length(), Charset.forName("UTF-8")).toString();
|
||||||
field.set(instance, readString);
|
field.set(instance, readString);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.zhidaoauto.map.sdk.inner.byteh;
|
|||||||
import com.autonavi.nge.map.LonLat;
|
import com.autonavi.nge.map.LonLat;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.Charset;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
@@ -13,7 +13,7 @@ public class PayloadEncoder {
|
|||||||
public static <T extends Codecable> byte[] getPayload(T command) {
|
public static <T extends Codecable> byte[] getPayload(T command) {
|
||||||
List<FieldWrapper> fieldWrapperList = command.getFieldWrapperList();
|
List<FieldWrapper> fieldWrapperList = command.getFieldWrapperList();
|
||||||
ByteBuf buffer = Unpooled.buffer();
|
ByteBuf buffer = Unpooled.buffer();
|
||||||
for (FieldWrapper fieldWrapper : fieldWrapperList) {
|
for(FieldWrapper fieldWrapper :fieldWrapperList){
|
||||||
write2ByteBuf(fieldWrapper, command, buffer);
|
write2ByteBuf(fieldWrapper, command, buffer);
|
||||||
}
|
}
|
||||||
return buffer.array();
|
return buffer.array();
|
||||||
@@ -36,9 +36,6 @@ public class PayloadEncoder {
|
|||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
new RuntimeException("反射获取值失败,filed:" + field.getName(), e);
|
new RuntimeException("反射获取值失败,filed:" + field.getName(), e);
|
||||||
}
|
}
|
||||||
if (value == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
switch (typeName) {
|
switch (typeName) {
|
||||||
case "com.autonavi.nge.map.LonLat":
|
case "com.autonavi.nge.map.LonLat":
|
||||||
LonLat lonLat = (LonLat) value;
|
LonLat lonLat = (LonLat) value;
|
||||||
@@ -53,9 +50,7 @@ public class PayloadEncoder {
|
|||||||
case "java.lang.Character":
|
case "java.lang.Character":
|
||||||
case "kotlin.Character":
|
case "kotlin.Character":
|
||||||
case "char":
|
case "char":
|
||||||
case "java.lang.String":
|
buffer.writeCharSequence((CharSequence) value, Charset.forName("UTF-8"));
|
||||||
case "kotlin.String":
|
|
||||||
buffer.writeCharSequence((CharSequence) value, StandardCharsets.UTF_8);
|
|
||||||
break;
|
break;
|
||||||
case "java.lang.Byte":
|
case "java.lang.Byte":
|
||||||
case "kotlin.Byte":
|
case "kotlin.Byte":
|
||||||
@@ -87,6 +82,10 @@ public class PayloadEncoder {
|
|||||||
case "double":
|
case "double":
|
||||||
buffer.writeDouble((double) value);
|
buffer.writeDouble((double) value);
|
||||||
break;
|
break;
|
||||||
|
case "java.lang.String":
|
||||||
|
case "kotlin.String":
|
||||||
|
buffer.writeCharSequence((CharSequence) value, Charset.forName("UTF-8"));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new RuntimeException(typeName + "不支持,bug");
|
throw new RuntimeException(typeName + "不支持,bug");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import com.zhidaoauto.map.sdk.open.abs.OnMapTouchListener
|
|||||||
import com.zhidaoauto.map.sdk.open.abs.OnMapViewVisualAngleChangeListener
|
import com.zhidaoauto.map.sdk.open.abs.OnMapViewVisualAngleChangeListener
|
||||||
import com.zhidaoauto.map.sdk.open.abs.OnRenderListener
|
import com.zhidaoauto.map.sdk.open.abs.OnRenderListener
|
||||||
import com.zhidaoauto.map.sdk.open.abs.OnRoadInfoListener
|
import com.zhidaoauto.map.sdk.open.abs.OnRoadInfoListener
|
||||||
|
import com.zhidaoauto.map.sdk.open.abs.OnRoadSideFenceRegionListener
|
||||||
import com.zhidaoauto.map.sdk.open.abs.OnRoamStatusListener
|
import com.zhidaoauto.map.sdk.open.abs.OnRoamStatusListener
|
||||||
import com.zhidaoauto.map.sdk.open.abs.OnScrollListener
|
import com.zhidaoauto.map.sdk.open.abs.OnScrollListener
|
||||||
import com.zhidaoauto.map.sdk.open.abs.log.ILog
|
import com.zhidaoauto.map.sdk.open.abs.log.ILog
|
||||||
@@ -46,6 +47,7 @@ class MapEventController(): IEventController {
|
|||||||
private var mRoadInfoListenerList : ArrayList<OnRoadInfoListener>? = null
|
private var mRoadInfoListenerList : ArrayList<OnRoadInfoListener>? = null
|
||||||
private var mLogListenerList : ArrayList<ILog>? = null
|
private var mLogListenerList : ArrayList<ILog>? = null
|
||||||
private var mRoamStatusListenerList: ArrayList<OnRoamStatusListener>? = null
|
private var mRoamStatusListenerList: ArrayList<OnRoamStatusListener>? = null
|
||||||
|
private var mRoamRegionListenerList: ArrayList<OnRoadSideFenceRegionListener>? = null
|
||||||
|
|
||||||
|
|
||||||
override fun exit(){
|
override fun exit(){
|
||||||
@@ -85,6 +87,8 @@ class MapEventController(): IEventController {
|
|||||||
mLogListenerList = null
|
mLogListenerList = null
|
||||||
mRoamStatusListenerList?.clear()
|
mRoamStatusListenerList?.clear()
|
||||||
mRoamStatusListenerList = null
|
mRoamStatusListenerList = null
|
||||||
|
mRoamRegionListenerList?.clear()
|
||||||
|
mRoamRegionListenerList = null
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun addCameraChangeListener(cameraChangeListener: OnCameraChangeListener){
|
override fun addCameraChangeListener(cameraChangeListener: OnCameraChangeListener){
|
||||||
@@ -539,4 +543,27 @@ class MapEventController(): IEventController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun addRoadSideFenceRegionListener(onRoadSideFenceRegionListener: OnRoadSideFenceRegionListener) {
|
||||||
|
if(mRoamRegionListenerList == null){
|
||||||
|
mRoamRegionListenerList = ArrayList()
|
||||||
|
}
|
||||||
|
if(!mRoamRegionListenerList!!.contains(onRoadSideFenceRegionListener)) {
|
||||||
|
mRoamRegionListenerList?.add(onRoadSideFenceRegionListener)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun removeRoadSideFenceRegionListener(onRoadSideFenceRegionListener: OnRoadSideFenceRegionListener) {
|
||||||
|
mRoamRegionListenerList?.let {
|
||||||
|
it.remove(onRoadSideFenceRegionListener)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun dispatchRoadSideFenceRegionListener(status: Int) {
|
||||||
|
mRoamRegionListenerList?.let {
|
||||||
|
for(listener in it){
|
||||||
|
listener.isInRoadSideFenceRegion(status)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1025,7 +1025,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
|||||||
val data = polylineOptions.lonLats
|
val data = polylineOptions.lonLats
|
||||||
var polyline: Polyline? = null
|
var polyline: Polyline? = null
|
||||||
try {
|
try {
|
||||||
if (data.size <= 1) {
|
if (data == null || data.size <= 1) {
|
||||||
throw RuntimeException("传入的坐标数必须大于1")
|
throw RuntimeException("传入的坐标数必须大于1")
|
||||||
}
|
}
|
||||||
val strOptionsJson = JSON.toJSONString(polylineOptions)
|
val strOptionsJson = JSON.toJSONString(polylineOptions)
|
||||||
@@ -1054,7 +1054,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
|||||||
val colorSize = colorValues?.size ?: 0
|
val colorSize = colorValues?.size ?: 0
|
||||||
var polyline: Polyline? = null
|
var polyline: Polyline? = null
|
||||||
try {
|
try {
|
||||||
if (data.size <= 1) {
|
if (data == null || data.size <= 1) {
|
||||||
throw RuntimeException("传入的坐标数必须大于1")
|
throw RuntimeException("传入的坐标数必须大于1")
|
||||||
}
|
}
|
||||||
if (polylineOptions.getIsGradient() && colorSize > data.size) {
|
if (polylineOptions.getIsGradient() && colorSize > data.size) {
|
||||||
@@ -1090,7 +1090,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
|||||||
val data = deadZoneOptions.getPosition()
|
val data = deadZoneOptions.getPosition()
|
||||||
var deadZone: DeadZone? = null
|
var deadZone: DeadZone? = null
|
||||||
try {
|
try {
|
||||||
if (data.size <= 1) {
|
if (data == null || data.size <= 1) {
|
||||||
throw RuntimeException("传入的坐标数必须大于1")
|
throw RuntimeException("传入的坐标数必须大于1")
|
||||||
}
|
}
|
||||||
val strOptionsJson = JSON.toJSONString(deadZoneOptions)
|
val strOptionsJson = JSON.toJSONString(deadZoneOptions)
|
||||||
|
|||||||
@@ -804,6 +804,9 @@ class RoadHelper private constructor() {
|
|||||||
mapBox.llaGetCrossRoadById(tileId,id)
|
mapBox.llaGetCrossRoadById(tileId,id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fun initFileCacheByCity( lon :Double, lat: Double){
|
fun initFileCacheByCity( lon :Double, lat: Double){
|
||||||
mapBox.initFileCacheByCity(lon, lat)
|
mapBox.initFileCacheByCity(lon, lat)
|
||||||
}
|
}
|
||||||
@@ -1228,4 +1231,35 @@ class RoadHelper private constructor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun isInRoadSideFenceRegion(lon: Double, lat: Double, call: IResult<Int>){
|
||||||
|
val time = System.currentTimeMillis()
|
||||||
|
val key = "isInRoadSideFenceRegion_${lon.toTenDecimalsStr()}_${lat.toTenDecimalsStr()}_${RoadResultController.CANCELTAG}false"
|
||||||
|
RoadResultController.instance.addRoadResultListener(key,object :IRoadData{
|
||||||
|
|
||||||
|
override fun result(code: Int, result: ByteArray?) {
|
||||||
|
|
||||||
|
if (CompileConfig.DEBUG) {
|
||||||
|
Log.d(TAG, "roadop--isInRoadSideFenceRegion-costTime${System.currentTimeMillis()-time}")
|
||||||
|
Log.d(TAG, "roadop--isInRoadSideFenceRegion-${key}-code:${code},result: $result")
|
||||||
|
}
|
||||||
|
if (result?.isEmpty() == true){
|
||||||
|
call.result(1,0)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
result?.let {
|
||||||
|
val buf = ByteBufferHelper.bytes2ByteBuffer(result)
|
||||||
|
|
||||||
|
buf?.let {
|
||||||
|
call.result(code, buf.int)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
call.result(code,0)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
mapBox.isInRoadSideFenceRegion(lon, lat)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -83,6 +83,8 @@ public class AMapUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否有GPS
|
* 是否有GPS
|
||||||
|
* @param context
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public static boolean hasGPSDevice(Context context) {
|
public static boolean hasGPSDevice(Context context) {
|
||||||
final LocationManager mgr = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
final LocationManager mgr = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||||
@@ -90,7 +92,10 @@ public class AMapUtils {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final List<String> providers = mgr.getAllProviders();
|
final List<String> providers = mgr.getAllProviders();
|
||||||
return providers != null && providers.contains(LocationManager.GPS_PROVIDER);
|
if (providers == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return providers.contains(LocationManager.GPS_PROVIDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -33,9 +33,11 @@ public class MainInfo {
|
|||||||
if (null == dir) {
|
if (null == dir) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try(FileWriter fw = new FileWriter((dir + "log.txt"), true)) {
|
try {
|
||||||
|
FileWriter fw = new FileWriter((dir + "log.txt"), true);
|
||||||
String date = dateFormat.format(new Date());
|
String date = dateFormat.format(new Date());
|
||||||
fw.write(date + " " + log + "\r\n");
|
fw.write(date + " " + log + "\r\n");
|
||||||
|
fw.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,8 +50,10 @@ public class MainInfo {
|
|||||||
if (null == dir) {
|
if (null == dir) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try(FileWriter fw = new FileWriter((dir + "log.txt"), true)) {
|
try {
|
||||||
|
FileWriter fw = new FileWriter((dir + "log.txt"), true);
|
||||||
e.printStackTrace(new PrintWriter(fw));
|
e.printStackTrace(new PrintWriter(fw));
|
||||||
|
fw.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package com.zhidaoauto.map.sdk.open.abs
|
||||||
|
|
||||||
|
interface OnRoadSideFenceRegionListener {
|
||||||
|
fun isInRoadSideFenceRegion(status: Int)
|
||||||
|
}
|
||||||
@@ -389,6 +389,10 @@ object MapDataApi {
|
|||||||
RoadHelper.getInstance()?.removeHdDataDownListener(id)
|
RoadHelper.getInstance()?.removeHdDataDownListener(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun isInRoadSideFenceRegion(lon: Double, lat: Double, call:IResult<Int>){
|
||||||
|
RoadHelper.getInstance()?.isInRoadSideFenceRegion(lon,lat, call)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -336,6 +336,10 @@ public class BlurView extends View {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom draw the blurred bitmap and color to define your own shape
|
* Custom draw the blurred bitmap and color to define your own shape
|
||||||
|
*
|
||||||
|
* @param canvas
|
||||||
|
* @param blurredBitmap
|
||||||
|
* @param overlayColor
|
||||||
*/
|
*/
|
||||||
protected void drawBlurredBitmap(Canvas canvas, Bitmap blurredBitmap, int overlayColor) {
|
protected void drawBlurredBitmap(Canvas canvas, Bitmap blurredBitmap, int overlayColor) {
|
||||||
if (blurredBitmap != null) {
|
if (blurredBitmap != null) {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class MarkerCacheController(private val mapAutoView: MapAutoView) {
|
|||||||
private var lastPreTime = 0L
|
private var lastPreTime = 0L
|
||||||
|
|
||||||
//显示infowindow
|
//显示infowindow
|
||||||
var showInfo: Boolean = true
|
var showInfo: Boolean = false
|
||||||
|
|
||||||
init {
|
init {
|
||||||
lastPreTime = 0L
|
lastPreTime = 0L
|
||||||
|
|||||||
@@ -125,9 +125,15 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
|||||||
private val weatherRepository by lazy { WeatherRepository() }
|
private val weatherRepository by lazy { WeatherRepository() }
|
||||||
private var isFirstInit = true
|
private var isFirstInit = true
|
||||||
|
|
||||||
|
private var mDeviationAngle = 0f
|
||||||
//The location information of the last loaded road data
|
//The location information of the last loaded road data
|
||||||
private var mLastRoadLonLatPoint:LonLatPoint? = null
|
private var mLastRoadLonLatPoint:LonLatPoint? = null
|
||||||
|
//The interval time of load the info of the road side fence
|
||||||
|
private var mIntervalTimeRoadSideFence = 5000
|
||||||
|
//The last time of load the info of the road side fence
|
||||||
|
private var mLastTimeRoadSideFence = 0L
|
||||||
|
//The location information of the last loaded road side fence data
|
||||||
|
private var mLastRoadSideFenceLonLatPoint:LonLatPoint? = null
|
||||||
constructor(context: Context) : super(context) {
|
constructor(context: Context) : super(context) {
|
||||||
initView()
|
initView()
|
||||||
}
|
}
|
||||||
@@ -435,6 +441,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
|||||||
}
|
}
|
||||||
lastUpdateTime = System.currentTimeMillis()
|
lastUpdateTime = System.currentTimeMillis()
|
||||||
getRoadInfo(mogoLocation)
|
getRoadInfo(mogoLocation)
|
||||||
|
isInRoadSideFenceRegion(mogoLocation)
|
||||||
if(isFirstInit){
|
if(isFirstInit){
|
||||||
isFirstInit = false
|
isFirstInit = false
|
||||||
updateCacheByCityCode(mogoLocation)
|
updateCacheByCityCode(mogoLocation)
|
||||||
@@ -552,7 +559,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
|||||||
mMapStyleParams?.let {
|
mMapStyleParams?.let {
|
||||||
when (it.getPerspectiveMode()) {
|
when (it.getPerspectiveMode()) {
|
||||||
MapParams.MAP_PERSPECTIVE_UP_NORTH -> {
|
MapParams.MAP_PERSPECTIVE_UP_NORTH -> {
|
||||||
modeHeading = 0.0f
|
modeHeading = -mDeviationAngle
|
||||||
mMapController?.setSelfLocaionControl(MapAutoApi.MAP_PERSPECTIVE_UP_NORTH)
|
mMapController?.setSelfLocaionControl(MapAutoApi.MAP_PERSPECTIVE_UP_NORTH)
|
||||||
}
|
}
|
||||||
MapParams.MAP_PERSPECTIVE_UP_CAR -> {
|
MapParams.MAP_PERSPECTIVE_UP_CAR -> {
|
||||||
@@ -905,6 +912,25 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
|||||||
mEventController?.removeRoamStatusListener(onRoamStatusListener)
|
mEventController?.removeRoamStatusListener(onRoamStatusListener)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setOnRoadSideFenceRegionListener(roadSideFenceRegionListener: OnRoadSideFenceRegionListener, intervalTime: Int){
|
||||||
|
mMapController?.getClerk()?.add()
|
||||||
|
if(mEventController == null){
|
||||||
|
mEventController = MapEventController()
|
||||||
|
}
|
||||||
|
mEventController?.addRoadSideFenceRegionListener(roadSideFenceRegionListener)
|
||||||
|
mIntervalTimeRoadSideFence = if(intervalTime == 0){
|
||||||
|
return
|
||||||
|
}else if(intervalTime < 5000){
|
||||||
|
5000
|
||||||
|
}else {
|
||||||
|
intervalTime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun removeOnRoamStatusListener(roadSideFenceRegionListener: OnRoadSideFenceRegionListener){
|
||||||
|
mMapController?.getClerk()?.add()
|
||||||
|
mEventController?.removeRoadSideFenceRegionListener(roadSideFenceRegionListener)
|
||||||
|
}
|
||||||
override fun onRoadLoaded(
|
override fun onRoadLoaded(
|
||||||
tileId: Int, leftTopLon: Double, leftTopLat: Double, leftBottomLon: Double, leftBottomLat: Double,
|
tileId: Int, leftTopLon: Double, leftTopLat: Double, leftBottomLon: Double, leftBottomLat: Double,
|
||||||
rightTopLon: Double, rightTopLat: Double, rightBottomLon: Double, rightBottomLat: Double, roadInfo: String?
|
rightTopLon: Double, rightTopLat: Double, rightBottomLon: Double, rightBottomLat: Double, roadInfo: String?
|
||||||
@@ -988,6 +1014,43 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun isInRoadSideFenceRegion(mogoLocation: MogoLocation) {
|
||||||
|
if (System.currentTimeMillis() - mLastTimeRoadSideFence > mIntervalTimeRoadSideFence) {
|
||||||
|
mLastTimeRoadSideFence = System.currentTimeMillis()
|
||||||
|
mLastRoadSideFenceLonLatPoint?.let {
|
||||||
|
if (CompileConfig.DEBUG) {
|
||||||
|
Log.i(TAG, "roadSideFence--op--cancelTask last: $mLastRoadSideFenceLonLatPoint")
|
||||||
|
}
|
||||||
|
//发现有任务堆积时(100米为超参,按照常识5秒内未返回数据),取消之前道路相关任务
|
||||||
|
if (MapTools.getDistance(
|
||||||
|
it.latitude,
|
||||||
|
it.longitude,
|
||||||
|
mogoLocation.lat,
|
||||||
|
mogoLocation.lon
|
||||||
|
) > 100.0
|
||||||
|
) {
|
||||||
|
if (CompileConfig.DEBUG) {
|
||||||
|
Log.i(TAG, "roadop--cancelTask:distance>200 : $mLastRoadLonLatPoint")
|
||||||
|
}
|
||||||
|
// 取消任务
|
||||||
|
RoadHelper.getInstance()?.cancelTask()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RoadHelper.getInstance()?.isInRoadSideFenceRegion(
|
||||||
|
mogoLocation.lon,
|
||||||
|
mogoLocation.lat,
|
||||||
|
object : IResult<Int> {
|
||||||
|
override fun result(code: Int, result: Int?) {
|
||||||
|
mLastRoadSideFenceLonLatPoint = LonLatPoint(mogoLocation.lon,mogoLocation.lat)
|
||||||
|
result?.let {
|
||||||
|
mEventController?.dispatchRoadSideFenceRegionListener(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
override fun getCurrentLonLatPoint(): LonLatPoint {
|
override fun getCurrentLonLatPoint(): LonLatPoint {
|
||||||
return LonLatPoint(mLocationLon, mLocationLat, mLocationAlt.toDouble(), mLocationHeading)
|
return LonLatPoint(mLocationLon, mLocationLat, mLocationAlt.toDouble(), mLocationHeading)
|
||||||
}
|
}
|
||||||
@@ -1039,4 +1102,12 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置正北模式地图偏转角度
|
||||||
|
* @param deviationAngle
|
||||||
|
*/
|
||||||
|
fun setDeviationAngle(deviationAngle:Float){
|
||||||
|
mDeviationAngle = deviationAngle
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -366,9 +366,11 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
|
|||||||
* 设置地图视图模式
|
* 设置地图视图模式
|
||||||
*
|
*
|
||||||
* @param mapPerspective 视图模式 1: 2D模式 2: 3D模式 3:车头向上 4:正北模式
|
* @param mapPerspective 视图模式 1: 2D模式 2: 3D模式 3:车头向上 4:正北模式
|
||||||
|
* @param deviationAngle 正北模式地图偏转角度 默认0f
|
||||||
*/
|
*/
|
||||||
fun setMapViewPerspective(mapPerspective: Int) {
|
fun setMapViewPerspective(mapPerspective: Int,deviationAngle:Float = 0f) {
|
||||||
mMapAutoView.getClerk()?.add()
|
mMapAutoView.getClerk()?.add()
|
||||||
|
mMapAutoView.setDeviationAngle(deviationAngle)
|
||||||
mMapAutoView.getMapController()?.getMapStyleParams()?.setPerspectiveMode(mapPerspective)
|
mMapAutoView.getMapController()?.getMapStyleParams()?.setPerspectiveMode(mapPerspective)
|
||||||
mMapAutoView.getMapController()?.setMapViewPerspective(mapPerspective)
|
mMapAutoView.getMapController()?.setMapViewPerspective(mapPerspective)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user