Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0
# Conflicts: # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/SweeperFragment.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java # app_ipc_monitoring/src/main/java/com/zhidao/adas/client/DataDistribution.java # app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java # app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java # core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoHandAdasMsgManager.java # core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/bindingcar/BindingcarProvider.java # core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt # core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java # core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt # core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/MyMessageFactory.java # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/VehicleStateMessage.java
This commit is contained in:
@@ -6,7 +6,7 @@ import "geometry.proto";
|
||||
enum ProtocolVersion
|
||||
{
|
||||
Defaultver = 0;
|
||||
CurrentVersion = 12; //每次修改proto文件增加1
|
||||
CurrentVersion = 10; //每次修改proto文件增加1
|
||||
}
|
||||
|
||||
enum MessageType
|
||||
@@ -59,6 +59,7 @@ enum MessageType
|
||||
MsgTypeSetParamReq = 0x10119; //设置参数命令
|
||||
MsgTypeTripInfoEvent = 0x1011a; //行程信息
|
||||
MsgTypeBagManagerCmd = 0x1011b; //bag管理
|
||||
MsgTypePlanningCmd = 0x1011c; //给planning的指令
|
||||
}
|
||||
|
||||
message Header
|
||||
@@ -209,7 +210,6 @@ message Line
|
||||
message TrajectoryDownloadReq
|
||||
{
|
||||
Line line = 1; //路线
|
||||
uint32 source = 2; //来源方, 0:invalid, 1:pad, 2:aicloud
|
||||
}
|
||||
|
||||
// message definition for MessageType: MsgTypeBasicInfoReq
|
||||
@@ -457,11 +457,30 @@ enum DrivingState
|
||||
START_UP = 9; //起步状态: driving_action:1 表示正常启动;driving_action:2 表示择机起步
|
||||
PULL_OVER = 10; //靠边停车状态: driving_action:1 表示正常靠边停车;driving_action:2 表示择机靠边停车
|
||||
UN_PROTECTED_INTERSECTION = 11; //路口预测响应状态: driving_action:1 表示触发了预测响应
|
||||
|
||||
AUTO_LANE_CHANGE_LEFT_V2N = 12; //V2N主动向左变道状态: driving_action:1 表示触发变道;driving_action:2 表示执行变道;driving_action:3 表示变道取消;driving_action:4 表示变道完成
|
||||
AUTO_LANE_CHANGE_RIGHT_V2N = 13; //V2N主动向右变道状态: driving_action:1 表示触发变道;driving_action:2 表示执行变道;driving_action:3 表示变道取消;driving_action:4 表示变道完成
|
||||
LANE_AVOID_LEFT_V2N = 14; //V2N主动向左绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成
|
||||
LANE_AVOID_RIGHT_V2N = 15; //V2N主动向右绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成
|
||||
WAITING_V2N = 16; //V2N正在等待变道避让施工场景/静止障碍物: driving_action:1 表示正在等待;driving_action:2 表示等待超时请求平行驾驶;
|
||||
|
||||
AUTO_LANE_CHANGE_LEFT_RSI = 17; //V2N RSI主动向左变道状态: driving_action:1 表示触发变道;driving_action:2 表示执行变道;driving_action:3 表示变道取消;driving_action:4 表示变道完成
|
||||
AUTO_LANE_CHANGE_RIGHT_RSI = 18; //V2N RSI主动向右变道状态: driving_action:1 表示触发变道;driving_action:2 表示执行变道;driving_action:3 表示变道取消;driving_action:4 表示变道完成
|
||||
LANE_AVOID_LEFT_RSI = 19; //V2N RSI主动向左绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成
|
||||
LANE_AVOID_RIGHT_RSI = 20; //V2N RSI主动向右绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成
|
||||
WAITING_RSI = 21; //V2N RSI正在等待变道避让施工场景/静止障碍物: driving_action:1 表示正在等待;driving_action:2 表示等待超时请求平行驾驶;
|
||||
|
||||
AUTO_LANE_CHANGE_LEFT_RSM = 22; //V2N RSM主动向左变道状态: driving_action:1 表示触发变道;driving_action:2 表示执行变道;driving_action:3 表示变道取消;driving_action:4 表示变道完成
|
||||
AUTO_LANE_CHANGE_RIGHT_RSM = 23; //V2N RSM主动向右变道状态: driving_action:1 表示触发变道;driving_action:2 表示执行变道;driving_action:3 表示变道取消;driving_action:4 表示变道完成
|
||||
LANE_AVOID_LEFT_RSM = 24; //V2N RSM主动向左绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成
|
||||
LANE_AVOID_RIGHT_RSM = 25; //V2N RSM主动向右绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成
|
||||
WAITING_RSM = 26; //V2N RSM正在等待变道避让施工场景/静止障碍物: driving_action:1 表示正在等待;driving_action:2 表示等待超时请求平行驾驶;
|
||||
|
||||
AUTO_LANE_CHANGE_LEFT_RSI_TRIANGLE = 27; //V2N 三角锥主动向左变道状态: driving_action:1 表示触发变道;driving_action:2 表示执行变道;driving_action:3 表示变道取消;driving_action:4 表示变道完成
|
||||
AUTO_LANE_CHANGE_RIGHT_RSI_TRIANGLE = 28; //V2N 三角锥主动向右变道状态: driving_action:1 表示触发变道;driving_action:2 表示执行变道;driving_action:3 表示变道取消;driving_action:4 表示变道完成
|
||||
LANE_AVOID_LEFT_RSI_TRIANGLE = 29; //V2N 三角锥主动向左绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成
|
||||
LANE_AVOID_RIGHT_RSI_TRIANGLE = 30; //V2N 三角锥主动向右绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成
|
||||
WAITING_RSI_TRIANGLE = 31; //V2N 三角锥正在等待变道避让施工场景/静止障碍物: driving_action:1 表示正在等待;driving_action:2 表示等待超时请求平行驾驶
|
||||
}
|
||||
|
||||
enum DrivingAction
|
||||
@@ -471,6 +490,11 @@ enum DrivingAction
|
||||
DRIVING_ACTION_STATE_TWO = 2;
|
||||
DRIVING_ACTION_STATE_THREE = 3;
|
||||
DRIVING_ACTION_STATE_FOUR = 4;
|
||||
DRIVING_ACTION_STATE_FIVE = 5;
|
||||
DRIVING_ACTION_STATE_SIX = 6;
|
||||
DRIVING_ACTION_STATE_SEVEN = 7;
|
||||
DRIVING_ACTION_STATE_EIGHT = 8;
|
||||
DRIVING_ACTION_STATE_NINE = 9;
|
||||
}
|
||||
|
||||
message DrivingActionMsg
|
||||
@@ -479,10 +503,36 @@ message DrivingActionMsg
|
||||
DrivingAction driving_action = 2;
|
||||
}
|
||||
|
||||
enum ParkScenarioDrivingState
|
||||
{
|
||||
PARK_SENARIO_NO_AUTODRIVING = 0; //不在自动驾驶状态
|
||||
PARK_SENARIO_LANKE_KEEP = 1; //车道保持状态
|
||||
PARK_SENARIO_LANE_AVOID_LEFT = 2; //主动向左绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成
|
||||
PARK_SENARIO_LANE_AVOID_RIGHT = 3; //主动向右绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成
|
||||
PARK_SENARIO_START_UP = 4; //起步状态: driving_action:1 表示正常启动;driving_action:2 表示择机起步;
|
||||
PARK_SENARIO_PULL_OVER = 5; //站点停车状态: driving_action:1 表示正常站点停车;driving_action:2 表示择机站点停车;
|
||||
PARK_SENARIO_FORCE_PULL_OVER_ON = 6; //响应触发靠边停车状态: driving_action:1 表示开始靠边停车;driving_action:2 表示靠边停车成功;3:靠边停车失败;
|
||||
PARK_SENARIO_FORCE_PULL_OVER_OFF = 7; //不响应触发靠边停车状态: driving_action:1 表示距离前方站点100m;driving_action:2 表示距离路口100m;3: 正在变道 。。。
|
||||
}
|
||||
|
||||
message ParkScenarioDrivingAction
|
||||
{
|
||||
ParkScenarioDrivingState driving_state = 1; //决策场景
|
||||
DrivingAction driving_action = 2; //决策场景状态
|
||||
}
|
||||
|
||||
message ParkScenarioPlanningAction
|
||||
{
|
||||
ParkScenarioDrivingAction action_msg = 1; //决策场景(包含场景以及响应状态)
|
||||
double destination_acc = 2; //驾驶的意图(规划期望的加速或者减速值)
|
||||
}
|
||||
|
||||
message PlanningActionMsg
|
||||
{
|
||||
DrivingActionMsg action_msg = 1;
|
||||
double destination_acc = 2; //驾驶的意图(规划期望的加速或者减速值)
|
||||
|
||||
ParkScenarioPlanningAction park_scenario_action = 3;
|
||||
}
|
||||
|
||||
//message definition for MsgTypeSpecialVehicleTaskCmd
|
||||
@@ -525,3 +575,15 @@ message TripInfoEvent
|
||||
//message definition for MsgTypeBagManagerCmd
|
||||
//refer to bag_manager.proto for details
|
||||
|
||||
//message definition for MsgTypePlanningCmd
|
||||
message PullOverCmd
|
||||
{
|
||||
uint32 cmd = 1; //0: default 1: 靠边停车 2:重新起步
|
||||
}
|
||||
|
||||
message PlanningCmd
|
||||
{
|
||||
PullOverCmd pullOverCmd = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,8 +24,26 @@ message RoboVanSkywellTaskCmd {
|
||||
optional uint32 horn_cmd = 2 [default = 0]; //1:开始鸣笛 2:停止鸣笛
|
||||
}
|
||||
|
||||
message RoboBusJinlvM1Cmd {
|
||||
optional uint32 air_conditioner_cmd = 1; //0: default, 1: 开启空调, 2: 关闭空调
|
||||
optional uint32 air_conditioner_mode_cmd = 2; //模式 0: default, 1: 自动模式, 2: 制冷模式, 3: 通风模式(仅送风,无温度)
|
||||
optional uint32 air_conditioner_wind_speed_cmd = 3; //风速 0: default, 1: 1档,2: 2档,3:3档
|
||||
optional uint32 air_conditioner_temperature_cmd = 4; //温度 0: default, 16-26: 温度
|
||||
|
||||
optional uint32 header_cmd = 5; //0: default, 1: 开启暖风机, 2: 关闭暖风机
|
||||
optional uint32 header_wind_speed_cmd = 6; //风速 0: default, 1: 1档,2: 2档
|
||||
|
||||
optional uint32 main_lamp1_cmd = 7; //0: default, 1: 开启顶灯1, 2: 关闭顶灯1
|
||||
optional uint32 main_lamp2_cmd = 8; //0: default, 1: 开启顶灯2, 2: 关闭顶灯2
|
||||
optional uint32 small_lamp_cmd = 9; //0: default, 1: 开启小灯(氛围灯), 2: 关闭小灯(氛围灯)
|
||||
|
||||
optional uint32 front_door_cmd = 10; //0: default, 1: 开启车门, 2: 关闭车门
|
||||
}
|
||||
|
||||
|
||||
message SpecialVehicleTaskCmd {
|
||||
optional common.Header header = 1;
|
||||
optional RoboSweeperFuTianTaskCmd robo_sweeper_futian_task_cmd = 2; // 福田清扫车业务指令
|
||||
optional RoboVanSkywellTaskCmd robo_van_skywell_task_cmd = 3; // 开沃小巴业务指令
|
||||
optional RoboBusJinlvM1Cmd robo_bus_jinlv_m1_cmd = 4; //金旅定制车m1指令
|
||||
}
|
||||
|
||||
@@ -49,6 +49,45 @@ message SweeperFuTianCleanSystemState {
|
||||
optional float secu_sweepdisk_speed = 41 [default = 0]; // 扫盘转速
|
||||
}
|
||||
|
||||
message RoboTaxiState {
|
||||
optional bool veh_rta_recover = 1 [default = false]; // 车辆可进入自动驾驶标志位,不可进入时一定时间内恢复可自动进入
|
||||
optional bool veh_rta_no_recover = 2 [default = false]; // 车辆可进入自动驾驶标志位,不可进入时恢复无法自动进入
|
||||
}
|
||||
|
||||
message RoboBusState {
|
||||
optional bool reserved = 1; // 预留
|
||||
}
|
||||
|
||||
message AirConditionerState {
|
||||
optional bool is_on = 1; //是否开启
|
||||
optional uint32 mode = 2; //模式, 1: 自动模式, 2: 制冷模式, 3: 通风模式(仅送风,无温度)
|
||||
optional uint32 temperature = 3; //温度
|
||||
optional uint32 wind_speed = 4; //风速, 1-3: 1-3档
|
||||
}
|
||||
|
||||
message HeaterState {
|
||||
optional bool is_on = 1; //是否开启
|
||||
optional uint32 wind_speed = 2; //风速, 1-2: 1-2档
|
||||
}
|
||||
|
||||
message DoorState {
|
||||
optional bool is_on = 1; //是否开启
|
||||
}
|
||||
|
||||
message LightState {
|
||||
optional bool is_on = 1; //是否开启
|
||||
optional uint32 color = 2; //颜色
|
||||
}
|
||||
|
||||
message RoboBusJinlvM1State {
|
||||
optional AirConditionerState air_conditioner_state = 1; //空调
|
||||
optional HeaterState heater_state = 2; //暖风机
|
||||
optional DoorState front_door_state = 3; //车门
|
||||
optional LightState main_lamp1_state = 4; //顶灯1
|
||||
optional LightState main_lamp2_state = 5; //顶灯2
|
||||
optional LightState small_lamp_state = 6; //小灯(氛围灯)
|
||||
}
|
||||
|
||||
message VehicleState {
|
||||
optional common.Header header = 1;
|
||||
optional chassis.PilotMode pilot_mode = 2 [default = MODE_MANUAL];
|
||||
@@ -90,14 +129,15 @@ message VehicleState {
|
||||
optional float rightFrontWheelAngle = 34 [default = 0]; //右前轮角度(deg),左负右正
|
||||
|
||||
optional chassis.EPBWorkStatus epb = 35 [default = EPBSTATUS_NONE]; // EPB工作状态
|
||||
|
||||
optional chassis.VehicleTakeOverStatus vehicletakeoverstatus = 36 [default = None_TakeOver]; // 车辆人工接管状态
|
||||
optional bool Emergency_Stop_Switch = 37 [default = false]; // 急停开关状态
|
||||
optional chassis.VehicleFaultLevel vehiclefaultlevel = 38 [default = None_Fault]; // 整车故障状态
|
||||
|
||||
optional float bms_soc = 40 [default = 0]; // 电量百分比范围 0~100
|
||||
|
||||
reserved 41 to 199;
|
||||
optional float fuel_value = 41 [default = 0]; // 油车剩余油量
|
||||
|
||||
optional SweeperFuTianCleanSystemState sweeper_futian_clean_system_state = 200; // 福田清扫车上装状态信息
|
||||
optional RoboTaxiState robo_taxi_state = 201; // taxi状态
|
||||
optional RoboBusState robo_bus_state = 202; // bus状态
|
||||
optional RoboBusJinlvM1State robo_bus_jinlv_m1_state = 203; //金旅定制车m1状态
|
||||
}
|
||||
|
||||
1
libraries/mogo-adas-other/.gitignore
vendored
1
libraries/mogo-adas-other/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/build
|
||||
@@ -1,7 +0,0 @@
|
||||
#### 说明
|
||||
# ADAS LIB 其他功能
|
||||
## 与工控机交互LIB
|
||||
|
||||
# 申请后台运行权限《关闭电池优化》
|
||||
|
||||
# 路由器管理
|
||||
@@ -1,37 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
// buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
// versionCode Integer.valueOf(VERSION_CODE)
|
||||
// versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
|
||||
//
|
||||
// buildConfigField "String", "AP_VERSION", "\"${AP_VERSION}\""
|
||||
versionCode rootProject.versionCode as int
|
||||
versionName rootProject.versionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.material
|
||||
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
GROUP=com.mogo.adas
|
||||
POM_ARTIFACT_ID=mogo-adas
|
||||
VERSION_CODE=1
|
||||
26
libraries/mogo-adas-other/proguard-rules.pro
vendored
26
libraries/mogo-adas-other/proguard-rules.pro
vendored
@@ -1,26 +0,0 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
#-----MogoMap-----
|
||||
-keep class com.mogo.map.MogoNavi{
|
||||
private <init>();
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.support.adas.high.other">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
|
||||
<application
|
||||
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
<activity
|
||||
android:name=".permission.PermissionLongBackgroundRunningDialog"
|
||||
android:theme="@style/PermissionLongBackgroundRunningDialogStyle" />
|
||||
<activity
|
||||
android:name=".router.RouterActivity"
|
||||
android:theme="@style/NoActionBar" />
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -1,143 +0,0 @@
|
||||
package com.zhidao.support.adas.high.other.permission;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.PowerManager;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
|
||||
/**
|
||||
* 长时间后台运行权限检查
|
||||
*/
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
public class BackgrounderPermission {
|
||||
private static volatile BackgrounderPermission INSTANCE;
|
||||
private OnAdasPermissionListener listener;
|
||||
|
||||
private BackgrounderPermission() {
|
||||
}
|
||||
|
||||
public static BackgrounderPermission getInstance() {
|
||||
if (INSTANCE == null) {
|
||||
synchronized (BackgrounderPermission.class) {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new BackgrounderPermission();
|
||||
}
|
||||
}
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public void setListener(OnAdasPermissionListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public void showPermissionLongBackgroundRunningDialog(Context context) {
|
||||
Intent intent = new Intent(context, PermissionLongBackgroundRunningDialog.class);
|
||||
context.startActivity(intent);
|
||||
|
||||
}
|
||||
|
||||
void onBackgrounderPermission(boolean isBackgrounderPermission) {
|
||||
if (listener != null) {
|
||||
listener.onBackgrounderPermission(isBackgrounderPermission);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前是否开启电池优化
|
||||
*
|
||||
* @param context 上下文
|
||||
* @return 否在设备的电源白名单上 true 表示未优化
|
||||
*/
|
||||
boolean isIgnoringBatteryOptimizations(Context context) {
|
||||
boolean isIgnoring = false;
|
||||
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||
if (powerManager != null) {
|
||||
isIgnoring = powerManager.isIgnoringBatteryOptimizations(context.getPackageName());
|
||||
}
|
||||
return isIgnoring;
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请 关闭电池优化权限
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
|
||||
void requestIgnoreBatteryOptimizations(Activity context) {
|
||||
Intent intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
|
||||
intent.setData(Uri.parse("package:" + context.getPackageName()));
|
||||
context.startActivityForResult(intent, PermissionLongBackgroundRunningDialog.REQUEST_CODE_BATTERY_OPTIMIZATIONS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否忽略计费网络限制
|
||||
* 后台运行时网络限制
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
|
||||
private boolean isIgnoringMeteredNetworkRestrictions(Context context) {
|
||||
ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
// 检查设备是否在计费网络
|
||||
// if (connMgr.isActiveNetworkMetered()) {
|
||||
// Checks user’s Data Saver settings.
|
||||
switch (connMgr.getRestrictBackgroundStatus()) {
|
||||
case ConnectivityManager.RESTRICT_BACKGROUND_STATUS_ENABLED:
|
||||
// 用户已为此应用启用流量节省程序。应用应努力限制前台流量消耗,并妥善处理后台流量消耗限制。
|
||||
Log.i("Permission", "用户已为此应用启用流量节省程序。应用应努力限制前台流量消耗,并妥善处理后台流量消耗限制。");
|
||||
return false;
|
||||
case ConnectivityManager.RESTRICT_BACKGROUND_STATUS_WHITELISTED:
|
||||
// 用户已启用流量节省程序,但应用在白名单中。应用应努力限制前台和后台流量消耗。
|
||||
Log.i("Permission", "用户已启用流量节省程序,但应用在白名单中。应用应努力限制前台和后台流量消耗。");
|
||||
return false;
|
||||
case ConnectivityManager.RESTRICT_BACKGROUND_STATUS_DISABLED:
|
||||
// 流量节省程序已停用。
|
||||
Log.i("Permission", "流量节省程序已停用。");
|
||||
return true;
|
||||
}
|
||||
// } else {
|
||||
// // 设备不在计费网络,为所欲为
|
||||
// Log.i("Permission","设备不在计费网络,为所欲为");
|
||||
// return true;
|
||||
// }
|
||||
Log.i("dddd", "其他");
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 除非应用的核心功能受到不利影响,否则 Google Play 政策禁止应用请求直接豁免 Android 6.0+ 中的电源管理功能(低电耗模式和应用待机模式)
|
||||
*/
|
||||
private static void requestAddDataSaverWhite(Context context) {
|
||||
// ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
// if (connMgr != null && connMgr.getRestrictBackgroundStatus() == ConnectivityManager.RESTRICT_BACKGROUND_STATUS_ENABLED) {
|
||||
Intent intent = new Intent(Settings.ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS);
|
||||
intent.setData(Uri.parse("package:" + context.getPackageName()));
|
||||
context.startActivity(intent);
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否允许长时间后台运行
|
||||
* 目前测试得出:电池优化会影响后台运行
|
||||
*
|
||||
* @param context 上下文
|
||||
* @return
|
||||
*/
|
||||
public boolean isPermissionLongBackgroundRunning(Context context) {
|
||||
// return isIgnoringBatteryOptimizations(context) && isIgnoringMeteredNetworkRestrictions(context);
|
||||
return isIgnoringBatteryOptimizations(context);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.zhidao.support.adas.high.other.permission;
|
||||
|
||||
public interface OnAdasPermissionListener {
|
||||
/**
|
||||
* 是否允许后台运行
|
||||
* 目前只检查了是否关闭电池优化
|
||||
* @param isAllow 是否允许后台运行
|
||||
*/
|
||||
void onBackgrounderPermission(boolean isAllow);
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
package com.zhidao.support.adas.high.other.permission;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.zhidao.support.adas.high.other.R;
|
||||
|
||||
|
||||
/**
|
||||
* 数据用量及电池优化 权限申请
|
||||
* 高版本Android系统会针对熄屏、休眠或后台 对电池WiFi等进行优化,长时间网络可能会断开连接
|
||||
*/
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
public class PermissionLongBackgroundRunningDialog extends AppCompatActivity {
|
||||
public static final int REQUEST_CODE_BATTERY_OPTIMIZATIONS = 0x01;
|
||||
private TextView hint_battery;
|
||||
private Button btn_close_battery_optimizations;
|
||||
private BackgrounderPermission listener;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
overridePendingTransition(R.anim.dialog_in, R.anim.dialog_out);
|
||||
setContentView(R.layout.dialog_adas_permission_long_background_running);
|
||||
initView();
|
||||
setBatteryHint();
|
||||
// //设置弹出窗口与屏幕对齐
|
||||
// Window win = this.getWindow();
|
||||
// int density = (int) (getResources().getDisplayMetrics().density + 0.5f);
|
||||
////设置内边距,这里设置为10dp
|
||||
// win.getDecorView().setPadding(10 * density, 10 * density, 10 * density, 10 * density);
|
||||
// WindowManager.LayoutParams lp = win.getAttributes();
|
||||
////设置窗口宽度
|
||||
// lp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
////设置窗口高度
|
||||
// lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
////设置Dialog位置
|
||||
// lp.gravity = Gravity.TOP;
|
||||
// win.setAttributes(lp);
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
hint_battery = findViewById(R.id.hint_battery);
|
||||
btn_close_battery_optimizations = findViewById(R.id.btn_close_battery_optimizations);
|
||||
btn_close_battery_optimizations.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
BackgrounderPermission.getInstance().requestIgnoreBatteryOptimizations(PermissionLongBackgroundRunningDialog.this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private boolean setBatteryHint() {
|
||||
boolean isIgnoringBatteryOptimizations = BackgrounderPermission.getInstance().isIgnoringBatteryOptimizations(this);
|
||||
btn_close_battery_optimizations.setVisibility(isIgnoringBatteryOptimizations ? View.INVISIBLE : View.VISIBLE);
|
||||
String str = "电池优化:" + (isIgnoringBatteryOptimizations ? "<font color='green'>不优化</font>" : "<font color='red'>优化</font>");
|
||||
hint_battery.setText(Html.fromHtml(str, Html.FROM_HTML_MODE_LEGACY));
|
||||
return isIgnoringBatteryOptimizations;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK) {
|
||||
if (requestCode == REQUEST_CODE_BATTERY_OPTIMIZATIONS) {
|
||||
BackgrounderPermission.getInstance().onBackgrounderPermission(setBatteryHint());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finish() {
|
||||
super.finish();
|
||||
//在此时设置转场动画
|
||||
overridePendingTransition(R.anim.dialog_out, R.anim.dialog_in);
|
||||
}
|
||||
}
|
||||
@@ -1,190 +0,0 @@
|
||||
package com.zhidao.support.adas.high.other.router;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.JsResult;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.zhidao.support.adas.high.other.R;
|
||||
|
||||
|
||||
/**
|
||||
* A placeholder fragment containing a simple view.
|
||||
*/
|
||||
public class PlaceholderFragment extends Fragment {
|
||||
private static final String TAG = PlaceholderFragment.class.getSimpleName();
|
||||
private static final String ROUTER_URL = "router_url";
|
||||
private static final String ROUTER_COOKIE = "router_cookie";
|
||||
private String url;
|
||||
private ProgressBar progressBar;
|
||||
private WebView webView;
|
||||
private CookieManager cookieManager;
|
||||
|
||||
private SharedPreferences sharedPreferences;
|
||||
|
||||
public static PlaceholderFragment newInstance(String url) {
|
||||
PlaceholderFragment fragment = new PlaceholderFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(ROUTER_URL, url);
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
url = getArguments().getString(ROUTER_URL);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_router, container, false);
|
||||
webView = view.findViewById(R.id.web_view);
|
||||
progressBar = view.findViewById(R.id.progressbar);//进度条
|
||||
if (getActivity() != null)
|
||||
sharedPreferences = getActivity().getSharedPreferences("adas_config", Context.MODE_PRIVATE);
|
||||
cookieManager = CookieManager.getInstance();
|
||||
cookieManager.setAcceptCookie(true);
|
||||
initWebView();
|
||||
return view;
|
||||
}
|
||||
|
||||
public void onRefresh() {
|
||||
webView.reload();
|
||||
}
|
||||
|
||||
private void initWebView() {
|
||||
String cokkie = null;
|
||||
if (sharedPreferences != null)
|
||||
cokkie = sharedPreferences.getString(ROUTER_COOKIE, null);
|
||||
if (cokkie != null && cokkie.length() > 0 && cokkie.contains(url)) {
|
||||
int index = cokkie.indexOf("##");
|
||||
cookieManager.setCookie(this.url, cokkie.substring(index));
|
||||
}
|
||||
webView.loadUrl(url);//加载url
|
||||
webView.addJavascriptInterface(this, "android");//添加js监听 这样html就能调用客户端
|
||||
webView.setWebChromeClient(webChromeClient);
|
||||
webView.setWebViewClient(webViewClient);
|
||||
WebSettings webSettings = webView.getSettings();
|
||||
webSettings.setJavaScriptEnabled(true);//允许使用js
|
||||
|
||||
/**
|
||||
* LOAD_CACHE_ONLY: 不使用网络,只读取本地缓存数据
|
||||
* LOAD_DEFAULT: (默认)根据cache-control决定是否从网络上取数据。
|
||||
* LOAD_NO_CACHE: 不使用缓存,只从网络获取数据.
|
||||
* LOAD_CACHE_ELSE_NETWORK,只要本地有,无论是否过期,或者no-cache,都使用缓存中的数据。
|
||||
*/
|
||||
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);//不使用缓存,只从网络获取数据.
|
||||
//支持屏幕缩放
|
||||
webSettings.setSupportZoom(true);
|
||||
webSettings.setBuiltInZoomControls(true);
|
||||
//不显示webview缩放按钮
|
||||
webSettings.setDisplayZoomControls(false);
|
||||
// webSettings.setUseWideViewPort(true);//自适应屏幕
|
||||
webSettings.setLoadWithOverviewMode(true);
|
||||
webSettings.setAllowFileAccess(true);
|
||||
webSettings.setAppCacheEnabled(true);
|
||||
webSettings.setDomStorageEnabled(true);
|
||||
webSettings.setDatabaseEnabled(true);
|
||||
|
||||
}
|
||||
|
||||
//WebViewClient主要帮助WebView处理各种通知、请求事件
|
||||
private final WebViewClient webViewClient = new WebViewClient() {
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {//页面加载完成
|
||||
progressBar.setVisibility(View.GONE);
|
||||
String oldCookie = cookieManager.getCookie(url);
|
||||
if (!TextUtils.isEmpty(oldCookie)) {
|
||||
String cokkie = null;
|
||||
if (sharedPreferences != null)
|
||||
cokkie = sharedPreferences.getString(ROUTER_COOKIE, null);
|
||||
if (!TextUtils.equals(cokkie, oldCookie)) {
|
||||
sharedPreferences.edit().putString(url + "##" + ROUTER_COOKIE, oldCookie).apply();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageStarted(WebView view, String url, Bitmap favicon) {//页面开始加载
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
//返回true 拦截
|
||||
return super.shouldOverrideUrlLoading(view, url);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//WebChromeClient主要辅助WebView处理Javascript的对话框、网站图标、网站title、加载进度等
|
||||
private final WebChromeClient webChromeClient = new WebChromeClient() {
|
||||
//不支持js的alert弹窗,需要自己监听然后通过dialog弹窗
|
||||
@Override
|
||||
public boolean onJsAlert(WebView webView, String url, String message, JsResult result) {
|
||||
AlertDialog.Builder localBuilder = new AlertDialog.Builder(webView.getContext());
|
||||
localBuilder.setMessage(message).setPositiveButton("确定", null);
|
||||
localBuilder.setCancelable(false);
|
||||
localBuilder.create().show();
|
||||
|
||||
//注意:
|
||||
//必须要这一句代码:result.confirm()表示:
|
||||
//处理结果为确定状态同时唤醒WebCore线程
|
||||
//否则不能继续点击按钮
|
||||
result.confirm();
|
||||
return true;
|
||||
}
|
||||
|
||||
//获取网页标题
|
||||
@Override
|
||||
public void onReceivedTitle(WebView view, String title) {
|
||||
super.onReceivedTitle(view, title);
|
||||
Log.i(TAG, "网页标题:" + title);
|
||||
}
|
||||
|
||||
//加载进度回调
|
||||
@Override
|
||||
public void onProgressChanged(WebView view, int newProgress) {
|
||||
progressBar.setProgress(newProgress);
|
||||
}
|
||||
};
|
||||
|
||||
public boolean onKeyDownChild(int keyCode) {
|
||||
Log.i(TAG, "是否有上一个页面:" + webView.canGoBack());
|
||||
if (webView.canGoBack() && keyCode == KeyEvent.KEYCODE_BACK) {//点击返回按钮的时候判断有没有上一页
|
||||
webView.goBack(); // goBack()表示返回webView的上一页面
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
//释放资源
|
||||
webView.destroy();
|
||||
webView = null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
package com.zhidao.support.adas.high.other.router;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.tabs.TabLayoutMediator;
|
||||
import com.zhidao.support.adas.high.other.R;
|
||||
|
||||
|
||||
public class RouterActivity extends AppCompatActivity {
|
||||
private static final String[] TAB_TITLES = new String[]{"Bus", "Taxi"};
|
||||
private boolean isBus;
|
||||
private int currentPosition = 0;//默认选中bus
|
||||
|
||||
public static void newInstance(Context context, boolean isBus) {
|
||||
Intent intent = new Intent(context, RouterActivity.class);
|
||||
intent.putExtra("is_bus", isBus);
|
||||
context.startActivity(intent);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_router);
|
||||
SectionsPagerAdapter sectionsPagerAdapter = new SectionsPagerAdapter(this, TAB_TITLES);
|
||||
ViewPager2 viewPager = findViewById(R.id.view_pager);
|
||||
|
||||
viewPager.setAdapter(sectionsPagerAdapter);
|
||||
TabLayout tabs = findViewById(R.id.tabs);
|
||||
viewPager.setOffscreenPageLimit(1);
|
||||
TabLayoutMediator mediator = new TabLayoutMediator(tabs, viewPager, new TabLayoutMediator.TabConfigurationStrategy() {
|
||||
@Override
|
||||
public void onConfigureTab(@NonNull TabLayout.Tab tab, int position) {
|
||||
tab.setText(TAB_TITLES[position]);
|
||||
}
|
||||
});
|
||||
mediator.attach();
|
||||
viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
super.onPageScrolled(position, positionOffset, positionOffsetPixels);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
super.onPageSelected(position);
|
||||
currentPosition = position;
|
||||
Log.i("dddd", "当前 Pos=" + currentPosition);
|
||||
}
|
||||
});
|
||||
findViewById(R.id.close).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (!isClose(KeyEvent.KEYCODE_BACK))
|
||||
finish();
|
||||
}
|
||||
});
|
||||
findViewById(R.id.refresh).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
PlaceholderFragment fragment = (PlaceholderFragment) getViewPagerFragment(currentPosition);
|
||||
if (fragment != null) {
|
||||
fragment.onRefresh();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
isBus = intent.getBooleanExtra("is_bus", true);
|
||||
}
|
||||
currentPosition = isBus ? 0 : 1;
|
||||
viewPager.setCurrentItem(currentPosition, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param position fragment 的位置
|
||||
* @return
|
||||
*/
|
||||
private Fragment getViewPagerFragment(int position) {
|
||||
return getSupportFragmentManager().findFragmentByTag("f" + position);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
return isClose(keyCode) || super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
private boolean isClose(int keyCode) {
|
||||
PlaceholderFragment fragment = (PlaceholderFragment) getViewPagerFragment(currentPosition);
|
||||
if (fragment != null) {
|
||||
return fragment.onKeyDownChild(keyCode);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.zhidao.support.adas.high.other.router;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class SectionsPagerAdapter extends FragmentStateAdapter {
|
||||
|
||||
private final String[] TAB_TITLES;
|
||||
public final Map<String, PlaceholderFragment> fragments = new HashMap<>();
|
||||
private final FragmentActivity fragmentActivity;
|
||||
|
||||
public SectionsPagerAdapter(@NonNull FragmentActivity fragmentActivity, String[] TAB_TITLES) {
|
||||
super(fragmentActivity);
|
||||
this.fragmentActivity = fragmentActivity;
|
||||
this.TAB_TITLES = TAB_TITLES;
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
String url = "192.168.1.1";
|
||||
if ("Bus".equals(TAB_TITLES[position])) {
|
||||
url = "192.168.8.1";
|
||||
}
|
||||
return PlaceholderFragment.newInstance(url);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return TAB_TITLES.length;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<translate
|
||||
android:duration="300"
|
||||
android:fromYDelta="50%"
|
||||
android:toYDelta="100%" />
|
||||
|
||||
<alpha
|
||||
android:duration="300"
|
||||
android:fromAlpha="0"
|
||||
android:toAlpha="1" />
|
||||
|
||||
</set>
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<translate
|
||||
android:duration="300"
|
||||
android:fromYDelta="50%"
|
||||
android:toYDelta="0" />
|
||||
|
||||
<alpha
|
||||
android:duration="300"
|
||||
android:fromAlpha="0"
|
||||
android:toAlpha="1" />
|
||||
|
||||
</set>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#FAFFFFFF" />
|
||||
<stroke
|
||||
android:width="0.8dp"
|
||||
android:color="#81666666" />
|
||||
<!-- 圆角 -->
|
||||
<corners android:radius="6dp" />
|
||||
</shape>
|
||||
@@ -1,65 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".router.RouterActivity">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="返回" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/refresh"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="刷新" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="输入路由器用户名/密码->点击“登录”->点击“连接用户”查看当前列表中是否存在IP是“192.168.X.102”的设备"
|
||||
android:textColor="#000000"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/view"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tabs" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,38 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_adas_dialog"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hint_battery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="24dp"
|
||||
android:text="电池优化:优化"
|
||||
android:textColor="#000000" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_close_battery_optimizations"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:textSize="24dp"
|
||||
android:text="关闭" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:textSize="24dp"
|
||||
android:text="开启池优化功能,会影响熄屏或休眠后网络连接"
|
||||
android:textColor="#696969" />
|
||||
</LinearLayout>
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/constraintLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".router.PlaceholderFragment">
|
||||
|
||||
<WebView
|
||||
android:id="@+id/web_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/constraintLayout"
|
||||
tools:layout_constraintLeft_creator="1"
|
||||
tools:layout_constraintTop_creator="1" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressbar"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dip"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/constraintLayout"
|
||||
tools:layout_constraintLeft_creator="1"
|
||||
tools:layout_constraintTop_creator="1" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,3 +0,0 @@
|
||||
<resources>
|
||||
<string name="app_name">adas-backgrounder-permission</string>
|
||||
</resources>
|
||||
@@ -1,25 +0,0 @@
|
||||
<resources>
|
||||
|
||||
<style name="PermissionLongBackgroundRunningDialogStyle" parent="Theme.AppCompat.Dialog">
|
||||
<!--设置dialog的背景-->
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<!--设置Dialog的windowFrame框为无-->
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<!--设置无标题-->
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!--是否浮现在activity之上-->
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<!--是否半透明-->
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<!--设置窗口内容不覆盖-->
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<!--背景是否模糊显示-->
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
</style>
|
||||
|
||||
<style name="NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -55,6 +55,7 @@ import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass;
|
||||
import common.HeaderOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
@@ -969,6 +970,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
|
||||
/**
|
||||
* 发送红绿灯数据到工控机
|
||||
* TODO MAP290开始此接口弃用
|
||||
*
|
||||
* @param crossID roadID
|
||||
* @param latitude 纬度
|
||||
@@ -983,6 +985,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
* @param timestamp 当前卫星时间, 单位: ms
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean sendTrafficLightData(@NonNull String crossID, double latitude, double longitude,
|
||||
@NonNull String heading, @NonNull String direction, int lightId, int laneNo,
|
||||
@@ -1178,6 +1181,20 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
return subscribeInterface != null && subscribeInterface.subscribeInterface(role, type, messageType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 给Planning发送指令
|
||||
*
|
||||
* @param cmd 命令 0: default 1: 靠边停车 2:重新起步
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendPlanningCmd(int cmd) {
|
||||
MessagePad.PlanningCmd planningCmd = MessagePad.PlanningCmd.newBuilder()
|
||||
.setPullOverCmd(MessagePad.PullOverCmd.newBuilder().setCmd(cmd))
|
||||
.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_PLANNING_CMD.typeCode, planningCmd.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 福田清扫车业务指令下发
|
||||
*
|
||||
@@ -1206,6 +1223,95 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
return sendSpecialVehicleTaskCmd(cmdBuild);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金旅M1空调控制
|
||||
*
|
||||
* @param switchCmd 0: default, 1: 开启空调, 2: 关闭空调
|
||||
* @param modeCmd 模式 0: default, 1: 自动模式, 2: 制冷模式, 3: 通风模式(仅送风,无温度)
|
||||
* @param windSpeedCmd 风速 0: default, 1: 1档,2: 2档,3:3档
|
||||
* @param temperatureCmd 温度 0: default, 16-26: 温度
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboBusJinlvM1AirConditionerCmd(int switchCmd, int modeCmd, int windSpeedCmd, int temperatureCmd) {
|
||||
return sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd.newBuilder()
|
||||
.setAirConditionerCmd(switchCmd)
|
||||
.setAirConditionerModeCmd(modeCmd)
|
||||
.setAirConditionerWindSpeedCmd(windSpeedCmd)
|
||||
.setAirConditionerTemperatureCmd(temperatureCmd)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 金旅M1暖风机控制
|
||||
*
|
||||
* @param switchCmd //0: default, 1: 开启暖风机, 2: 关闭暖风机
|
||||
* @param windSpeedCmd //风速 0: default, 1: 1档,2: 2档
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboBusJinlvM1HeaderCmd(int switchCmd, int windSpeedCmd) {
|
||||
return sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd.newBuilder()
|
||||
.setHeaderCmd(switchCmd)
|
||||
.setHeaderWindSpeedCmd(windSpeedCmd)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 金旅M1顶灯控制
|
||||
*
|
||||
* @param switch1Cmd //0: default, 1: 开启顶灯1, 2: 关闭顶灯1
|
||||
* @param switch2Cmd //0: default, 1: 开启顶灯2, 2: 关闭顶灯2
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboBusJinlvM1MainLampCmd(int switch1Cmd, int switch2Cmd) {
|
||||
return sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd.newBuilder()
|
||||
.setMainLamp1Cmd(switch1Cmd)
|
||||
.setMainLamp2Cmd(switch2Cmd)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 金旅M1小灯(氛围灯)控制
|
||||
*
|
||||
* @param switchCmd //0: default, 1: 开启小灯(氛围灯), 2: 关闭小灯(氛围灯)
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboBusJinlvM1SmallLampCmd(int switchCmd) {
|
||||
return sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd.newBuilder()
|
||||
.setSmallLampCmd(switchCmd)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 金旅M1车门控制
|
||||
*
|
||||
* @param switchCmd //0: default, 1: 开启车门, 2: 关闭车门
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboBusJinlvM1FrontDoorCmd(int switchCmd) {
|
||||
return sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd.newBuilder()
|
||||
.setFrontDoorCmd(switchCmd)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 金旅M1业务指令下发
|
||||
*
|
||||
* @param roboBusJinlvM1Cmd 命令
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd roboBusJinlvM1Cmd) {
|
||||
SpecialVehicleTaskCmdOuterClass.SpecialVehicleTaskCmd.Builder cmdBuild = SpecialVehicleTaskCmdOuterClass.SpecialVehicleTaskCmd
|
||||
.newBuilder()
|
||||
.setRoboBusJinlvM1Cmd(roboBusJinlvM1Cmd);
|
||||
return sendSpecialVehicleTaskCmd(cmdBuild);
|
||||
}
|
||||
|
||||
/**
|
||||
* 特种车辆命令下发
|
||||
*
|
||||
@@ -1389,5 +1495,17 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
return sendPBMessage(MessageType.TYPE_SEND_TRIP_INFO_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送包管理请求
|
||||
*
|
||||
* @param bagManager 包管理参数
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendBagManagerCmd(BagManagerOuterClass.BagManager bagManager) {
|
||||
return sendPBMessage(MessageType.TYPE_SEND_BAG_MANAGER_CMD.typeCode, bagManager.toByteArray());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
@@ -449,6 +450,7 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
|
||||
/**
|
||||
* 发送红绿灯数据到工控机
|
||||
* TODO MAP290开始此接口弃用
|
||||
*
|
||||
* @param crossID roadID
|
||||
* @param latitude
|
||||
@@ -463,6 +465,7 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
* @param timestamp 当前卫星时间, 单位: ms
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean sendTrafficLightData(@NonNull String crossID, double latitude, double longitude, @NonNull String heading, @NonNull String direction, int lightId, int laneNo, int arrowNo, int flashYellow, MessagePad.TrafficLightDetail laneDetail, long timestamp) {
|
||||
return mChannel != null && mChannel.sendTrafficLightData(crossID, latitude, longitude, heading, direction, lightId, laneNo, arrowNo, flashYellow, laneDetail, timestamp);
|
||||
@@ -600,6 +603,17 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.subscribeInterface(role, type, messageType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 给Planning发送指令
|
||||
*
|
||||
* @param cmd 命令 0: default 1: 靠边停车 2:重新起步
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendPlanningCmd(int cmd) {
|
||||
return mChannel != null && mChannel.sendPlanningCmd(cmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 福田清扫车业务指令下发
|
||||
*
|
||||
@@ -622,6 +636,77 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.sendRoboVanSkywellTaskCmd(vanSkywellTaskCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金旅M1空调控制
|
||||
*
|
||||
* @param switchCmd 0: default, 1: 开启空调, 2: 关闭空调
|
||||
* @param modeCmd 模式 0: default, 1: 自动模式, 2: 制冷模式, 3: 通风模式(仅送风,无温度)
|
||||
* @param windSpeedCmd 风速 0: default, 1: 1档,2: 2档,3:3档
|
||||
* @param temperatureCmd 温度 0: default, 16-26: 温度
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboBusJinlvM1AirConditionerCmd(int switchCmd, int modeCmd, int windSpeedCmd, int temperatureCmd) {
|
||||
return mChannel != null && mChannel.sendRoboBusJinlvM1AirConditionerCmd(switchCmd, modeCmd, windSpeedCmd, temperatureCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金旅M1暖风机控制
|
||||
*
|
||||
* @param switchCmd //0: default, 1: 开启暖风机, 2: 关闭暖风机
|
||||
* @param windSpeedCmd //风速 0: default, 1: 1档,2: 2档
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboBusJinlvM1HeaderCmd(int switchCmd, int windSpeedCmd) {
|
||||
return mChannel != null && mChannel.sendRoboBusJinlvM1HeaderCmd(switchCmd, windSpeedCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金旅M1顶灯控制
|
||||
*
|
||||
* @param switch1Cmd //0: default, 1: 开启顶灯1, 2: 关闭顶灯1
|
||||
* @param switch2Cmd //0: default, 1: 开启顶灯2, 2: 关闭顶灯2
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboBusJinlvM1MainLampCmd(int switch1Cmd, int switch2Cmd) {
|
||||
return mChannel != null && mChannel.sendRoboBusJinlvM1MainLampCmd(switch1Cmd, switch2Cmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金旅M1车门控制
|
||||
*
|
||||
* @param switchCmd //0: default, 1: 开启车门, 2: 关闭车门
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboBusJinlvM1SmallLampCmd(int switchCmd) {
|
||||
return mChannel != null && mChannel.sendRoboBusJinlvM1SmallLampCmd(switchCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金旅M1车门控制
|
||||
*
|
||||
* @param switchCmd //0: default, 1: 开启车门, 2: 关闭车门
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboBusJinlvM1FrontDoorCmd(int switchCmd) {
|
||||
return mChannel != null && mChannel.sendRoboBusJinlvM1FrontDoorCmd(switchCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金旅M1业务指令下发
|
||||
*
|
||||
* @param roboBusJinlvM1Cmd 命令
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd roboBusJinlvM1Cmd) {
|
||||
return mChannel != null && mChannel.sendRoboBusJinlvM1TaskCmd(roboBusJinlvM1Cmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 特种车辆命令下发
|
||||
*
|
||||
@@ -716,6 +801,17 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.sendTripInfoReq(type, lineName, departureStopName, arrivalStopName, isLastStop);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送包管理请求
|
||||
*
|
||||
* @param bagManager 包管理参数
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendBagManagerCmd(BagManagerOuterClass.BagManager bagManager) {
|
||||
return mChannel != null && mChannel.sendBagManagerCmd(bagManager);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工控机固定IP列表
|
||||
*
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.zhidao.support.adas.high.common.MessageType;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
@@ -204,6 +205,7 @@ public interface IAdasNetCommApi {
|
||||
|
||||
/**
|
||||
* 发送红绿灯数据到工控机
|
||||
* TODO MAP290开始此接口弃用
|
||||
*
|
||||
* @param crossID roadID
|
||||
* @param latitude 纬度
|
||||
@@ -218,6 +220,7 @@ public interface IAdasNetCommApi {
|
||||
* @param timestamp 当前卫星时间, 单位: ms
|
||||
* @return 加入WS发送消息队列是否成功
|
||||
*/
|
||||
@Deprecated
|
||||
boolean sendTrafficLightData(@NonNull String crossID, double latitude, double longitude,
|
||||
@NonNull String heading, @NonNull String direction, int lightId, int laneNo,
|
||||
int arrowNo, int flashYellow, MessagePad.TrafficLightDetail laneDetail, long timestamp);
|
||||
@@ -318,6 +321,14 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
boolean subscribeInterface(@Define.TerminalRole int role, @Define.SubscribeType int type, @NonNull MessageType messageType);
|
||||
|
||||
/**
|
||||
* 给Planning发送指令
|
||||
*
|
||||
* @param cmd 命令 0: default 1: 靠边停车 2:重新起步
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendPlanningCmd(int cmd);
|
||||
|
||||
/**
|
||||
* 福田清扫车业务指令下发
|
||||
*
|
||||
@@ -334,6 +345,59 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
boolean sendRoboVanSkywellTaskCmd(SpecialVehicleTaskCmdOuterClass.RoboVanSkywellTaskCmd vanSkywellTaskCmd);
|
||||
|
||||
/**
|
||||
* 金旅M1空调控制
|
||||
*
|
||||
* @param switchCmd 0: default, 1: 开启空调, 2: 关闭空调
|
||||
* @param modeCmd 模式 0: default, 1: 自动模式, 2: 制冷模式, 3: 通风模式(仅送风,无温度)
|
||||
* @param windSpeedCmd 风速 0: default, 1: 1档,2: 2档,3:3档
|
||||
* @param temperatureCmd 温度 0: default, 16-26: 温度
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendRoboBusJinlvM1AirConditionerCmd(int switchCmd, int modeCmd, int windSpeedCmd, int temperatureCmd);
|
||||
|
||||
/**
|
||||
* 金旅M1暖风机控制
|
||||
*
|
||||
* @param switchCmd //0: default, 1: 开启暖风机, 2: 关闭暖风机
|
||||
* @param windSpeedCmd //风速 0: default, 1: 1档,2: 2档
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendRoboBusJinlvM1HeaderCmd(int switchCmd, int windSpeedCmd);
|
||||
|
||||
/**
|
||||
* 金旅M1顶灯控制
|
||||
*
|
||||
* @param switch1Cmd //0: default, 1: 开启顶灯1, 2: 关闭顶灯1
|
||||
* @param switch2Cmd //0: default, 1: 开启顶灯2, 2: 关闭顶灯2
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendRoboBusJinlvM1MainLampCmd(int switch1Cmd, int switch2Cmd);
|
||||
|
||||
/**
|
||||
* 金旅M1小灯(氛围灯)控制
|
||||
*
|
||||
* @param switchCmd //0: default, 1: 开启小灯(氛围灯), 2: 关闭小灯(氛围灯)
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendRoboBusJinlvM1SmallLampCmd(int switchCmd);
|
||||
|
||||
/**
|
||||
* 金旅M1车门控制
|
||||
*
|
||||
* @param switchCmd //0: default, 1: 开启车门, 2: 关闭车门
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendRoboBusJinlvM1FrontDoorCmd(int switchCmd);
|
||||
|
||||
/**
|
||||
* 金旅M1业务指令下发
|
||||
*
|
||||
* @param roboBusJinlvM1Cmd 命令
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd roboBusJinlvM1Cmd);
|
||||
|
||||
/**
|
||||
* 特种车辆命令下发
|
||||
*
|
||||
@@ -427,6 +491,13 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
boolean sendTripInfoReq(int type, String lineName, String departureStopName, String arrivalStopName, boolean isLastStop);
|
||||
|
||||
/**
|
||||
* 发送包管理请求
|
||||
*
|
||||
* @param bagManager 包管理参数
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendBagManagerCmd(BagManagerOuterClass.BagManager bagManager);
|
||||
|
||||
// TODO 需求暂停 待讨论
|
||||
// boolean getRoutes();
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.zhidao.support.adas.high.bean.AutopilotAbility;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatistics;
|
||||
import com.zhidao.support.adas.high.common.ProtocolStatus;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import function_state_management.FunctionStates;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
@@ -52,6 +53,15 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onGnssInfo(MessagePad.Header header, MessagePad.GnssInfo gnssInfo);
|
||||
|
||||
/**
|
||||
* 老底盘信息,透传底盘状态,pb参考底盘
|
||||
* TODO 目前由于M1车型不会在新底盘PB添加新的字段 所以临时保留
|
||||
* TODO 后期会优化掉,具体时间未知,需要工控机端新老底盘PB字段对齐
|
||||
*
|
||||
* @param header 头
|
||||
* @param vehicleState 数据
|
||||
*/
|
||||
void onVehicleState(MessagePad.Header header, VehicleStateOuterClass.VehicleState vehicleState);
|
||||
|
||||
/**
|
||||
* 底盘状态
|
||||
@@ -199,6 +209,14 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onSweeperTaskIndexData(MessagePad.Header header, RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex roboSweeperTaskIndex);
|
||||
|
||||
/**
|
||||
* Bag管理应答
|
||||
*
|
||||
* @param header 头
|
||||
* @param bagManager 数据
|
||||
*/
|
||||
void onBagManagerCmd(MessagePad.Header header, BagManagerOuterClass.BagManager bagManager);
|
||||
|
||||
/**
|
||||
* 是否有能力启动自动驾驶
|
||||
*
|
||||
|
||||
@@ -37,7 +37,10 @@ public class AutopilotStatistics {
|
||||
*/
|
||||
public final MogoReportMsg.MogoReportMessage failedMessage;
|
||||
|
||||
public AutopilotStatistics(@Define.AutopilotStartStatus int status, long usedTime, MessagePad.SetAutopilotModeReq req, MogoReportMsg.MogoReportMessage failedMessage) {
|
||||
public AutopilotStatistics(@Define.AutopilotStartStatus int status,
|
||||
long usedTime,
|
||||
MessagePad.SetAutopilotModeReq req,
|
||||
MogoReportMsg.MogoReportMessage failedMessage) {
|
||||
this.status = status;
|
||||
this.usedTime = usedTime;
|
||||
this.req = req;
|
||||
|
||||
@@ -38,6 +38,7 @@ public enum MessageType {
|
||||
TYPE_SEND_SET_AUTOPILOT_SPEED_REQ(MessagePad.MessageType.MsgTypeSetAutopilotSpeedReq, "设置自动驾驶最大速度"),
|
||||
TYPE_SEND_GLOBAL_PATH_REQ(MessagePad.MessageType.MsgTypeGlobalPathReq, "自动驾驶路径请求"),
|
||||
TYPE_RECEIVE_GLOBAL_PATH_RESP(MessagePad.MessageType.MsgTypeGlobalPathResp, "自动驾驶路径应答"),
|
||||
@Deprecated//MAP290开始此接口弃用
|
||||
TYPE_SEND_TRAFFIC_LIGHT_DATA(MessagePad.MessageType.MsgTypeTrafficLightData, "发送红绿灯数据到工控机"),
|
||||
@Deprecated
|
||||
TYPE_RECEIVE_WARN(MessagePad.MessageType.MsgTypeWarn, "预警数据"),
|
||||
@@ -47,13 +48,16 @@ public enum MessageType {
|
||||
TYPE_SEND_STATUS_QUERY_REQ(MessagePad.MessageType.MsgTypeStatusQueryReq, "状态查询请求"),
|
||||
TYPE_RECEIVE_STATUS_QUERY_RESP(MessagePad.MessageType.MsgTypeStatusQueryResp, "状态查询应答"),
|
||||
TYPE_SEND_SET_RAIN_MODE_REQ(MessagePad.MessageType.MsgTypeSetRainModeReq, "设置雨天模式"),
|
||||
TYPE_SEND_OPERATOR_CMD_REQ(MessagePad.MessageType.MsgTypeOperatorCmdReq, "操控指令"),
|
||||
TYPE_SEND_RECORD_DATA_CONFIG_REQ(MessagePad.MessageType.MsgTypeRecordDataConfigReq, "数据采集配置查询"),
|
||||
TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP(MessagePad.MessageType.MsgTypeRecordDataConfigResp, "数据采集配置"),
|
||||
TYPE_SEND_OPERATOR_CMD_REQ(MessagePad.MessageType.MsgTypeOperatorCmdReq, "操控指令"),
|
||||
TYPE_SEND_SUBSCRIBE_DATA_REQ(MessagePad.MessageType.MsgTypeSubscribeDataReq, "数据订阅、取消订阅请求"),
|
||||
TYPE_SEND_SPECIAL_VEHICLE_TASK_CMD(MessagePad.MessageType.MsgTypeSpecialVehicleTaskCmd, "特种车辆命令"),
|
||||
TYPE_SEND_SET_PARAM_REQ(MessagePad.MessageType.MsgTypeSetParamReq, "设置参数命令"),
|
||||
TYPE_SEND_TRIP_INFO_REQ(MessagePad.MessageType.MsgTypeTripInfoEvent, "行程信息"),
|
||||
TYPE_SEND_SPECIAL_VEHICLE_TASK_CMD(MessagePad.MessageType.MsgTypeSpecialVehicleTaskCmd, "特种车辆命令"),
|
||||
TYPE_SEND_BAG_MANAGER_CMD(MessagePad.MessageType.MsgTypeBagManagerCmd, "Bag管理请求"),
|
||||
TYPE_RECEIVE_BAG_MANAGER_CMD(MessagePad.MessageType.MsgTypeBagManagerCmd, "Bag管理应答"),
|
||||
TYPE_SEND_PLANNING_CMD(MessagePad.MessageType.MsgTypePlanningCmd, "给Planning指令"),
|
||||
//TODO 透传原始pb文件中不存在以下type。由于Java中无法强转,所以在mogo-adas-data/message_pad.proto中放开注释
|
||||
TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, "Planning决策状态"),
|
||||
TYPE_RECEIVE_SWEEPER_TASK_INDEX_DATA(MessagePad.MessageType.MsgTypeSweeperTaskIndexData, "清扫车指标数据"),
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.zhidao.support.adas.high.msg;
|
||||
|
||||
import android.os.SystemClock;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.AdasChannel;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
|
||||
/**
|
||||
* Bag管理应答
|
||||
*/
|
||||
public class BagManagerMessage extends MyAbstractMessageHandler {
|
||||
|
||||
public BagManagerMessage() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
BagManagerOuterClass.BagManager bagManager = BagManagerOuterClass.BagManager.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
|
||||
AdasChannel.calculateTimeConsumingOnDispatchRaw("Bag管理应答", raw.receiveTime);
|
||||
long nowTime = 0;
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
if (adasListener != null) {
|
||||
adasListener.onBagManagerCmd(raw.getHeader(), bagManager);
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("Bag管理应答", nowTime);
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,7 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg planningDecisionStateMessage;//planning决策状态
|
||||
private IMsg functionStatesMessage;//重构后的功能状态
|
||||
private IMsg sweeperTaskIndexDataMessage;//清扫车指标数据
|
||||
private IMsg bagManagerMessage;//Bag管理应答
|
||||
|
||||
private final AutopilotReview autopilotReview;
|
||||
|
||||
@@ -169,6 +170,12 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
functionStatesMessage = new FunctionStatesMessage();
|
||||
}
|
||||
return functionStatesMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_BAG_MANAGER_CMD.typeCode) {
|
||||
//Bag管理应答
|
||||
if (bagManagerMessage == null) {
|
||||
bagManagerMessage = new BagManagerMessage();
|
||||
}
|
||||
return bagManagerMessage;
|
||||
} else {
|
||||
//MessageType.TYPE_DEFAULT.typeCode
|
||||
return null;
|
||||
|
||||
@@ -28,7 +28,9 @@ public class VehicleStateMessage extends MyAbstractMessageHandler {
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
if (adasListener != null) {
|
||||
compatibility(adasListener, raw, vehicleState);
|
||||
//TODO 暂时关闭新老兼容
|
||||
//compatibility(adasListener, raw, vehicleState);
|
||||
adasListener.onVehicleState(raw.getHeader(), vehicleState);
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("底盘信息", nowTime);
|
||||
// CupidLogUtils.e("底盘信息--->" + vehicleState.toString());
|
||||
@@ -41,6 +43,8 @@ public class VehicleStateMessage extends MyAbstractMessageHandler {
|
||||
* parking_brake longitude_driving_mode eps_steering_mode
|
||||
* steering_sign location_missing trajectory_missing
|
||||
* chassis_status_missing pilot_mode_condition_met vehicletakeoverstatus
|
||||
* fuel_value robo_taxi_state robo_bus_state
|
||||
* robo_bus_jinlv_m1_state
|
||||
*/
|
||||
private void compatibility(OnAdasListener adasListener, RawData raw, VehicleStateOuterClass.VehicleState vehicleState) throws InvalidProtocolBufferException {
|
||||
/**************老地盘转换成新地盘PB***************/
|
||||
|
||||
@@ -42,15 +42,14 @@ public interface IMogoMap {
|
||||
* @param options
|
||||
* @return
|
||||
*/
|
||||
IMogoMarker addMarker( String tag, MogoMarkerOptions options );
|
||||
|
||||
IMogoMarker addMarker(String tag, MogoMarkerOptions options);
|
||||
|
||||
/**
|
||||
* 批量更新锚点位置
|
||||
*
|
||||
* @param optionsArrayList 锚点集合
|
||||
*/
|
||||
void updateBatchMarkerPosition(HashMap<String,MessagePad.TrackedObject> optionsArrayList);
|
||||
void updateBatchMarkerPosition(HashMap<String, MessagePad.TrackedObject> optionsArrayList);
|
||||
|
||||
/**
|
||||
* 添加感知使用到的3d模型
|
||||
@@ -75,7 +74,7 @@ public interface IMogoMap {
|
||||
* @param moveToCenter
|
||||
* @return
|
||||
*/
|
||||
ArrayList< IMogoMarker > addMarkers( String tag, ArrayList< MogoMarkerOptions > options, boolean moveToCenter );
|
||||
ArrayList<IMogoMarker> addMarkers(String tag, ArrayList<MogoMarkerOptions> options, boolean moveToCenter);
|
||||
|
||||
/**
|
||||
* 从地图上删除所有的overlay(marker,circle,polyline 等对象)。
|
||||
@@ -87,7 +86,7 @@ public interface IMogoMap {
|
||||
*
|
||||
* @param isKeepMyLocationOverlay
|
||||
*/
|
||||
void clear( boolean isKeepMyLocationOverlay );
|
||||
void clear(boolean isKeepMyLocationOverlay);
|
||||
|
||||
/**
|
||||
* 设置屏幕上的某个像素点为地图中心点。
|
||||
@@ -95,47 +94,7 @@ public interface IMogoMap {
|
||||
* @param x
|
||||
* @param y
|
||||
*/
|
||||
void setPointToCenter( int x, int y );
|
||||
|
||||
/**
|
||||
* 设置地图POI是否允许点击。
|
||||
*
|
||||
* @param touchPoiEnable
|
||||
*/
|
||||
void setTouchPoiEnable( boolean touchPoiEnable );
|
||||
|
||||
/**
|
||||
* 设置是否打开交通路况图层。
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
void setTrafficEnable( boolean enable );
|
||||
|
||||
/**
|
||||
* 设置是否显示3D建筑物,默认显示。
|
||||
*
|
||||
* @param enabled
|
||||
*/
|
||||
void showBuildings( boolean enabled );
|
||||
|
||||
/**
|
||||
* 设置是否显示室内地图,默认不显示。
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
void showIndoorMap( boolean enable );
|
||||
|
||||
/**
|
||||
* 设置是否显示底图文字标注,默认显示。
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
void showMapText( boolean enable );
|
||||
|
||||
/**
|
||||
* 停止当前执行的改变地图状态的动画。
|
||||
*/
|
||||
void stopAnimation();
|
||||
void setPointToCenter(int x, int y);
|
||||
|
||||
/**
|
||||
* 获取比例尺
|
||||
@@ -149,7 +108,7 @@ public interface IMogoMap {
|
||||
*
|
||||
* @param zoom
|
||||
*/
|
||||
void changeZoom( float zoom );
|
||||
void changeZoom(float zoom);
|
||||
|
||||
/**
|
||||
* 获取缩放比例
|
||||
@@ -169,13 +128,14 @@ public interface IMogoMap {
|
||||
* @param options
|
||||
* @return
|
||||
*/
|
||||
IMogoPolyline addPolyline( MogoPolylineOptions options );
|
||||
IMogoPolyline addPolyline(MogoPolylineOptions options);
|
||||
|
||||
/**
|
||||
* 获取行驶方向一定长度的中心线
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 航向角
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 航向角
|
||||
* @param distance 获取车道中心线的长度,> 0: 行驶方向前方距离, <0 行驶方向后方距离
|
||||
* @return 中心线相关数据
|
||||
*/
|
||||
@@ -184,10 +144,13 @@ public interface IMogoMap {
|
||||
|
||||
/**
|
||||
* 根据自车经纬度和航向角,获取道路名称
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 航向角
|
||||
* @return 道路名称等相关信息
|
||||
*/
|
||||
RoadNameInfo getRoadName(double lon, double lat, float angle);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.map.search.traffic.IMogoTrafficSearch;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/12/9
|
||||
*
|
||||
* 地图实例构建
|
||||
*/
|
||||
interface IMogoMapApiBuilder extends IProvider {
|
||||
|
||||
IMogoGeoSearch getGeoSearch( Context context );
|
||||
|
||||
IMogoLocationClient getLocationClient( Context context );
|
||||
|
||||
IMogoMapUIController getMapUIController();
|
||||
|
||||
IMogoPoiSearch getPoiSearchClient( Context context, MogoPoiSearchQuery query );
|
||||
|
||||
void destroy();
|
||||
|
||||
IMogoMapView getMapView( Context context );
|
||||
|
||||
IMogoTrafficSearch getTrafficSearch();
|
||||
|
||||
}
|
||||
@@ -13,10 +13,10 @@ public interface IMogoMapListenerRegister {
|
||||
*
|
||||
* @param listener 回调事件
|
||||
*/
|
||||
void registerHostMapListener( IMogoMapListener listener );
|
||||
void registerHostMapListener(String tag, IMogoMapListener listener );
|
||||
|
||||
/**
|
||||
* 反注册注册地图事件
|
||||
*/
|
||||
void unregisterHostMapListener();
|
||||
void unregisterHostMapListener(String tag);
|
||||
}
|
||||
|
||||
@@ -33,23 +33,23 @@ public class MogoHosListenerRegister implements IMogoHosListenerRegister {
|
||||
|
||||
|
||||
@Override
|
||||
public void registerHostMapListener( IMogoMapListener listener ) {
|
||||
MogoMapListenerHandler.getInstance().registerHostMapListener( listener );
|
||||
public void registerHostMapListener(String tag, IMogoMapListener listener ) {
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(tag, listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterHostMapListener() {
|
||||
MogoMapListenerHandler.getInstance().unregisterHostMapListener();
|
||||
public void unregisterHostMapListener(String tag) {
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMarkerClickListener( IMogoMarkerClickListener listener ) {
|
||||
MogoMarkersHandler.getInstance().registerMarkerClickListener( listener );
|
||||
public void registerMarkerClickListener( String tag,IMogoMarkerClickListener listener ) {
|
||||
MogoMarkersHandler.Companion.getMogoMarkersHandler().registerMarkerClickListener(tag, listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMarkerClickListener() {
|
||||
MogoMarkersHandler.getInstance().unregisterMarkerClickListener();
|
||||
public void unregisterMarkerClickListener(String tag) {
|
||||
MogoMarkersHandler.Companion.getMogoMarkersHandler().unregisterMarkerClickListener(tag);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
package com.mogo.map.listener;
|
||||
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.model.MogoPoi;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* 地图监听注册管理
|
||||
*/
|
||||
public class MogoMapListenerHandler implements IMogoMapListener, IMogoMapListenerRegister {
|
||||
|
||||
private static volatile MogoMapListenerHandler sInstance;
|
||||
|
||||
private MogoMapListenerHandler() {
|
||||
}
|
||||
|
||||
public static MogoMapListenerHandler getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (MogoMapListenerHandler.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MogoMapListenerHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上层模块代理对象
|
||||
*/
|
||||
private IMogoMapListener mDelegateListener = null;
|
||||
|
||||
@Override
|
||||
public void registerHostMapListener(IMogoMapListener listener) {
|
||||
mDelegateListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterHostMapListener() {
|
||||
mDelegateListener = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
if (mDelegateListener != null) {
|
||||
mDelegateListener.onMapLoaded();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouch(MotionEvent motionEvent) {
|
||||
if (mDelegateListener != null) {
|
||||
mDelegateListener.onTouch(motionEvent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPOIClick(MogoPoi poi) {
|
||||
if (mDelegateListener != null) {
|
||||
mDelegateListener.onPOIClick(poi);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapClick(MogoLatLng latLng) {
|
||||
if (mDelegateListener != null) {
|
||||
mDelegateListener.onMapClick(latLng);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockMap(boolean isLock) {
|
||||
if (mDelegateListener != null) {
|
||||
mDelegateListener.onLockMap(isLock);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged(EnumMapUI ui) {
|
||||
if (mDelegateListener != null) {
|
||||
mDelegateListener.onMapModeChanged(ui);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapVisualAngleChanged(VisualAngleMode visualAngleMode) {
|
||||
if (mDelegateListener != null) {
|
||||
mDelegateListener.onMapVisualAngleChanged(visualAngleMode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapChanged(MogoLatLng location, float zoom, float tilt, float bearing) {
|
||||
if (mDelegateListener != null) {
|
||||
mDelegateListener.onMapChanged(location, zoom, tilt, bearing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.mogo.map.listener
|
||||
|
||||
import android.view.MotionEvent
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.map.model.MogoPoi
|
||||
import com.mogo.map.uicontroller.EnumMapUI
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
* 地图监听注册管理
|
||||
*/
|
||||
class MogoMapListenerHandler private constructor() : IMogoMapListener, IMogoMapListenerRegister {
|
||||
|
||||
companion object {
|
||||
val mogoMapListenerHandler by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
MogoMapListenerHandler()
|
||||
}
|
||||
}
|
||||
|
||||
private val mMap: ConcurrentHashMap<String, IMogoMapListener> = ConcurrentHashMap()
|
||||
|
||||
override fun registerHostMapListener(tag: String, listener: IMogoMapListener) {
|
||||
if (mMap.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
mMap[tag] = listener
|
||||
}
|
||||
|
||||
override fun unregisterHostMapListener(tag: String) {
|
||||
if (!mMap.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
mMap.remove(tag)
|
||||
}
|
||||
|
||||
override fun onMapLoaded() {
|
||||
mMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onMapLoaded()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTouch(motionEvent: MotionEvent) {
|
||||
mMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onTouch(motionEvent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPOIClick(poi: MogoPoi) {
|
||||
mMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onPOIClick(poi)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMapClick(latLng: MogoLatLng) {
|
||||
mMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onMapClick(latLng)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onLockMap(isLock: Boolean) {
|
||||
mMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onLockMap(isLock)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMapModeChanged(ui: EnumMapUI) {
|
||||
mMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onMapModeChanged(ui)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMapVisualAngleChanged(visualAngleMode: VisualAngleMode) {
|
||||
mMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onMapVisualAngleChanged(visualAngleMode)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMapChanged(location: MogoLatLng, zoom: Float, tilt: Float, bearing: Float) {
|
||||
mMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onMapChanged(location, zoom, tilt, bearing)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.mogo.map.location;
|
||||
|
||||
public interface IMogoGDLocationClient {
|
||||
|
||||
/**
|
||||
* 开始定位
|
||||
*/
|
||||
void start();
|
||||
|
||||
/**
|
||||
* 停止定位
|
||||
*/
|
||||
void stop();
|
||||
|
||||
/**
|
||||
* 获取cityCode
|
||||
*/
|
||||
String getLastCityCode();
|
||||
|
||||
double getLastLat();
|
||||
|
||||
double getLastLon();
|
||||
|
||||
}
|
||||
@@ -31,11 +31,6 @@ public class MogoLocationListenerRegister implements IMogoLocationListenerRegist
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private final Set< IMogoLocationListener > sListeners = new HashSet<>( 10 );
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
package com.mogo.map.marker;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Point;
|
||||
import android.view.View;
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
import androidx.annotation.RawRes;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -31,11 +26,6 @@ public interface IMogoMarker {
|
||||
*/
|
||||
void remove();
|
||||
|
||||
/**
|
||||
* 隐藏Marker覆盖物的信息窗口。
|
||||
*/
|
||||
void hideInfoWindow();
|
||||
|
||||
/**
|
||||
* 设置Marker覆盖物的透明度
|
||||
*
|
||||
@@ -43,21 +33,6 @@ public interface IMogoMarker {
|
||||
*/
|
||||
void setAlpha( float alpha );
|
||||
|
||||
/**
|
||||
* 设置Marker覆盖物的锚点比例。
|
||||
*
|
||||
* @param anchorU
|
||||
* @param anchorV
|
||||
*/
|
||||
void setAnchor( float anchorU, float anchorV );
|
||||
|
||||
/**
|
||||
* 设置Marker覆盖物是否允许拖拽。
|
||||
*
|
||||
* @param paramBoolean
|
||||
*/
|
||||
void setDraggable( boolean paramBoolean );
|
||||
|
||||
/**
|
||||
* 设置 Marker覆盖物的图标
|
||||
*
|
||||
@@ -72,14 +47,6 @@ public interface IMogoMarker {
|
||||
*/
|
||||
void setIcons( ArrayList< Bitmap > icons );
|
||||
|
||||
/**
|
||||
* 设置Marker覆盖物的InfoWindow是否允许显示,默认为true
|
||||
* 设置为false之后, 调用Marker.showInfoWindow() 将不会生效
|
||||
*
|
||||
* @param enabled
|
||||
*/
|
||||
void setInfoWindowEnable( boolean enabled );
|
||||
|
||||
/**
|
||||
* 设置Marker覆盖物的属性选项类 通过markerOption 给marker设置属性
|
||||
*
|
||||
@@ -99,13 +66,6 @@ public interface IMogoMarker {
|
||||
*/
|
||||
Object getObject();
|
||||
|
||||
/**
|
||||
* 设置多少帧刷新一次图片资源,Marker动画的间隔时间,值越小动画越快。
|
||||
*
|
||||
* @param period
|
||||
*/
|
||||
void setPeriod( int period );
|
||||
|
||||
/**
|
||||
* 设置位置
|
||||
*
|
||||
@@ -128,13 +88,6 @@ public interface IMogoMarker {
|
||||
*/
|
||||
void setRotateAngle( float rotate );
|
||||
|
||||
/**
|
||||
* 设置Marker 覆盖物的文字片段。
|
||||
*
|
||||
* @param snippet
|
||||
*/
|
||||
void setSnippet( String snippet );
|
||||
|
||||
/**
|
||||
* 设置Marker 覆盖物的标题。
|
||||
*
|
||||
@@ -154,23 +107,6 @@ public interface IMogoMarker {
|
||||
*/
|
||||
void setVisible( boolean visible );
|
||||
|
||||
/**
|
||||
* 设置Marker覆盖物的z轴值。
|
||||
*
|
||||
* @param zIndex
|
||||
*/
|
||||
void setZIndex( int zIndex );
|
||||
|
||||
/**
|
||||
* 显示 Marker 覆盖物的信息窗口。
|
||||
*/
|
||||
void showInfoWindow();
|
||||
|
||||
/**
|
||||
* Marker对象 AssInfo
|
||||
* @return marker对象assInfo
|
||||
*/
|
||||
String getMarkerAssInfo();
|
||||
|
||||
/**
|
||||
* 设置点击事件
|
||||
@@ -186,13 +122,6 @@ public interface IMogoMarker {
|
||||
*/
|
||||
IMogoMarkerClickListener getOnMarkerClickListener();
|
||||
|
||||
/**
|
||||
* 设置自定义infowindow代理对象
|
||||
*
|
||||
* @param adapter
|
||||
*/
|
||||
void setInfoWindowAdapter( IMogoInfoWindowAdapter adapter );
|
||||
|
||||
/**
|
||||
* 自定义 infowindow 样式接口
|
||||
*
|
||||
@@ -200,13 +129,6 @@ public interface IMogoMarker {
|
||||
*/
|
||||
IMogoInfoWindowAdapter getInfoWindowAdapter();
|
||||
|
||||
/**
|
||||
* 自定义marker样式
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
void setMarkerIconView( IMogoMarkerIconViewCreator creator );
|
||||
|
||||
/**
|
||||
* 是否被销毁
|
||||
*
|
||||
@@ -228,13 +150,6 @@ public interface IMogoMarker {
|
||||
*/
|
||||
String getOwner();
|
||||
|
||||
/**
|
||||
* 设置marker在window的位置
|
||||
*
|
||||
* @param position window 的位置。
|
||||
*/
|
||||
void setPositionByPixels( Point position );
|
||||
|
||||
/**
|
||||
* Marker 配置
|
||||
*
|
||||
@@ -243,18 +158,6 @@ public interface IMogoMarker {
|
||||
MogoMarkerOptions getMogoMarkerOptions();
|
||||
|
||||
|
||||
/**
|
||||
* 开始缩放动画
|
||||
*
|
||||
* @param duration
|
||||
* @param interpolator
|
||||
*/
|
||||
void startScaleAnimation( float fromX,
|
||||
float toX,
|
||||
float fromY,
|
||||
float toY,
|
||||
int duration,
|
||||
Interpolator interpolator );
|
||||
|
||||
/**
|
||||
* 缩放动画
|
||||
@@ -275,43 +178,6 @@ public interface IMogoMarker {
|
||||
Interpolator interpolator,
|
||||
OnMarkerAnimationListener listener );
|
||||
|
||||
/**
|
||||
* 缩放动画
|
||||
*
|
||||
* @param fromX
|
||||
* @param toX
|
||||
* @param fromY
|
||||
* @param toY
|
||||
* @param fromAlpha
|
||||
* @param toAlpha
|
||||
* @param duration
|
||||
* @param interpolator
|
||||
* @param listener
|
||||
*/
|
||||
void startScaleAnimationWithAlpha( float fromX,
|
||||
float toX,
|
||||
float fromY,
|
||||
float toY,
|
||||
float fromAlpha,
|
||||
float toAlpha,
|
||||
int duration,
|
||||
Interpolator interpolator,
|
||||
OnMarkerAnimationListener listener );
|
||||
|
||||
|
||||
/**
|
||||
* 弹跳动画
|
||||
*
|
||||
* @param high
|
||||
* @param duration
|
||||
* @param interpolator
|
||||
* @param listener
|
||||
*/
|
||||
void startJumpAnimation( float high,
|
||||
long duration,
|
||||
Interpolator interpolator,
|
||||
OnMarkerAnimationListener listener );
|
||||
|
||||
/**
|
||||
* 是否是否可点击
|
||||
*
|
||||
@@ -319,28 +185,6 @@ public interface IMogoMarker {
|
||||
*/
|
||||
void setClickable( boolean clickable );
|
||||
|
||||
/**
|
||||
* 开始平滑移动
|
||||
*
|
||||
* @param points 坐标点
|
||||
* @param duration 时长
|
||||
*/
|
||||
void startSmooth( List< MogoLatLng > points, int duration );
|
||||
|
||||
/**
|
||||
* 开始平滑移动,毫秒
|
||||
*
|
||||
* @param points 坐标点
|
||||
* @param duration 时长
|
||||
*/
|
||||
void startSmoothInMs( List< MogoLatLng > points, long duration );
|
||||
|
||||
/**
|
||||
* info window 是否正在显示
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isInfoWindowShowing();
|
||||
|
||||
/**
|
||||
* 设置是否是gps
|
||||
@@ -349,31 +193,6 @@ public interface IMogoMarker {
|
||||
*/
|
||||
void setGps( boolean isGps );
|
||||
|
||||
/**
|
||||
* 使用3D资源
|
||||
*/
|
||||
default String use3DResource( @RawRes int model3D ) {
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用缓存过的3d资源
|
||||
*
|
||||
* @param resName
|
||||
*/
|
||||
default void use3DResource( String resName ) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用缓存过的2d资源
|
||||
*
|
||||
* @param resName
|
||||
*/
|
||||
default void use2DResource( String resName ) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置3D车模颜色
|
||||
*
|
||||
@@ -383,18 +202,6 @@ public interface IMogoMarker {
|
||||
|
||||
}
|
||||
|
||||
default void updateInfoWindowView( View view ) {
|
||||
|
||||
}
|
||||
|
||||
default void updateInfoWindowView( String viewResName ) {
|
||||
|
||||
}
|
||||
|
||||
default void setInfoWindowOffset( int offsetX, int offsetY ) {
|
||||
|
||||
}
|
||||
|
||||
default void addDynamicAnchorPosition( MogoLatLng latLng, float angle, long duration ) {
|
||||
|
||||
}
|
||||
@@ -408,12 +215,4 @@ public interface IMogoMarker {
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 marker infowindow 内部使用资源内容 md5
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
default String getMarkerInfoResName() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ public interface IMogoMarkerClickListenerRegister {
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
void registerMarkerClickListener( IMogoMarkerClickListener listener );
|
||||
void registerMarkerClickListener(String tag, IMogoMarkerClickListener listener );
|
||||
|
||||
|
||||
/**
|
||||
* 注销marker回调,各业务模块不需要关注
|
||||
*/
|
||||
void unregisterMarkerClickListener();
|
||||
void unregisterMarkerClickListener(String tag);
|
||||
}
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
package com.mogo.map.marker;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.IMogoMapListenerRegister;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* 管理地图上的所有marker
|
||||
*/
|
||||
public class MogoMarkersHandler implements IMogoMarkerClickListener, IMogoMarkerClickListenerRegister {
|
||||
|
||||
private static volatile MogoMarkersHandler sInstance;
|
||||
private IMogoMarkerClickListener mDelegate;
|
||||
|
||||
public static MogoMarkersHandler getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (MogoMarkersHandler.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MogoMarkersHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private final Map<String, List<IMogoMarker>> mServicesMarkers = new ConcurrentHashMap<>();
|
||||
|
||||
private MogoMarkersHandler() {
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public synchronized void visibleAll() {
|
||||
mServicesMarkers.values().stream()
|
||||
.filter(mogoMarkerList -> mogoMarkerList != null && !mogoMarkerList.isEmpty())
|
||||
.forEach(mogoMarkerList -> mogoMarkerList.forEach(mogoMarker -> mogoMarker.setVisible(true)));
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public synchronized void inVisibleAll() {
|
||||
mServicesMarkers.values().stream()
|
||||
.filter(mogoMarkerList -> mogoMarkerList != null && !mogoMarkerList.isEmpty())
|
||||
.forEach(mogoMarkerList -> mogoMarkerList.forEach(mogoMarker -> mogoMarker.setVisible(false)));
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public synchronized void inVisibleMarkers(String... owner) {
|
||||
mServicesMarkers.values().stream()
|
||||
.filter(mogoMarkerList -> mogoMarkerList != null && !mogoMarkerList.isEmpty())
|
||||
.forEach(mogoMarkerList -> mogoMarkerList.forEach(mogoMarker -> {
|
||||
if (TextUtils.isEmpty(mogoMarker.getOwner())) {
|
||||
mogoMarker.setVisible(false);
|
||||
}
|
||||
if (!Arrays.asList(owner).contains(mogoMarker.getOwner())){
|
||||
mogoMarker.setVisible(false);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public synchronized void removeAll() {
|
||||
final Collection<List<IMogoMarker>> mogoMarkers = mServicesMarkers.values();
|
||||
for (List<IMogoMarker> mogoMarkerList : mogoMarkers) {
|
||||
if (mogoMarkerList != null && !mogoMarkerList.isEmpty()) {
|
||||
for (IMogoMarker mogoMarker : mogoMarkerList) {
|
||||
try {
|
||||
mogoMarker.destroy();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mServicesMarkers.clear();
|
||||
}
|
||||
|
||||
public synchronized void remove(String tag) {
|
||||
List<IMogoMarker> mogoMarkerList = mServicesMarkers.remove(tag);
|
||||
if (mogoMarkerList != null && !mogoMarkerList.isEmpty()) {
|
||||
for (IMogoMarker mogoMarker : mogoMarkerList) {
|
||||
try {
|
||||
mogoMarker.destroy();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
mogoMarkerList.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized List<IMogoMarker> getMarkers(String tag) {
|
||||
return mServicesMarkers.get(tag);
|
||||
}
|
||||
|
||||
|
||||
public synchronized Map<String, List<IMogoMarker>> getAllMarkers() {
|
||||
return mServicesMarkers;
|
||||
}
|
||||
|
||||
|
||||
public synchronized void add(String tag, IMogoMarker marker) {
|
||||
if (marker == null) {
|
||||
return;
|
||||
}
|
||||
if (mServicesMarkers.get(tag) == null) {
|
||||
mServicesMarkers.put(tag, new ArrayList<IMogoMarker>());
|
||||
}
|
||||
mServicesMarkers.get(tag).add(marker);
|
||||
}
|
||||
|
||||
public synchronized void add(String tag, List<IMogoMarker> markers) {
|
||||
if (markers == null || markers.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (mServicesMarkers.get(tag) == null) {
|
||||
mServicesMarkers.put(tag, new ArrayList<IMogoMarker>());
|
||||
}
|
||||
mServicesMarkers.get(tag).addAll(markers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMarkerClickListener(IMogoMarkerClickListener listener) {
|
||||
mDelegate = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMarkerClickListener() {
|
||||
mDelegate = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.onMarkerClicked(marker);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStaticMarkerClicked(IMogoMarker marker) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.onStaticMarkerClicked(marker);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param tag 需要保留的类型
|
||||
*/
|
||||
public void deleteAllExcept(String tag) {
|
||||
if (TextUtils.isEmpty(tag)) {
|
||||
return;
|
||||
}
|
||||
List<IMogoMarker> mogoMarkerList = mServicesMarkers.remove(tag);
|
||||
for (List<IMogoMarker> value : mServicesMarkers.values()) {
|
||||
if (value != null && !value.isEmpty()) {
|
||||
for (IMogoMarker mogoMarker : value) {
|
||||
mogoMarker.destroy();
|
||||
}
|
||||
value.clear();
|
||||
}
|
||||
}
|
||||
mServicesMarkers.put(tag, mogoMarkerList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
package com.mogo.map.marker
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.text.TextUtils
|
||||
import java.util.*
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.function.Consumer
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
*
|
||||
*
|
||||
* 管理地图上的所有marker
|
||||
*/
|
||||
class MogoMarkersHandler private constructor() : IMogoMarkerClickListener,
|
||||
IMogoMarkerClickListenerRegister {
|
||||
|
||||
companion object {
|
||||
val mogoMarkersHandler by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
MogoMarkersHandler()
|
||||
}
|
||||
}
|
||||
|
||||
private val mMap: ConcurrentHashMap<String, IMogoMarkerClickListener> = ConcurrentHashMap()
|
||||
private val mServicesMarkers: MutableMap<String, MutableList<IMogoMarker>?> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
override fun registerMarkerClickListener(tag: String, listener: IMogoMarkerClickListener) {
|
||||
if (mMap.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
mMap[tag] = listener
|
||||
}
|
||||
|
||||
override fun unregisterMarkerClickListener(tag: String) {
|
||||
if (!mMap.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
mMap.remove(tag)
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@Synchronized
|
||||
fun visibleAll() {
|
||||
mServicesMarkers.values.stream()
|
||||
.filter { mogoMarkerList: List<IMogoMarker>? -> mogoMarkerList != null && !mogoMarkerList.isEmpty() }
|
||||
.forEach { mogoMarkerList: List<IMogoMarker>? ->
|
||||
mogoMarkerList!!.forEach(
|
||||
Consumer { mogoMarker: IMogoMarker -> mogoMarker.setVisible(true) })
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@Synchronized
|
||||
fun inVisibleAll() {
|
||||
mServicesMarkers.values.stream()
|
||||
.filter { mogoMarkerList: List<IMogoMarker>? -> mogoMarkerList != null && !mogoMarkerList.isEmpty() }
|
||||
.forEach { mogoMarkerList: List<IMogoMarker>? ->
|
||||
mogoMarkerList!!.forEach(
|
||||
Consumer { mogoMarker: IMogoMarker -> mogoMarker.setVisible(false) })
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@Synchronized
|
||||
fun inVisibleMarkers(vararg owner: String?) {
|
||||
mServicesMarkers.values.stream()
|
||||
.filter { mogoMarkerList: List<IMogoMarker>? -> mogoMarkerList != null && !mogoMarkerList.isEmpty() }
|
||||
.forEach { mogoMarkerList: List<IMogoMarker>? ->
|
||||
mogoMarkerList!!.forEach(
|
||||
Consumer { mogoMarker: IMogoMarker ->
|
||||
if (TextUtils.isEmpty(mogoMarker.owner)) {
|
||||
mogoMarker.setVisible(false)
|
||||
}
|
||||
if (!Arrays.asList(*owner).contains(mogoMarker.owner)) {
|
||||
mogoMarker.setVisible(false)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun removeAll() {
|
||||
val mogoMarkers: Collection<List<IMogoMarker>?> = mServicesMarkers.values
|
||||
for (mogoMarkerList in mogoMarkers) {
|
||||
if (mogoMarkerList != null && !mogoMarkerList.isEmpty()) {
|
||||
for (mogoMarker in mogoMarkerList) {
|
||||
try {
|
||||
mogoMarker.destroy()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mServicesMarkers.clear()
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun remove(tag: String) {
|
||||
val mogoMarkerList = mServicesMarkers.remove(tag)
|
||||
if (mogoMarkerList != null && !mogoMarkerList.isEmpty()) {
|
||||
for (mogoMarker in mogoMarkerList) {
|
||||
try {
|
||||
mogoMarker.destroy()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
mogoMarkerList.clear()
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun getMarkers(tag: String): List<IMogoMarker>? {
|
||||
return mServicesMarkers[tag]
|
||||
}
|
||||
|
||||
@get:Synchronized
|
||||
val allMarkers: Map<String, MutableList<IMogoMarker>?>
|
||||
get() = mServicesMarkers
|
||||
|
||||
@Synchronized
|
||||
fun add(tag: String, marker: IMogoMarker?) {
|
||||
if (marker == null) {
|
||||
return
|
||||
}
|
||||
if (mServicesMarkers[tag] == null) {
|
||||
mServicesMarkers[tag] = ArrayList()
|
||||
}
|
||||
mServicesMarkers[tag]!!.add(marker)
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun add(tag: String, markers: List<IMogoMarker>?) {
|
||||
if (markers == null || markers.isEmpty()) {
|
||||
return
|
||||
}
|
||||
if (mServicesMarkers[tag] == null) {
|
||||
mServicesMarkers[tag] = ArrayList()
|
||||
}
|
||||
mServicesMarkers[tag]!!.addAll(markers)
|
||||
}
|
||||
|
||||
override fun onMarkerClicked(marker: IMogoMarker): Boolean {
|
||||
val iMogoMarker = mMap[marker.owner]
|
||||
return iMogoMarker?.onMarkerClicked(marker) ?: false
|
||||
}
|
||||
|
||||
override fun onStaticMarkerClicked(marker: IMogoMarker): Boolean {
|
||||
val iMogoMarker = mMap[marker.owner]
|
||||
return iMogoMarker?.onStaticMarkerClicked(marker) ?: false
|
||||
}
|
||||
|
||||
/**
|
||||
* @param tag 需要保留的类型
|
||||
*/
|
||||
fun deleteAllExcept(tag: String) {
|
||||
if (TextUtils.isEmpty(tag)) {
|
||||
return
|
||||
}
|
||||
val mogoMarkerList = mServicesMarkers.remove(tag)
|
||||
for (value in mServicesMarkers.values) {
|
||||
if (value != null && value.isNotEmpty()) {
|
||||
for (mogoMarker in value) {
|
||||
mogoMarker.destroy()
|
||||
}
|
||||
value.clear()
|
||||
}
|
||||
}
|
||||
mServicesMarkers[tag] = mogoMarkerList
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-14
|
||||
* <p>
|
||||
* 车辆位置变化
|
||||
*/
|
||||
public interface IMogoCarLocationChangedListener {
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
import android.location.Location;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-14
|
||||
* <p>
|
||||
* 车辆位置变化
|
||||
*/
|
||||
public interface IMogoCarLocationChangedListener2 extends IMogoCarLocationChangedListener {
|
||||
|
||||
void onCarLocationChanged2( Location latLng );
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/23
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
interface IMogoCarLocationChangedListenerRegister {
|
||||
|
||||
/**
|
||||
* 注册车辆位置变化监听,非业务使用
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener );
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/23
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class MogoCarLocationChangedListenerRegister implements IMogoCarLocationChangedListenerRegister {
|
||||
|
||||
private static volatile MogoCarLocationChangedListenerRegister sInstance;
|
||||
private IMogoCarLocationChangedListener2 listener;
|
||||
|
||||
private MogoCarLocationChangedListenerRegister(){}
|
||||
|
||||
public static MogoCarLocationChangedListenerRegister getInstance(){
|
||||
if( sInstance == null ){
|
||||
synchronized( MogoCarLocationChangedListenerRegister.class ) {
|
||||
if( sInstance == null ){
|
||||
sInstance = new MogoCarLocationChangedListenerRegister();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release(){
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册车辆位置变化监听,非业务使用
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
@Override
|
||||
public void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener ) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public IMogoCarLocationChangedListener2 getListener() {
|
||||
return listener;
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import com.mogo.map.IDestroyable;
|
||||
import com.mogo.map.exception.MogoMapException;
|
||||
import com.mogo.map.search.geo.query.MogoGeocodeQuery;
|
||||
import com.mogo.map.search.geo.query.MogoRegeocodeQuery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 地理/逆地理位置搜索
|
||||
*/
|
||||
public interface IMogoGeoSearch extends IDestroyable {
|
||||
|
||||
/**
|
||||
* 添加异步编码回调
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
void setGeoSearchListener( IMogoGeoSearchListener listener );
|
||||
|
||||
/**
|
||||
* 同步获取逆地理编码地址
|
||||
*
|
||||
* @param query
|
||||
* @return
|
||||
* @throws MogoMapException
|
||||
*/
|
||||
@Deprecated
|
||||
MogoRegeocodeAddress getFromLocation( MogoRegeocodeQuery query ) throws MogoMapException;
|
||||
|
||||
/**
|
||||
* 同步获取地理编码地址列表
|
||||
*
|
||||
* @param query
|
||||
* @return
|
||||
* @throws MogoMapException
|
||||
*/
|
||||
@Deprecated
|
||||
List< MogoGeocodeAddress > getFromLocationName( MogoGeocodeQuery query ) throws MogoMapException;
|
||||
|
||||
/**
|
||||
* 异步获取逆地理编码
|
||||
*
|
||||
* @param query
|
||||
*/
|
||||
void getFromLocationAsyn( MogoRegeocodeQuery query );
|
||||
|
||||
/**
|
||||
* 同步获取地理编码回调
|
||||
*
|
||||
* @param query
|
||||
*/
|
||||
void getFromLocationNameAsyn( MogoGeocodeQuery query );
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 逆地理/地理编码回调
|
||||
*/
|
||||
public interface IMogoGeoSearchListener {
|
||||
|
||||
/**
|
||||
* 逆地理编码(根据经纬度获取地理位置信息)
|
||||
*
|
||||
* @param regeocodeResult
|
||||
*/
|
||||
default void onRegeocodeSearched( MogoRegeocodeResult regeocodeResult ){}
|
||||
|
||||
/**
|
||||
* 根据名称和城市获取地理位置信息
|
||||
*
|
||||
* @param geocodeResult
|
||||
*/
|
||||
default void onGeocodeSearched( MogoGeocodeResult geocodeResult ){}
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoAoiItem implements Parcelable {
|
||||
|
||||
private String aoiId;
|
||||
private String aoiName;
|
||||
private String adCode;
|
||||
private MogoLatLng aoiCenterPoint;
|
||||
private float aoiArea;
|
||||
|
||||
public String getAoiId() {
|
||||
return aoiId;
|
||||
}
|
||||
|
||||
public void setAoiId( String aoiId ) {
|
||||
this.aoiId = aoiId;
|
||||
}
|
||||
|
||||
public String getAoiName() {
|
||||
return aoiName;
|
||||
}
|
||||
|
||||
public void setAoiName( String aoiName ) {
|
||||
this.aoiName = aoiName;
|
||||
}
|
||||
|
||||
public String getAdCode() {
|
||||
return adCode;
|
||||
}
|
||||
|
||||
public void setAdCode( String adCode ) {
|
||||
this.adCode = adCode;
|
||||
}
|
||||
|
||||
public MogoLatLng getAoiCenterPoint() {
|
||||
return aoiCenterPoint;
|
||||
}
|
||||
|
||||
public void setAoiCenterPoint( MogoLatLng aoiCenterPoint ) {
|
||||
this.aoiCenterPoint = aoiCenterPoint;
|
||||
}
|
||||
|
||||
public float getAoiArea() {
|
||||
return aoiArea;
|
||||
}
|
||||
|
||||
public void setAoiArea( float aoiArea ) {
|
||||
this.aoiArea = aoiArea;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeString( this.aoiId );
|
||||
dest.writeString( this.aoiName );
|
||||
dest.writeString( this.adCode );
|
||||
dest.writeParcelable( this.aoiCenterPoint, flags );
|
||||
dest.writeFloat( this.aoiArea );
|
||||
}
|
||||
|
||||
public MogoAoiItem() {
|
||||
}
|
||||
|
||||
protected MogoAoiItem( Parcel in ) {
|
||||
this.aoiId = in.readString();
|
||||
this.aoiName = in.readString();
|
||||
this.adCode = in.readString();
|
||||
this.aoiCenterPoint = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
this.aoiArea = in.readFloat();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoAoiItem > CREATOR = new Parcelable.Creator< MogoAoiItem >() {
|
||||
@Override
|
||||
public MogoAoiItem createFromParcel( Parcel source ) {
|
||||
return new MogoAoiItem( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoAoiItem[] newArray( int size ) {
|
||||
return new MogoAoiItem[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoAoiItem{" +
|
||||
"aoiId='" + aoiId + '\'' +
|
||||
", aoiName='" + aoiName + '\'' +
|
||||
", adCode='" + adCode + '\'' +
|
||||
", aoiCenterPoint=" + aoiCenterPoint +
|
||||
", aoiArea=" + aoiArea +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoBusinessArea implements Parcelable {
|
||||
|
||||
private MogoLatLng centerPoint;
|
||||
private String name;
|
||||
|
||||
public MogoLatLng getCenterPoint() {
|
||||
return centerPoint;
|
||||
}
|
||||
|
||||
public void setCenterPoint( MogoLatLng centerPoint ) {
|
||||
this.centerPoint = centerPoint;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName( String name ) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeParcelable( this.centerPoint, flags );
|
||||
dest.writeString( this.name );
|
||||
}
|
||||
|
||||
public MogoBusinessArea() {
|
||||
}
|
||||
|
||||
protected MogoBusinessArea( Parcel in ) {
|
||||
this.centerPoint = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
this.name = in.readString();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoBusinessArea > CREATOR = new Parcelable.Creator< MogoBusinessArea >() {
|
||||
@Override
|
||||
public MogoBusinessArea createFromParcel( Parcel source ) {
|
||||
return new MogoBusinessArea( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoBusinessArea[] newArray( int size ) {
|
||||
return new MogoBusinessArea[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoBusinessArea{" +
|
||||
"centerPoint=" + centerPoint +
|
||||
", name='" + name + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoCrossroad implements Parcelable {
|
||||
|
||||
private float distance;
|
||||
private String direction;
|
||||
private String firstRoadId;
|
||||
private String firstRoadName;
|
||||
private String secondRoadId;
|
||||
private String secondRoadName;
|
||||
|
||||
public float getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance( float distance ) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public String getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection( String direction ) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public String getFirstRoadId() {
|
||||
return firstRoadId;
|
||||
}
|
||||
|
||||
public void setFirstRoadId( String firstRoadId ) {
|
||||
this.firstRoadId = firstRoadId;
|
||||
}
|
||||
|
||||
public String getFirstRoadName() {
|
||||
return firstRoadName;
|
||||
}
|
||||
|
||||
public void setFirstRoadName( String firstRoadName ) {
|
||||
this.firstRoadName = firstRoadName;
|
||||
}
|
||||
|
||||
public String getSecondRoadId() {
|
||||
return secondRoadId;
|
||||
}
|
||||
|
||||
public void setSecondRoadId( String secondRoadId ) {
|
||||
this.secondRoadId = secondRoadId;
|
||||
}
|
||||
|
||||
public String getSecondRoadName() {
|
||||
return secondRoadName;
|
||||
}
|
||||
|
||||
public void setSecondRoadName( String secondRoadName ) {
|
||||
this.secondRoadName = secondRoadName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeFloat( this.distance );
|
||||
dest.writeString( this.direction );
|
||||
dest.writeString( this.firstRoadId );
|
||||
dest.writeString( this.firstRoadName );
|
||||
dest.writeString( this.secondRoadId );
|
||||
dest.writeString( this.secondRoadName );
|
||||
}
|
||||
|
||||
public MogoCrossroad() {
|
||||
}
|
||||
|
||||
protected MogoCrossroad( Parcel in ) {
|
||||
this.distance = in.readFloat();
|
||||
this.direction = in.readString();
|
||||
this.firstRoadId = in.readString();
|
||||
this.firstRoadName = in.readString();
|
||||
this.secondRoadId = in.readString();
|
||||
this.secondRoadName = in.readString();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoCrossroad > CREATOR = new Parcelable.Creator< MogoCrossroad >() {
|
||||
@Override
|
||||
public MogoCrossroad createFromParcel( Parcel source ) {
|
||||
return new MogoCrossroad( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoCrossroad[] newArray( int size ) {
|
||||
return new MogoCrossroad[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoCrossroad{" +
|
||||
"distance=" + distance +
|
||||
", direction='" + direction + '\'' +
|
||||
", firstRoadId='" + firstRoadId + '\'' +
|
||||
", firstRoadName='" + firstRoadName + '\'' +
|
||||
", secondRoadId='" + secondRoadId + '\'' +
|
||||
", secondRoadName='" + secondRoadName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* geo 搜索位置信息
|
||||
*/
|
||||
public class MogoGeocodeAddress {
|
||||
|
||||
private String formatAddress;
|
||||
private String province;
|
||||
private String city;
|
||||
private String district;
|
||||
private String township;
|
||||
private String neighborhood;
|
||||
private String building;
|
||||
private String adcode;
|
||||
private MogoLatLng latlng;
|
||||
private String level;
|
||||
|
||||
public String getFormatAddress() {
|
||||
return formatAddress;
|
||||
}
|
||||
|
||||
public void setFormatAddress( String formatAddress ) {
|
||||
this.formatAddress = formatAddress;
|
||||
}
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
||||
public void setProvince( String province ) {
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity( String city ) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
}
|
||||
|
||||
public void setDistrict( String district ) {
|
||||
this.district = district;
|
||||
}
|
||||
|
||||
public String getTownship() {
|
||||
return township;
|
||||
}
|
||||
|
||||
public void setTownship( String township ) {
|
||||
this.township = township;
|
||||
}
|
||||
|
||||
public String getNeighborhood() {
|
||||
return neighborhood;
|
||||
}
|
||||
|
||||
public void setNeighborhood( String neighborhood ) {
|
||||
this.neighborhood = neighborhood;
|
||||
}
|
||||
|
||||
public String getBuilding() {
|
||||
return building;
|
||||
}
|
||||
|
||||
public void setBuilding( String building ) {
|
||||
this.building = building;
|
||||
}
|
||||
|
||||
public String getAdcode() {
|
||||
return adcode;
|
||||
}
|
||||
|
||||
public void setAdcode( String adcode ) {
|
||||
this.adcode = adcode;
|
||||
}
|
||||
|
||||
public MogoLatLng getLatlng() {
|
||||
return latlng;
|
||||
}
|
||||
|
||||
public void setLatlng( MogoLatLng latlng ) {
|
||||
this.latlng = latlng;
|
||||
}
|
||||
|
||||
public String getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel( String level ) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoGeocodeAddress{" +
|
||||
"formatAddress='" + formatAddress + '\'' +
|
||||
", province='" + province + '\'' +
|
||||
", city='" + city + '\'' +
|
||||
", district='" + district + '\'' +
|
||||
", township='" + township + '\'' +
|
||||
", neighborhood='" + neighborhood + '\'' +
|
||||
", building='" + building + '\'' +
|
||||
", adcode='" + adcode + '\'' +
|
||||
", latlng=" + latlng +
|
||||
", level='" + level + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 地理编码搜索结果
|
||||
*/
|
||||
public class MogoGeocodeResult {
|
||||
|
||||
private List< MogoGeocodeAddress > addresses = new ArrayList<>();
|
||||
|
||||
public List< MogoGeocodeAddress > getAddresses() {
|
||||
return addresses;
|
||||
}
|
||||
|
||||
public void setAddresses( List< MogoGeocodeAddress > addresses ) {
|
||||
this.addresses = addresses;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoGeocodeResult{" +
|
||||
"addresses=" + addresses +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoIndoorData implements Parcelable {
|
||||
|
||||
private String poiId;
|
||||
private int floor;
|
||||
private String floorName;
|
||||
|
||||
public String getPoiId() {
|
||||
return poiId;
|
||||
}
|
||||
|
||||
public void setPoiId( String poiId ) {
|
||||
this.poiId = poiId;
|
||||
}
|
||||
|
||||
public int getFloor() {
|
||||
return floor;
|
||||
}
|
||||
|
||||
public void setFloor( int floor ) {
|
||||
this.floor = floor;
|
||||
}
|
||||
|
||||
public String getFloorName() {
|
||||
return floorName;
|
||||
}
|
||||
|
||||
public void setFloorName( String floorName ) {
|
||||
this.floorName = floorName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeString( this.poiId );
|
||||
dest.writeInt( this.floor );
|
||||
dest.writeString( this.floorName );
|
||||
}
|
||||
|
||||
public MogoIndoorData() {
|
||||
}
|
||||
|
||||
protected MogoIndoorData( Parcel in ) {
|
||||
this.poiId = in.readString();
|
||||
this.floor = in.readInt();
|
||||
this.floorName = in.readString();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoIndoorData > CREATOR = new Parcelable.Creator< MogoIndoorData >() {
|
||||
@Override
|
||||
public MogoIndoorData createFromParcel( Parcel source ) {
|
||||
return new MogoIndoorData( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoIndoorData[] newArray( int size ) {
|
||||
return new MogoIndoorData[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoIndoorData{" +
|
||||
"poiId='" + poiId + '\'' +
|
||||
", floor=" + floor +
|
||||
", floorName='" + floorName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoPhoto implements Parcelable {
|
||||
|
||||
private String title;
|
||||
private String url;
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle( String title ) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl( String url ) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeString( this.title );
|
||||
dest.writeString( this.url );
|
||||
}
|
||||
|
||||
public MogoPhoto() {
|
||||
}
|
||||
|
||||
protected MogoPhoto( Parcel in ) {
|
||||
this.title = in.readString();
|
||||
this.url = in.readString();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoPhoto > CREATOR = new Parcelable.Creator< MogoPhoto >() {
|
||||
@Override
|
||||
public MogoPhoto createFromParcel( Parcel source ) {
|
||||
return new MogoPhoto( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoPhoto[] newArray( int size ) {
|
||||
return new MogoPhoto[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoPhoto{" +
|
||||
"title='" + title + '\'' +
|
||||
", url='" + url + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,389 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoPoiItem implements Parcelable {
|
||||
|
||||
private String businessArea;
|
||||
private String adName;
|
||||
private String cityName;
|
||||
private String provinceName;
|
||||
private String typeDes;
|
||||
private String tel;
|
||||
private String adCode;
|
||||
private String poiId;
|
||||
private int distance;
|
||||
private String title;
|
||||
private String snippet;
|
||||
private MogoLatLng point;
|
||||
private String cityCode;
|
||||
private MogoLatLng enter;
|
||||
private MogoLatLng exit;
|
||||
private String website;
|
||||
private String postcode;
|
||||
private String email;
|
||||
private String direction;
|
||||
private boolean indoorMap;
|
||||
private String provinceCode;
|
||||
private String parkingType;
|
||||
private List< MogoSubPoiItem > subPois = new ArrayList<>();
|
||||
private MogoIndoorData indoorData;
|
||||
private List< MogoPhoto > photos = new ArrayList<>();
|
||||
private MogoPoiItemExtension poiExtension;
|
||||
private String typeCode;
|
||||
private String shopID;
|
||||
|
||||
public String getBusinessArea() {
|
||||
return businessArea;
|
||||
}
|
||||
|
||||
public void setBusinessArea( String businessArea ) {
|
||||
this.businessArea = businessArea;
|
||||
}
|
||||
|
||||
public String getAdName() {
|
||||
return adName;
|
||||
}
|
||||
|
||||
public void setAdName( String adName ) {
|
||||
this.adName = adName;
|
||||
}
|
||||
|
||||
public String getCityName() {
|
||||
return cityName;
|
||||
}
|
||||
|
||||
public void setCityName( String cityName ) {
|
||||
this.cityName = cityName;
|
||||
}
|
||||
|
||||
public String getProvinceName() {
|
||||
return provinceName;
|
||||
}
|
||||
|
||||
public void setProvinceName( String provinceName ) {
|
||||
this.provinceName = provinceName;
|
||||
}
|
||||
|
||||
public String getTypeDes() {
|
||||
return typeDes;
|
||||
}
|
||||
|
||||
public void setTypeDes( String typeDes ) {
|
||||
this.typeDes = typeDes;
|
||||
}
|
||||
|
||||
public String getTel() {
|
||||
return tel;
|
||||
}
|
||||
|
||||
public void setTel( String tel ) {
|
||||
this.tel = tel;
|
||||
}
|
||||
|
||||
public String getAdCode() {
|
||||
return adCode;
|
||||
}
|
||||
|
||||
public void setAdCode( String adCode ) {
|
||||
this.adCode = adCode;
|
||||
}
|
||||
|
||||
public String getPoiId() {
|
||||
return poiId;
|
||||
}
|
||||
|
||||
public void setPoiId( String poiId ) {
|
||||
this.poiId = poiId;
|
||||
}
|
||||
|
||||
public int getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance( int distance ) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle( String title ) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getSnippet() {
|
||||
return snippet;
|
||||
}
|
||||
|
||||
public void setSnippet( String snippet ) {
|
||||
this.snippet = snippet;
|
||||
}
|
||||
|
||||
public MogoLatLng getPoint() {
|
||||
return point;
|
||||
}
|
||||
|
||||
public void setPoint( MogoLatLng point ) {
|
||||
this.point = point;
|
||||
}
|
||||
|
||||
public String getCityCode() {
|
||||
return cityCode;
|
||||
}
|
||||
|
||||
public void setCityCode( String cityCode ) {
|
||||
this.cityCode = cityCode;
|
||||
}
|
||||
|
||||
public MogoLatLng getEnter() {
|
||||
return enter;
|
||||
}
|
||||
|
||||
public void setEnter( MogoLatLng enter ) {
|
||||
this.enter = enter;
|
||||
}
|
||||
|
||||
public MogoLatLng getExit() {
|
||||
return exit;
|
||||
}
|
||||
|
||||
public void setExit( MogoLatLng exit ) {
|
||||
this.exit = exit;
|
||||
}
|
||||
|
||||
public String getWebsite() {
|
||||
return website;
|
||||
}
|
||||
|
||||
public void setWebsite( String website ) {
|
||||
this.website = website;
|
||||
}
|
||||
|
||||
public String getPostcode() {
|
||||
return postcode;
|
||||
}
|
||||
|
||||
public void setPostcode( String postcode ) {
|
||||
this.postcode = postcode;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail( String email ) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection( String direction ) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public boolean isIndoorMap() {
|
||||
return indoorMap;
|
||||
}
|
||||
|
||||
public void setIndoorMap( boolean indoorMap ) {
|
||||
this.indoorMap = indoorMap;
|
||||
}
|
||||
|
||||
public String getProvinceCode() {
|
||||
return provinceCode;
|
||||
}
|
||||
|
||||
public void setProvinceCode( String provinceCode ) {
|
||||
this.provinceCode = provinceCode;
|
||||
}
|
||||
|
||||
public String getParkingType() {
|
||||
return parkingType;
|
||||
}
|
||||
|
||||
public void setParkingType( String parkingType ) {
|
||||
this.parkingType = parkingType;
|
||||
}
|
||||
|
||||
public List< MogoSubPoiItem > getSubPois() {
|
||||
return subPois;
|
||||
}
|
||||
|
||||
public void setSubPois( List< MogoSubPoiItem > subPois ) {
|
||||
this.subPois = subPois;
|
||||
}
|
||||
|
||||
public MogoIndoorData getIndoorData() {
|
||||
return indoorData;
|
||||
}
|
||||
|
||||
public void setIndoorData( MogoIndoorData indoorData ) {
|
||||
this.indoorData = indoorData;
|
||||
}
|
||||
|
||||
public List< MogoPhoto > getPhotos() {
|
||||
return photos;
|
||||
}
|
||||
|
||||
public void setPhotos( List< MogoPhoto > photos ) {
|
||||
this.photos = photos;
|
||||
}
|
||||
|
||||
public MogoPoiItemExtension getPoiExtension() {
|
||||
return poiExtension;
|
||||
}
|
||||
|
||||
public void setPoiExtension( MogoPoiItemExtension poiExtension ) {
|
||||
this.poiExtension = poiExtension;
|
||||
}
|
||||
|
||||
public String getTypeCode() {
|
||||
return typeCode;
|
||||
}
|
||||
|
||||
public void setTypeCode( String typeCode ) {
|
||||
this.typeCode = typeCode;
|
||||
}
|
||||
|
||||
public String getShopID() {
|
||||
return shopID;
|
||||
}
|
||||
|
||||
public void setShopID( String shopID ) {
|
||||
this.shopID = shopID;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeString( this.businessArea );
|
||||
dest.writeString( this.adName );
|
||||
dest.writeString( this.cityName );
|
||||
dest.writeString( this.provinceName );
|
||||
dest.writeString( this.typeDes );
|
||||
dest.writeString( this.tel );
|
||||
dest.writeString( this.adCode );
|
||||
dest.writeString( this.poiId );
|
||||
dest.writeInt( this.distance );
|
||||
dest.writeString( this.title );
|
||||
dest.writeString( this.snippet );
|
||||
dest.writeParcelable( this.point, flags );
|
||||
dest.writeString( this.cityCode );
|
||||
dest.writeParcelable( this.enter, flags );
|
||||
dest.writeParcelable( this.exit, flags );
|
||||
dest.writeString( this.website );
|
||||
dest.writeString( this.postcode );
|
||||
dest.writeString( this.email );
|
||||
dest.writeString( this.direction );
|
||||
dest.writeByte( this.indoorMap ? ( byte ) 1 : ( byte ) 0 );
|
||||
dest.writeString( this.provinceCode );
|
||||
dest.writeString( this.parkingType );
|
||||
dest.writeTypedList( this.subPois );
|
||||
dest.writeParcelable( this.indoorData, flags );
|
||||
dest.writeTypedList( this.photos );
|
||||
dest.writeParcelable( this.poiExtension, flags );
|
||||
dest.writeString( this.typeCode );
|
||||
dest.writeString( this.shopID );
|
||||
}
|
||||
|
||||
public MogoPoiItem() {
|
||||
}
|
||||
|
||||
protected MogoPoiItem( Parcel in ) {
|
||||
this.businessArea = in.readString();
|
||||
this.adName = in.readString();
|
||||
this.cityName = in.readString();
|
||||
this.provinceName = in.readString();
|
||||
this.typeDes = in.readString();
|
||||
this.tel = in.readString();
|
||||
this.adCode = in.readString();
|
||||
this.poiId = in.readString();
|
||||
this.distance = in.readInt();
|
||||
this.title = in.readString();
|
||||
this.snippet = in.readString();
|
||||
this.point = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
this.cityCode = in.readString();
|
||||
this.enter = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
this.exit = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
this.website = in.readString();
|
||||
this.postcode = in.readString();
|
||||
this.email = in.readString();
|
||||
this.direction = in.readString();
|
||||
this.indoorMap = in.readByte() != 0;
|
||||
this.provinceCode = in.readString();
|
||||
this.parkingType = in.readString();
|
||||
this.subPois = in.createTypedArrayList( MogoSubPoiItem.CREATOR );
|
||||
this.indoorData = in.readParcelable( MogoIndoorData.class.getClassLoader() );
|
||||
this.photos = in.createTypedArrayList( MogoPhoto.CREATOR );
|
||||
this.poiExtension = in.readParcelable( MogoPoiItemExtension.class.getClassLoader() );
|
||||
this.typeCode = in.readString();
|
||||
this.shopID = in.readString();
|
||||
}
|
||||
|
||||
public static final Creator< MogoPoiItem > CREATOR = new Creator< MogoPoiItem >() {
|
||||
@Override
|
||||
public MogoPoiItem createFromParcel( Parcel source ) {
|
||||
return new MogoPoiItem( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoPoiItem[] newArray( int size ) {
|
||||
return new MogoPoiItem[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoPoiItem{" +
|
||||
"businessArea='" + businessArea + '\'' +
|
||||
", adName='" + adName + '\'' +
|
||||
", cityName='" + cityName + '\'' +
|
||||
", provinceName='" + provinceName + '\'' +
|
||||
", typeDes='" + typeDes + '\'' +
|
||||
", tel='" + tel + '\'' +
|
||||
", adCode='" + adCode + '\'' +
|
||||
", poiId='" + poiId + '\'' +
|
||||
", distance=" + distance +
|
||||
", title='" + title + '\'' +
|
||||
", snippet='" + snippet + '\'' +
|
||||
", point=" + point +
|
||||
", cityCode='" + cityCode + '\'' +
|
||||
", enter=" + enter +
|
||||
", exit=" + exit +
|
||||
", website='" + website + '\'' +
|
||||
", postcode='" + postcode + '\'' +
|
||||
", email='" + email + '\'' +
|
||||
", direction='" + direction + '\'' +
|
||||
", indoorMap=" + indoorMap +
|
||||
", provinceCode='" + provinceCode + '\'' +
|
||||
", parkingType='" + parkingType + '\'' +
|
||||
", subPois=" + subPois +
|
||||
", indoorData=" + indoorData +
|
||||
", photos=" + photos +
|
||||
", poiExtension=" + poiExtension +
|
||||
", typeCode='" + typeCode + '\'' +
|
||||
", shopID='" + shopID + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoPoiItemExtension implements Parcelable {
|
||||
|
||||
private String opentime;
|
||||
private String rating;
|
||||
|
||||
public String getOpentime() {
|
||||
return opentime;
|
||||
}
|
||||
|
||||
public void setOpentime( String opentime ) {
|
||||
this.opentime = opentime;
|
||||
}
|
||||
|
||||
public String getRating() {
|
||||
return rating;
|
||||
}
|
||||
|
||||
public void setRating( String rating ) {
|
||||
this.rating = rating;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeString( this.opentime );
|
||||
dest.writeString( this.rating );
|
||||
}
|
||||
|
||||
public MogoPoiItemExtension() {
|
||||
}
|
||||
|
||||
protected MogoPoiItemExtension( Parcel in ) {
|
||||
this.opentime = in.readString();
|
||||
this.rating = in.readString();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoPoiItemExtension > CREATOR = new Parcelable.Creator< MogoPoiItemExtension >() {
|
||||
@Override
|
||||
public MogoPoiItemExtension createFromParcel( Parcel source ) {
|
||||
return new MogoPoiItemExtension( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoPoiItemExtension[] newArray( int size ) {
|
||||
return new MogoPoiItemExtension[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,254 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 逆地理编码地址
|
||||
*/
|
||||
public class MogoRegeocodeAddress implements Parcelable {
|
||||
|
||||
private String formatAddress;
|
||||
private String province;
|
||||
private String city;
|
||||
private String cityCode;
|
||||
private String adCode;
|
||||
private String district;
|
||||
private String township;
|
||||
private String neighborhood;
|
||||
private String building;
|
||||
private MogoStreetNumber streetNumber;
|
||||
private List< MogoRegeocodeRoad > roads;
|
||||
private List< MogoPoiItem > pois;
|
||||
private List< MogoCrossroad > crossroads;
|
||||
private List< MogoBusinessArea > businessAreas;
|
||||
private List< MogoAoiItem > aois;
|
||||
private String towncode;
|
||||
private String country;
|
||||
|
||||
public String getFormatAddress() {
|
||||
return formatAddress;
|
||||
}
|
||||
|
||||
public void setFormatAddress( String formatAddress ) {
|
||||
this.formatAddress = formatAddress;
|
||||
}
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
||||
public void setProvince( String province ) {
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity( String city ) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getCityCode() {
|
||||
return cityCode;
|
||||
}
|
||||
|
||||
public void setCityCode( String cityCode ) {
|
||||
this.cityCode = cityCode;
|
||||
}
|
||||
|
||||
public String getAdCode() {
|
||||
return adCode;
|
||||
}
|
||||
|
||||
public void setAdCode( String adCode ) {
|
||||
this.adCode = adCode;
|
||||
}
|
||||
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
}
|
||||
|
||||
public void setDistrict( String district ) {
|
||||
this.district = district;
|
||||
}
|
||||
|
||||
public String getTownship() {
|
||||
return township;
|
||||
}
|
||||
|
||||
public void setTownship( String township ) {
|
||||
this.township = township;
|
||||
}
|
||||
|
||||
public String getNeighborhood() {
|
||||
return neighborhood;
|
||||
}
|
||||
|
||||
public void setNeighborhood( String neighborhood ) {
|
||||
this.neighborhood = neighborhood;
|
||||
}
|
||||
|
||||
public String getBuilding() {
|
||||
return building;
|
||||
}
|
||||
|
||||
public void setBuilding( String building ) {
|
||||
this.building = building;
|
||||
}
|
||||
|
||||
public MogoStreetNumber getStreetNumber() {
|
||||
return streetNumber;
|
||||
}
|
||||
|
||||
public void setStreetNumber( MogoStreetNumber streetNumber ) {
|
||||
this.streetNumber = streetNumber;
|
||||
}
|
||||
|
||||
public List< MogoRegeocodeRoad > getRoads() {
|
||||
return roads;
|
||||
}
|
||||
|
||||
public void setRoads( List< MogoRegeocodeRoad > roads ) {
|
||||
this.roads = roads;
|
||||
}
|
||||
|
||||
public List< MogoPoiItem > getPois() {
|
||||
return pois;
|
||||
}
|
||||
|
||||
public void setPois( List< MogoPoiItem > pois ) {
|
||||
this.pois = pois;
|
||||
}
|
||||
|
||||
public List< MogoCrossroad > getCrossroads() {
|
||||
return crossroads;
|
||||
}
|
||||
|
||||
public void setCrossroads( List< MogoCrossroad > crossroads ) {
|
||||
this.crossroads = crossroads;
|
||||
}
|
||||
|
||||
public List< MogoBusinessArea > getBusinessAreas() {
|
||||
return businessAreas;
|
||||
}
|
||||
|
||||
public void setBusinessAreas( List< MogoBusinessArea > businessAreas ) {
|
||||
this.businessAreas = businessAreas;
|
||||
}
|
||||
|
||||
public List< MogoAoiItem > getAois() {
|
||||
return aois;
|
||||
}
|
||||
|
||||
public void setAois( List< MogoAoiItem > aois ) {
|
||||
this.aois = aois;
|
||||
}
|
||||
|
||||
public String getTowncode() {
|
||||
return towncode;
|
||||
}
|
||||
|
||||
public void setTowncode( String towncode ) {
|
||||
this.towncode = towncode;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setCountry( String country ) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeString( this.formatAddress );
|
||||
dest.writeString( this.province );
|
||||
dest.writeString( this.city );
|
||||
dest.writeString( this.cityCode );
|
||||
dest.writeString( this.adCode );
|
||||
dest.writeString( this.district );
|
||||
dest.writeString( this.township );
|
||||
dest.writeString( this.neighborhood );
|
||||
dest.writeString( this.building );
|
||||
dest.writeParcelable( this.streetNumber, flags );
|
||||
dest.writeTypedList( this.roads );
|
||||
dest.writeTypedList( this.pois );
|
||||
dest.writeTypedList( this.crossroads );
|
||||
dest.writeTypedList( this.businessAreas );
|
||||
dest.writeTypedList( this.aois );
|
||||
dest.writeString( this.towncode );
|
||||
dest.writeString( this.country );
|
||||
}
|
||||
|
||||
public MogoRegeocodeAddress() {
|
||||
}
|
||||
|
||||
protected MogoRegeocodeAddress( Parcel in ) {
|
||||
this.formatAddress = in.readString();
|
||||
this.province = in.readString();
|
||||
this.city = in.readString();
|
||||
this.cityCode = in.readString();
|
||||
this.adCode = in.readString();
|
||||
this.district = in.readString();
|
||||
this.township = in.readString();
|
||||
this.neighborhood = in.readString();
|
||||
this.building = in.readString();
|
||||
this.streetNumber = in.readParcelable( MogoStreetNumber.class.getClassLoader() );
|
||||
this.roads = in.createTypedArrayList( MogoRegeocodeRoad.CREATOR );
|
||||
this.pois = in.createTypedArrayList( MogoPoiItem.CREATOR );
|
||||
this.crossroads = in.createTypedArrayList( MogoCrossroad.CREATOR );
|
||||
this.businessAreas = in.createTypedArrayList( MogoBusinessArea.CREATOR );
|
||||
this.aois = in.createTypedArrayList( MogoAoiItem.CREATOR );
|
||||
this.towncode = in.readString();
|
||||
this.country = in.readString();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoRegeocodeAddress > CREATOR = new Parcelable.Creator< MogoRegeocodeAddress >() {
|
||||
@Override
|
||||
public MogoRegeocodeAddress createFromParcel( Parcel source ) {
|
||||
return new MogoRegeocodeAddress( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoRegeocodeAddress[] newArray( int size ) {
|
||||
return new MogoRegeocodeAddress[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoRegeocodeAddress{" +
|
||||
"formatAddress='" + formatAddress + '\'' +
|
||||
", province='" + province + '\'' +
|
||||
", city='" + city + '\'' +
|
||||
", cityCode='" + cityCode + '\'' +
|
||||
", adCode='" + adCode + '\'' +
|
||||
", district='" + district + '\'' +
|
||||
", township='" + township + '\'' +
|
||||
", neighborhood='" + neighborhood + '\'' +
|
||||
", building='" + building + '\'' +
|
||||
", streetNumber=" + streetNumber +
|
||||
", roads=" + roads +
|
||||
", pois=" + pois +
|
||||
", crossroads=" + crossroads +
|
||||
", businessAreas=" + businessAreas +
|
||||
", aois=" + aois +
|
||||
", towncode='" + towncode + '\'' +
|
||||
", country='" + country + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 逆地理编码结果
|
||||
*/
|
||||
public class MogoRegeocodeResult implements Parcelable {
|
||||
|
||||
private MogoRegeocodeAddress regeocodeAddress;
|
||||
|
||||
public MogoRegeocodeAddress getRegeocodeAddress() {
|
||||
return regeocodeAddress;
|
||||
}
|
||||
|
||||
public void setRegeocodeAddress( MogoRegeocodeAddress regeocodeAddress ) {
|
||||
this.regeocodeAddress = regeocodeAddress;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeParcelable( this.regeocodeAddress, flags );
|
||||
}
|
||||
|
||||
public MogoRegeocodeResult() {
|
||||
}
|
||||
|
||||
protected MogoRegeocodeResult( Parcel in ) {
|
||||
this.regeocodeAddress = in.readParcelable( MogoRegeocodeAddress.class.getClassLoader() );
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoRegeocodeResult > CREATOR = new Parcelable.Creator< MogoRegeocodeResult >() {
|
||||
@Override
|
||||
public MogoRegeocodeResult createFromParcel( Parcel source ) {
|
||||
return new MogoRegeocodeResult( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoRegeocodeResult[] newArray( int size ) {
|
||||
return new MogoRegeocodeResult[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoRegeocodeResult{" +
|
||||
"regeocodeAddress=" + regeocodeAddress +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoRegeocodeRoad implements Parcelable {
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private float distance;
|
||||
private String direction;
|
||||
private MogoLatLng point;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId( String id ) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName( String name ) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public float getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance( float distance ) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public String getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection( String direction ) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public MogoLatLng getPoint() {
|
||||
return point;
|
||||
}
|
||||
|
||||
public void setPoint( MogoLatLng point ) {
|
||||
this.point = point;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeString( this.id );
|
||||
dest.writeString( this.name );
|
||||
dest.writeFloat( this.distance );
|
||||
dest.writeString( this.direction );
|
||||
dest.writeParcelable( this.point, flags );
|
||||
}
|
||||
|
||||
public MogoRegeocodeRoad() {
|
||||
}
|
||||
|
||||
protected MogoRegeocodeRoad( Parcel in ) {
|
||||
this.id = in.readString();
|
||||
this.name = in.readString();
|
||||
this.distance = in.readFloat();
|
||||
this.direction = in.readString();
|
||||
this.point = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoRegeocodeRoad > CREATOR = new Parcelable.Creator< MogoRegeocodeRoad >() {
|
||||
@Override
|
||||
public MogoRegeocodeRoad createFromParcel( Parcel source ) {
|
||||
return new MogoRegeocodeRoad( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoRegeocodeRoad[] newArray( int size ) {
|
||||
return new MogoRegeocodeRoad[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoRegeocodeRoad{" +
|
||||
"id='" + id + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", distance=" + distance +
|
||||
", direction='" + direction + '\'' +
|
||||
", point=" + point +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoStreetNumber implements Parcelable {
|
||||
|
||||
private String street;
|
||||
private String number;
|
||||
private MogoLatLng latLonPoint;
|
||||
private String direction;
|
||||
private float distance;
|
||||
|
||||
public String getStreet() {
|
||||
return street;
|
||||
}
|
||||
|
||||
public void setStreet( String street ) {
|
||||
this.street = street;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber( String number ) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public MogoLatLng getLatLonPoint() {
|
||||
return latLonPoint;
|
||||
}
|
||||
|
||||
public void setLatLonPoint( MogoLatLng latLonPoint ) {
|
||||
this.latLonPoint = latLonPoint;
|
||||
}
|
||||
|
||||
public String getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection( String direction ) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public float getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance( float distance ) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeString( this.street );
|
||||
dest.writeString( this.number );
|
||||
dest.writeParcelable( this.latLonPoint, flags );
|
||||
dest.writeString( this.direction );
|
||||
dest.writeFloat( this.distance );
|
||||
}
|
||||
|
||||
public MogoStreetNumber() {
|
||||
}
|
||||
|
||||
protected MogoStreetNumber( Parcel in ) {
|
||||
this.street = in.readString();
|
||||
this.number = in.readString();
|
||||
this.latLonPoint = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
this.direction = in.readString();
|
||||
this.distance = in.readFloat();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoStreetNumber > CREATOR = new Parcelable.Creator< MogoStreetNumber >() {
|
||||
@Override
|
||||
public MogoStreetNumber createFromParcel( Parcel source ) {
|
||||
return new MogoStreetNumber( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoStreetNumber[] newArray( int size ) {
|
||||
return new MogoStreetNumber[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoStreetNumber{" +
|
||||
"street='" + street + '\'' +
|
||||
", number='" + number + '\'' +
|
||||
", latLonPoint=" + latLonPoint +
|
||||
", direction='" + direction + '\'' +
|
||||
", distance=" + distance +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
package com.mogo.map.search.geo;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoSubPoiItem implements Parcelable {
|
||||
|
||||
private String poiId;
|
||||
private String title;
|
||||
private String subName;
|
||||
private int distance;
|
||||
private MogoLatLng point;
|
||||
private String snippet;
|
||||
private String subTypeDes;
|
||||
|
||||
public String getPoiId() {
|
||||
return poiId;
|
||||
}
|
||||
|
||||
public void setPoiId( String poiId ) {
|
||||
this.poiId = poiId;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle( String title ) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getSubName() {
|
||||
return subName;
|
||||
}
|
||||
|
||||
public void setSubName( String subName ) {
|
||||
this.subName = subName;
|
||||
}
|
||||
|
||||
public int getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance( int distance ) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public MogoLatLng getPoint() {
|
||||
return point;
|
||||
}
|
||||
|
||||
public void setPoint( MogoLatLng point ) {
|
||||
this.point = point;
|
||||
}
|
||||
|
||||
public String getSnippet() {
|
||||
return snippet;
|
||||
}
|
||||
|
||||
public void setSnippet( String snippet ) {
|
||||
this.snippet = snippet;
|
||||
}
|
||||
|
||||
public String getSubTypeDes() {
|
||||
return subTypeDes;
|
||||
}
|
||||
|
||||
public void setSubTypeDes( String subTypeDes ) {
|
||||
this.subTypeDes = subTypeDes;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeString( this.poiId );
|
||||
dest.writeString( this.title );
|
||||
dest.writeString( this.subName );
|
||||
dest.writeInt( this.distance );
|
||||
dest.writeParcelable( this.point, flags );
|
||||
dest.writeString( this.snippet );
|
||||
dest.writeString( this.subTypeDes );
|
||||
}
|
||||
|
||||
public MogoSubPoiItem() {
|
||||
}
|
||||
|
||||
protected MogoSubPoiItem( Parcel in ) {
|
||||
this.poiId = in.readString();
|
||||
this.title = in.readString();
|
||||
this.subName = in.readString();
|
||||
this.distance = in.readInt();
|
||||
this.point = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
this.snippet = in.readString();
|
||||
this.subTypeDes = in.readString();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoSubPoiItem > CREATOR = new Parcelable.Creator< MogoSubPoiItem >() {
|
||||
@Override
|
||||
public MogoSubPoiItem createFromParcel( Parcel source ) {
|
||||
return new MogoSubPoiItem( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoSubPoiItem[] newArray( int size ) {
|
||||
return new MogoSubPoiItem[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoSubPoiItem{" +
|
||||
"poiId='" + poiId + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
", subName='" + subName + '\'' +
|
||||
", distance=" + distance +
|
||||
", point=" + point +
|
||||
", snippet='" + snippet + '\'' +
|
||||
", subTypeDes='" + subTypeDes + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package com.mogo.map.search.geo.query;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 地理编码查询条件
|
||||
*/
|
||||
public class MogoGeocodeQuery implements Parcelable {
|
||||
private String locationName;
|
||||
private String city;
|
||||
|
||||
public String getLocationName() {
|
||||
return locationName;
|
||||
}
|
||||
|
||||
public void setLocationName( String locationName ) {
|
||||
this.locationName = locationName;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity( String city ) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public boolean check(){
|
||||
if ( TextUtils.isEmpty( locationName ) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeString( this.locationName );
|
||||
dest.writeString( this.city );
|
||||
}
|
||||
|
||||
public MogoGeocodeQuery() {
|
||||
}
|
||||
|
||||
protected MogoGeocodeQuery( Parcel in ) {
|
||||
this.locationName = in.readString();
|
||||
this.city = in.readString();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoGeocodeQuery > CREATOR = new Parcelable.Creator< MogoGeocodeQuery >() {
|
||||
@Override
|
||||
public MogoGeocodeQuery createFromParcel( Parcel source ) {
|
||||
return new MogoGeocodeQuery( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoGeocodeQuery[] newArray( int size ) {
|
||||
return new MogoGeocodeQuery[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
package com.mogo.map.search.geo.query;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 逆地理编码查询条件
|
||||
*/
|
||||
public class MogoRegeocodeQuery implements Parcelable {
|
||||
|
||||
private MogoLatLng point;
|
||||
private int radius;
|
||||
private String latlngType;
|
||||
private String poiType;
|
||||
|
||||
public MogoLatLng getPoint() {
|
||||
return point;
|
||||
}
|
||||
|
||||
public void setPoint( MogoLatLng point ) {
|
||||
this.point = point;
|
||||
}
|
||||
|
||||
public int getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
public void setRadius( int radius ) {
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public String getLatlngType() {
|
||||
return latlngType;
|
||||
}
|
||||
|
||||
public void setLatlngType( String latlngType ) {
|
||||
this.latlngType = latlngType;
|
||||
}
|
||||
|
||||
public String getPoiType() {
|
||||
return poiType;
|
||||
}
|
||||
|
||||
public void setPoiType( String poiType ) {
|
||||
this.poiType = poiType;
|
||||
}
|
||||
|
||||
public boolean check() {
|
||||
if ( point == null ) {
|
||||
return false;
|
||||
}
|
||||
if ( point.lat < 1 && point.lon < 1 ) {
|
||||
return false;
|
||||
}
|
||||
if ( radius < 0 ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeParcelable( this.point, flags );
|
||||
dest.writeFloat( this.radius );
|
||||
dest.writeString( this.latlngType );
|
||||
dest.writeString( this.poiType );
|
||||
}
|
||||
|
||||
public MogoRegeocodeQuery() {
|
||||
}
|
||||
|
||||
protected MogoRegeocodeQuery( Parcel in ) {
|
||||
this.point = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
this.radius = in.readInt();
|
||||
this.latlngType = in.readString();
|
||||
this.poiType = in.readString();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoRegeocodeQuery > CREATOR = new Parcelable.Creator< MogoRegeocodeQuery >() {
|
||||
@Override
|
||||
public MogoRegeocodeQuery createFromParcel( Parcel source ) {
|
||||
return new MogoRegeocodeQuery( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoRegeocodeQuery[] newArray( int size ) {
|
||||
return new MogoRegeocodeQuery[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.mogo.map.search.inputtips;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-20
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public interface IMogoInputtipsListener {
|
||||
|
||||
void onGetInputtips( List< MogoTip > result );
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.mogo.map.search.inputtips;
|
||||
|
||||
import com.mogo.map.IDestroyable;
|
||||
import com.mogo.map.exception.MogoMapException;
|
||||
import com.mogo.map.search.inputtips.query.MogoInputtipsQuery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-20
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public interface IMogoInputtipsSearch extends IDestroyable {
|
||||
|
||||
void setQuery( MogoInputtipsQuery query );
|
||||
|
||||
void setInputtipsListener( IMogoInputtipsListener listener );
|
||||
|
||||
void requestInputtipsAsyn();
|
||||
}
|
||||
|
||||
@@ -1,120 +0,0 @@
|
||||
package com.mogo.map.search.inputtips;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-20
|
||||
* <p>
|
||||
* inputtips 搜索结果
|
||||
*/
|
||||
public class MogoTip implements Parcelable {
|
||||
|
||||
private String poiID;
|
||||
private MogoLatLng point;
|
||||
private String name;
|
||||
private String district;
|
||||
private String adCode;
|
||||
private String address;
|
||||
private String typeCode;
|
||||
|
||||
public String getPoiID() {
|
||||
return poiID;
|
||||
}
|
||||
|
||||
public void setPoiID( String poiID ) {
|
||||
this.poiID = poiID;
|
||||
}
|
||||
|
||||
public MogoLatLng getPoint() {
|
||||
return point;
|
||||
}
|
||||
|
||||
public void setPoint( MogoLatLng point ) {
|
||||
this.point = point;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName( String name ) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
}
|
||||
|
||||
public void setDistrict( String district ) {
|
||||
this.district = district;
|
||||
}
|
||||
|
||||
public String getAdCode() {
|
||||
return adCode;
|
||||
}
|
||||
|
||||
public void setAdCode( String adCode ) {
|
||||
this.adCode = adCode;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress( String address ) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getTypeCode() {
|
||||
return typeCode;
|
||||
}
|
||||
|
||||
public void setTypeCode( String typeCode ) {
|
||||
this.typeCode = typeCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeString( this.poiID );
|
||||
dest.writeParcelable( this.point, flags );
|
||||
dest.writeString( this.name );
|
||||
dest.writeString( this.district );
|
||||
dest.writeString( this.adCode );
|
||||
dest.writeString( this.address );
|
||||
dest.writeString( this.typeCode );
|
||||
}
|
||||
|
||||
public MogoTip() {
|
||||
}
|
||||
|
||||
protected MogoTip( Parcel in ) {
|
||||
this.poiID = in.readString();
|
||||
this.point = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
this.name = in.readString();
|
||||
this.district = in.readString();
|
||||
this.adCode = in.readString();
|
||||
this.address = in.readString();
|
||||
this.typeCode = in.readString();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoTip > CREATOR = new Parcelable.Creator< MogoTip >() {
|
||||
@Override
|
||||
public MogoTip createFromParcel( Parcel source ) {
|
||||
return new MogoTip( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoTip[] newArray( int size ) {
|
||||
return new MogoTip[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.mogo.map.search.inputtips.query;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-20
|
||||
* <p>
|
||||
* inputtips 搜索条件
|
||||
*/
|
||||
public class MogoInputtipsQuery {
|
||||
|
||||
private String keyword;
|
||||
private String city;
|
||||
private String type;
|
||||
private boolean cityLimit;
|
||||
private MogoLatLng location;
|
||||
|
||||
public String getKeyword() {
|
||||
return keyword;
|
||||
}
|
||||
|
||||
public void setKeyword( String keyword ) {
|
||||
this.keyword = keyword;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity( String city ) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType( String type ) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public boolean isCityLimit() {
|
||||
return cityLimit;
|
||||
}
|
||||
|
||||
public void setCityLimit( boolean cityLimit ) {
|
||||
this.cityLimit = cityLimit;
|
||||
}
|
||||
|
||||
public MogoLatLng getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation( MogoLatLng location ) {
|
||||
this.location = location;
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.mogo.map.search.poisearch;
|
||||
|
||||
import com.mogo.map.IDestroyable;
|
||||
import com.mogo.map.exception.MogoMapException;
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* poi 搜索
|
||||
*/
|
||||
public interface IMogoPoiSearch extends IDestroyable {
|
||||
|
||||
void setPoiSearchListener( IMogoPoiSearchListener listener );
|
||||
|
||||
/**
|
||||
* 异步搜索poi信息
|
||||
*/
|
||||
void searchPOIAsyn();
|
||||
|
||||
/**
|
||||
* 同步搜索poi信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
MogoPoiResult searchPOI() throws MogoMapException;
|
||||
|
||||
/**
|
||||
* 设置查询条件
|
||||
*
|
||||
* @param query
|
||||
*/
|
||||
void setQuery( MogoPoiSearchQuery query );
|
||||
|
||||
/**
|
||||
* 根据poiId搜索详情,同步
|
||||
*
|
||||
* @param poiId
|
||||
* @return
|
||||
*/
|
||||
MogoPoiItem searchPOIId( String poiId ) throws MogoMapException;
|
||||
|
||||
/**
|
||||
* 根据poiId搜索详情,异步
|
||||
*
|
||||
* @param poiId
|
||||
*/
|
||||
void searchPOIIdAsyn( String poiId );
|
||||
|
||||
/**
|
||||
* 周边检索POI
|
||||
*
|
||||
* @param bound
|
||||
*/
|
||||
void setBound( MogoSearchBound bound );
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.mogo.map.search.poisearch;
|
||||
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* poi 检索结果回调
|
||||
*/
|
||||
public interface IMogoPoiSearchListener {
|
||||
|
||||
/**
|
||||
* 返回POI搜索异步处理的结果。
|
||||
*/
|
||||
void onPoiSearched( MogoPoiResult result, int errorCode );
|
||||
|
||||
/**
|
||||
* poi ID 检索结果回调方法
|
||||
*/
|
||||
void onPoiItemSearched( MogoPoiItem item, int errorCode );
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.mogo.map.search.poisearch;
|
||||
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* poi搜索结果集
|
||||
*/
|
||||
public class MogoPoiResult {
|
||||
|
||||
private ArrayList< MogoPoiItem > pois;
|
||||
|
||||
public ArrayList< MogoPoiItem > getPois() {
|
||||
return pois;
|
||||
}
|
||||
|
||||
public void setPois( ArrayList< MogoPoiItem > pois ) {
|
||||
this.pois = pois;
|
||||
}
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
package com.mogo.map.search.poisearch;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* 周边搜索范围
|
||||
*/
|
||||
public class MogoSearchBound implements Parcelable {
|
||||
|
||||
public static final String SHAPE_BOUND = "Bound";
|
||||
public static final String SHAPE_RECTANGLE = "Rectangle";
|
||||
public static final String SHAPE_POLYGON = "Polygon";
|
||||
|
||||
/**
|
||||
* 中心点
|
||||
*/
|
||||
private MogoLatLng centerPoint;
|
||||
/**
|
||||
* 半径:米
|
||||
*/
|
||||
private int radiusInMeters;
|
||||
|
||||
/**
|
||||
* 搜索范围的形状
|
||||
*/
|
||||
private String shape;
|
||||
|
||||
/**
|
||||
* 按距离排序
|
||||
*/
|
||||
private boolean isDistanceSort;
|
||||
|
||||
/**
|
||||
* 左下角
|
||||
*/
|
||||
private MogoLatLng lowerLeft;
|
||||
/**
|
||||
* 右上角
|
||||
*/
|
||||
private MogoLatLng upperRight;
|
||||
|
||||
/**
|
||||
* 范围搜索地点列表
|
||||
*/
|
||||
private List< MogoLatLng > polyGonList;
|
||||
|
||||
public MogoSearchBound( MogoLatLng centerPoint, int radiusInMeters ) {
|
||||
this( centerPoint, radiusInMeters, true );
|
||||
}
|
||||
|
||||
public MogoSearchBound( MogoLatLng centerPoint, int radiusInMeters, boolean isDistanceSort ) {
|
||||
this.centerPoint = centerPoint;
|
||||
this.radiusInMeters = radiusInMeters;
|
||||
this.isDistanceSort = isDistanceSort;
|
||||
this.shape = SHAPE_BOUND;
|
||||
}
|
||||
|
||||
public MogoSearchBound( MogoLatLng lowerLeft, MogoLatLng upperRight ) {
|
||||
this.lowerLeft = lowerLeft;
|
||||
this.upperRight = upperRight;
|
||||
this.shape = SHAPE_RECTANGLE;
|
||||
}
|
||||
|
||||
public MogoSearchBound( List< MogoLatLng > polyGonList ) {
|
||||
this.polyGonList = polyGonList;
|
||||
this.shape = SHAPE_POLYGON;
|
||||
}
|
||||
|
||||
public MogoLatLng getCenterPoint() {
|
||||
return centerPoint;
|
||||
}
|
||||
|
||||
public int getRadiusInMeters() {
|
||||
return radiusInMeters;
|
||||
}
|
||||
|
||||
public String getShape() {
|
||||
return shape;
|
||||
}
|
||||
|
||||
public boolean isDistanceSort() {
|
||||
return isDistanceSort;
|
||||
}
|
||||
|
||||
public MogoLatLng getLowerLeft() {
|
||||
return lowerLeft;
|
||||
}
|
||||
|
||||
public MogoLatLng getUpperRight() {
|
||||
return upperRight;
|
||||
}
|
||||
|
||||
public List< MogoLatLng > getPolyGonList() {
|
||||
return polyGonList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeParcelable( this.centerPoint, flags );
|
||||
dest.writeInt( this.radiusInMeters );
|
||||
dest.writeString( this.shape );
|
||||
dest.writeByte( this.isDistanceSort ? ( byte ) 1 : ( byte ) 0 );
|
||||
dest.writeParcelable( this.lowerLeft, flags );
|
||||
dest.writeParcelable( this.upperRight, flags );
|
||||
dest.writeTypedList( this.polyGonList );
|
||||
}
|
||||
|
||||
protected MogoSearchBound( Parcel in ) {
|
||||
this.centerPoint = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
this.radiusInMeters = in.readInt();
|
||||
this.shape = in.readString();
|
||||
this.isDistanceSort = in.readByte() != 0;
|
||||
this.lowerLeft = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
this.upperRight = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
this.polyGonList = in.createTypedArrayList( MogoLatLng.CREATOR );
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoSearchBound > CREATOR = new Parcelable.Creator< MogoSearchBound >() {
|
||||
@Override
|
||||
public MogoSearchBound createFromParcel( Parcel source ) {
|
||||
return new MogoSearchBound( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoSearchBound[] newArray( int size ) {
|
||||
return new MogoSearchBound[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,159 +0,0 @@
|
||||
package com.mogo.map.search.poisearch.query;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* poi 搜索查询条件
|
||||
*/
|
||||
public class MogoPoiSearchQuery implements Parcelable {
|
||||
|
||||
private String query = "";
|
||||
private String category;
|
||||
private String city;
|
||||
private String building;
|
||||
private int pageNum;
|
||||
private int pageSize;
|
||||
private boolean isCityLimit;
|
||||
private boolean isSubPois;
|
||||
private boolean isDistanceSort = true;
|
||||
private MogoLatLng location;
|
||||
|
||||
/**
|
||||
* @param query 查询字符串,多个关键字用“|”分割
|
||||
* @param category 类型的组合,比如定义如下组合:餐馆|电影院|景点
|
||||
*/
|
||||
public MogoPoiSearchQuery( String query, String category ) {
|
||||
this.query = query;
|
||||
this.category = category;
|
||||
this.city = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param query 查询字符串,多个关键字用“|”分割
|
||||
* @param category 类型的组合,比如定义如下组合:餐馆|电影院|景点
|
||||
*/
|
||||
public MogoPoiSearchQuery( String query, String category, String city ) {
|
||||
this.query = query;
|
||||
this.category = category;
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getBuilding() {
|
||||
return building;
|
||||
}
|
||||
|
||||
public void setBuilding( String building ) {
|
||||
this.building = building;
|
||||
}
|
||||
|
||||
public String getQuery() {
|
||||
return query;
|
||||
}
|
||||
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public int getPageNum() {
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum( int pageNum ) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize( int pageSize ) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public boolean isCityLimit() {
|
||||
return isCityLimit;
|
||||
}
|
||||
|
||||
public void setCityLimit( boolean cityLimit ) {
|
||||
isCityLimit = cityLimit;
|
||||
}
|
||||
|
||||
public boolean isSubPois() {
|
||||
return isSubPois;
|
||||
}
|
||||
|
||||
public void setSubPois( boolean subPois ) {
|
||||
isSubPois = subPois;
|
||||
}
|
||||
|
||||
public boolean isDistanceSort() {
|
||||
return isDistanceSort;
|
||||
}
|
||||
|
||||
public void setDistanceSort( boolean distanceSort ) {
|
||||
isDistanceSort = distanceSort;
|
||||
}
|
||||
|
||||
public MogoLatLng getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation( MogoLatLng location ) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeString( this.building );
|
||||
dest.writeString( this.category );
|
||||
dest.writeString( this.city );
|
||||
dest.writeInt( this.pageNum );
|
||||
dest.writeInt( this.pageSize );
|
||||
dest.writeByte( this.isCityLimit ? ( byte ) 1 : ( byte ) 0 );
|
||||
dest.writeByte( this.isSubPois ? ( byte ) 1 : ( byte ) 0 );
|
||||
dest.writeByte( this.isDistanceSort ? ( byte ) 1 : ( byte ) 0 );
|
||||
dest.writeParcelable( this.location, flags );
|
||||
}
|
||||
|
||||
public MogoPoiSearchQuery() {
|
||||
}
|
||||
|
||||
protected MogoPoiSearchQuery( Parcel in ) {
|
||||
this.building = in.readString();
|
||||
this.category = in.readString();
|
||||
this.city = in.readString();
|
||||
this.pageNum = in.readInt();
|
||||
this.pageSize = in.readInt();
|
||||
this.isCityLimit = in.readByte() != 0;
|
||||
this.isSubPois = in.readByte() != 0;
|
||||
this.isDistanceSort = in.readByte() != 0;
|
||||
this.location = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoPoiSearchQuery > CREATOR = new Parcelable.Creator< MogoPoiSearchQuery >() {
|
||||
@Override
|
||||
public MogoPoiSearchQuery createFromParcel( Parcel source ) {
|
||||
return new MogoPoiSearchQuery( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoPoiSearchQuery[] newArray( int size ) {
|
||||
return new MogoPoiSearchQuery[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.mogo.map.search.traffic;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
public interface IMogoTrafficSearch {
|
||||
|
||||
/**
|
||||
* 根据道路名称查询交通态势
|
||||
*
|
||||
* @param adCode 城市code
|
||||
* @param roadName 道路名称
|
||||
*/
|
||||
void searchTrafficByRoad(String adCode,String roadName);
|
||||
|
||||
/**
|
||||
* 根据圆形区域查询交通态势
|
||||
*
|
||||
* @param mogoLatLng 中心点坐标
|
||||
* @param radius 查询半径
|
||||
*/
|
||||
void searchTrafficByCircleArea(MogoLatLng mogoLatLng,int radius);
|
||||
|
||||
/**
|
||||
* 交通态势查询监听
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
void registerTrafficSearchListener(IMogoTrafficSearchListener listener);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.mogo.map.search.traffic;
|
||||
|
||||
public interface IMogoTrafficSearchListener {
|
||||
|
||||
void onTrafficSearchInfo(MogoTrafficResult trafficResult);
|
||||
|
||||
void onTrafficSearchError(String errorMsg);
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.mogo.map.search.traffic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MogoTrafficResult {
|
||||
|
||||
//路况描述信息
|
||||
private String description;
|
||||
|
||||
//路况评价信息
|
||||
private MogoTrafficStatusEvaluation evaluation;
|
||||
|
||||
//道路列表
|
||||
private List<MogoTrafficStatusInfo> trafficStatusInfos;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public MogoTrafficStatusEvaluation getEvaluation() {
|
||||
return evaluation;
|
||||
}
|
||||
|
||||
public void setEvaluation(MogoTrafficStatusEvaluation evaluation) {
|
||||
this.evaluation = evaluation;
|
||||
}
|
||||
|
||||
public List<MogoTrafficStatusInfo> getTrafficStatusInfos() {
|
||||
return trafficStatusInfos;
|
||||
}
|
||||
|
||||
public void setTrafficStatusInfos(List<MogoTrafficStatusInfo> trafficStatusInfos) {
|
||||
this.trafficStatusInfos = trafficStatusInfos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoTrafficResult{" +
|
||||
"description='" + description + '\'' +
|
||||
", evaluation=" + evaluation +
|
||||
", trafficStatusInfos=" + trafficStatusInfos +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package com.mogo.map.search.traffic;
|
||||
|
||||
//交通态势搜索返回的路况信息
|
||||
public class MogoTrafficStatusEvaluation {
|
||||
|
||||
//拥堵所占百分比
|
||||
private String blocked;
|
||||
|
||||
//缓行所占百分比
|
||||
private String congested;
|
||||
|
||||
//路况描述
|
||||
private String description;
|
||||
|
||||
//畅通所占百分比
|
||||
private String expedite;
|
||||
|
||||
//路况状态
|
||||
private String status;
|
||||
|
||||
//未知路段所占百分比
|
||||
private String unKnown;
|
||||
|
||||
public String getBlocked() {
|
||||
return blocked;
|
||||
}
|
||||
|
||||
public void setBlocked(String blocked) {
|
||||
this.blocked = blocked;
|
||||
}
|
||||
|
||||
public String getCongested() {
|
||||
return congested;
|
||||
}
|
||||
|
||||
public void setCongested(String congested) {
|
||||
this.congested = congested;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getExpedite() {
|
||||
return expedite;
|
||||
}
|
||||
|
||||
public void setExpedite(String expedite) {
|
||||
this.expedite = expedite;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getUnKnown() {
|
||||
return unKnown;
|
||||
}
|
||||
|
||||
public void setUnKnown(String unKnown) {
|
||||
this.unKnown = unKnown;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoTrafficStatusEvaluation{" +
|
||||
"blocked='" + blocked + '\'' +
|
||||
", congested='" + congested + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", expedite='" + expedite + '\'' +
|
||||
", status='" + status + '\'' +
|
||||
", unKnown='" + unKnown + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
package com.mogo.map.search.traffic;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//交通态势查询结果返回道路信息
|
||||
public class MogoTrafficStatusInfo {
|
||||
|
||||
//车行角度
|
||||
private int angle;
|
||||
|
||||
//坐标集合
|
||||
private List<MogoLatLng> mogoLatLngs;
|
||||
|
||||
//方向描述
|
||||
private String direction;
|
||||
|
||||
//方向
|
||||
private String lcodes;
|
||||
|
||||
//设置的道路名称
|
||||
private String name;
|
||||
|
||||
//路况状态
|
||||
private String status;
|
||||
|
||||
public int getAngle() {
|
||||
return angle;
|
||||
}
|
||||
|
||||
public void setAngle(int angle) {
|
||||
this.angle = angle;
|
||||
}
|
||||
|
||||
public List<MogoLatLng> getMogoLatLngs() {
|
||||
return mogoLatLngs;
|
||||
}
|
||||
|
||||
public void setMogoLatLngs(List<MogoLatLng> mogoLatLngs) {
|
||||
this.mogoLatLngs = mogoLatLngs;
|
||||
}
|
||||
|
||||
public String getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(String direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public String getLcodes() {
|
||||
return lcodes;
|
||||
}
|
||||
|
||||
public void setLcodes(String lcodes) {
|
||||
this.lcodes = lcodes;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoTrafficStatusInfo{" +
|
||||
"angle=" + angle +
|
||||
", mogoLatLngs=" + mogoLatLngs +
|
||||
", direction='" + direction + '\'' +
|
||||
", lcodes='" + lcodes + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", status='" + status + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -262,6 +262,7 @@ public interface IMogoMapUIController {
|
||||
|
||||
}
|
||||
|
||||
//todo 改造,此处调用到数据中心同步,删除此处更新。后续更新调用, {@link CallerMapUIServiceManager#getSingletonLocationClient}
|
||||
/**
|
||||
* 使用自动驾驶车的定位数据
|
||||
*
|
||||
@@ -271,10 +272,6 @@ public interface IMogoMapUIController {
|
||||
|
||||
}
|
||||
|
||||
default void syncLocation2Map(MessagePad.GnssInfo gnssInfo) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取车速资源缓存 id
|
||||
@@ -329,4 +326,10 @@ public interface IMogoMapUIController {
|
||||
*/
|
||||
void setAllGesturesEnabled(boolean isEnable);
|
||||
|
||||
/**
|
||||
* 设置外界坐标系
|
||||
*
|
||||
* @param gnssInfo RTK 高精坐标,车辆惯导数据
|
||||
*/
|
||||
void setExtraGPSData(MessagePad.GnssInfo gnssInfo);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,8 @@ dependencies {
|
||||
// 高精地图
|
||||
implementation rootProject.ext.dependencies.mogocustommap
|
||||
// 高德地图
|
||||
api rootProject.ext.dependencies.amaplocation
|
||||
// api rootProject.ext.dependencies.amaplocation
|
||||
api rootProject.ext.dependencies.amapnavi3dmap
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
@@ -64,7 +65,7 @@ dependencies {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:mogo-core-function-call') //todo 解除依赖
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class AMapMarkerClickHandler {
|
||||
IMogoMarker iMogoMarker = new AMapMarkerWrapper(marker,new MogoMarkerOptions());
|
||||
iMogoMarker.setOwner(MAP_STATIC); //TODO 后续可能由于类型比较多,需要owner匹配机制,以及控制owner细粒度
|
||||
CallerLogger.INSTANCE.d("AMapMarkerWrapper", "traffic marker 点击回调");
|
||||
return MogoMarkersHandler.getInstance().onStaticMarkerClicked(iMogoMarker);
|
||||
return MogoMarkersHandler.Companion.getMogoMarkersHandler().onStaticMarkerClicked(iMogoMarker);
|
||||
}
|
||||
|
||||
Map<String, IMogoMarker> mogoMarkerMap = MarkerWrapperClickHelper.getInstance().getMogoMarkerMap();
|
||||
@@ -69,7 +69,7 @@ public class AMapMarkerClickHandler {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return MogoMarkersHandler.getInstance().onMarkerClicked(mogoMarker);
|
||||
return MogoMarkersHandler.Companion.getMogoMarkersHandler().onMarkerClicked(mogoMarker);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -17,8 +17,6 @@ import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Trace;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -46,7 +44,6 @@ import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister;
|
||||
import com.mogo.map.uicontroller.CarCursorOption;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
@@ -105,7 +102,8 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
OnMarkClickListener,
|
||||
OnMapStyleListener,
|
||||
OnMapViewVisualAngleChangeListener,
|
||||
OnRoadInfoListener, ILog {
|
||||
OnRoadInfoListener,
|
||||
ILog {
|
||||
|
||||
private static final String TAG = "AMapViewWrapper";
|
||||
private final MapAutoView mMapView;
|
||||
@@ -124,7 +122,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
private boolean mIsFirstLocated = true;
|
||||
private boolean mIsDelayed = false;
|
||||
|
||||
private final LocationListener mGpsLocationListener = location -> CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(ObjectUtils.fromLocation(location), 0, true);
|
||||
// GPS 位置回调
|
||||
private final LocationListener mGpsLocationListener =
|
||||
location -> CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(ObjectUtils.fromLocation(location), 0, true);
|
||||
|
||||
public AMapViewWrapper(MapAutoView mMapView) {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--AMapViewWrapper: init");
|
||||
@@ -330,9 +330,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onDestroy");
|
||||
}
|
||||
|
||||
if (mLocationTask != null) {
|
||||
mainHandler.removeCallbacks(mLocationTask);
|
||||
}
|
||||
// if (mLocationTask != null) {
|
||||
// mainHandler.removeCallbacks(mLocationTask);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -430,7 +430,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return true-是,false=不是
|
||||
*/
|
||||
private boolean isVrMold() {
|
||||
@@ -677,9 +676,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void changeMapViewAngle(int type) {
|
||||
if (checkAMapView()) {
|
||||
//mMapView.getMapAutoViewHelper().testMapViewAngle(type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -709,40 +705,41 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
CallerMapDevaListenerManager.INSTANCE.invokeUploadLogFile(filePath);
|
||||
}
|
||||
|
||||
private static class LocationTask implements Runnable {
|
||||
// TODO 这里需要数据中心代理
|
||||
// private static class LocationTask implements Runnable {
|
||||
//
|
||||
// private MogoLocation location;
|
||||
//
|
||||
// public void setMoGoLocation(MogoLocation location) {
|
||||
// this.location = location;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void run() {
|
||||
// if (location != null) {
|
||||
// CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(location, 1, false);
|
||||
// location = null;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
private MogoLocation location;
|
||||
// private volatile LocationTask mLocationTask;
|
||||
|
||||
public void setMoGoLocation(MogoLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (location != null) {
|
||||
CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(location, 1, false);
|
||||
location = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private volatile LocationTask mLocationTask;
|
||||
|
||||
private final Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
// private final Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(@NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location) {
|
||||
MogoLocation currentLocation = ObjectUtils.fromLocation(location);
|
||||
if (Looper.myLooper() == Looper.getMainLooper()) {
|
||||
CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(currentLocation, 1, false);
|
||||
} else {
|
||||
if (mLocationTask == null) {
|
||||
mLocationTask = new LocationTask();
|
||||
}
|
||||
mLocationTask.setMoGoLocation(currentLocation);
|
||||
mainHandler.removeCallbacks(mLocationTask);
|
||||
mainHandler.post(mLocationTask);
|
||||
}
|
||||
// MogoLocation currentLocation = ObjectUtils.fromLocation(location);
|
||||
// if (Looper.myLooper() == Looper.getMainLooper()) {
|
||||
// CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(currentLocation, 1, false);
|
||||
// } else {
|
||||
// if (mLocationTask == null) {
|
||||
// mLocationTask = new LocationTask();
|
||||
// }
|
||||
// mLocationTask.setMoGoLocation(currentLocation);
|
||||
// mainHandler.removeCallbacks(mLocationTask);
|
||||
// mainHandler.post(mLocationTask);
|
||||
// }
|
||||
|
||||
// 将有效经纬度暂存本地,提供给下一次的Http-DNS使用,防止首次请求位置获取不到
|
||||
if (location.getLat() > 0 && location.getLon() > 0) {
|
||||
@@ -756,20 +753,20 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
.putString(SharedPrefsConstants.LOCATION_LONGITUDE, String.valueOf(location.getLon()));
|
||||
}
|
||||
|
||||
// 同步给各个模块
|
||||
Location sysLocation = new Location(location.getProvider());
|
||||
sysLocation.setAltitude(location.getAltitude());
|
||||
sysLocation.setLatitude(location.getLat());
|
||||
sysLocation.setLongitude(location.getLon());
|
||||
sysLocation.setProvider(location.getProvider());
|
||||
sysLocation.setAccuracy(location.getAcceleration());
|
||||
sysLocation.setTime(location.duration);
|
||||
sysLocation.setBearing((float) location.getHeading());
|
||||
sysLocation.setSpeed(location.getSpeed());
|
||||
// // 同步给各个模块
|
||||
// Location sysLocation = new Location(location.getProvider());
|
||||
// sysLocation.setAltitude(location.getAltitude());
|
||||
// sysLocation.setLatitude(location.getLat());
|
||||
// sysLocation.setLongitude(location.getLon());
|
||||
// sysLocation.setProvider(location.getProvider());
|
||||
// sysLocation.setAccuracy(location.getAcceleration());
|
||||
// sysLocation.setTime(location.duration);
|
||||
// sysLocation.setBearing((float) location.getHeading());
|
||||
// sysLocation.setSpeed(location.getSpeed());
|
||||
|
||||
if (MogoCarLocationChangedListenerRegister.getInstance().getListener() != null) {
|
||||
MogoCarLocationChangedListenerRegister.getInstance().getListener().onCarLocationChanged2(sysLocation);
|
||||
}
|
||||
// if (MogoCarLocationChangedListenerRegister.getInstance().getListener() != null) {
|
||||
// MogoCarLocationChangedListenerRegister.getInstance().getListener().onCarLocationChanged2(sysLocation);
|
||||
// }
|
||||
if (checkAMapView() && mMapLoaded) {
|
||||
// 地图初始化完成后,每隔5s自动判断当前地图的模式
|
||||
if (mIsFirstLocated) {
|
||||
@@ -783,18 +780,13 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
} else {
|
||||
mIsFirstLocated = true;
|
||||
mIsDelayed = false;
|
||||
// try {
|
||||
// CallerLogger.INSTANCE.d(M_MAP + TAG, "同步定位:" + GsonUtils.toJson(location));
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapClick(@Nullable LonLatPoint lonLatPoint) {
|
||||
MogoMapListenerHandler.getInstance().onMapClick(ObjectUtils.fromAMap(lonLatPoint));
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapClick(ObjectUtils.fromAMap(lonLatPoint));
|
||||
}
|
||||
|
||||
|
||||
@@ -809,7 +801,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void onMapInit() {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--onMapInit: ");
|
||||
MogoMapListenerHandler.getInstance().onMapLoaded();
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapLoaded();
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
@@ -827,7 +819,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (checkAMapView()) {
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
Trace.beginSection("timer.onCameraChangeFinish");
|
||||
MogoMapListenerHandler.getInstance().onMapChanged(ObjectUtils.fromAMap(cameraPosition.getTarget()),
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapChanged(ObjectUtils.fromAMap(cameraPosition.getTarget()),
|
||||
cameraPosition.getZoom(),
|
||||
cameraPosition.getTilt(),
|
||||
cameraPosition.getBearing());
|
||||
@@ -840,7 +832,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public boolean onTouch(@Nullable MotionEvent motionEvent) {
|
||||
MogoMapListenerHandler.getInstance().onTouch(motionEvent);
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onTouch(motionEvent);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -857,14 +849,13 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onMapStatusChanged(int type, int value) {
|
||||
//CallerLogger.INSTANCE.i(M_MAP+TAG, "mapop--onMapStatusChanged-: " + type + "," + value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapViewVisualAngleChange(int i) {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, " 地图自动更改视距 currentThread : " + Thread.currentThread().getName());
|
||||
mVisualAngleMode = getVisualAngleMode(i);
|
||||
MogoMapListenerHandler.getInstance().onMapVisualAngleChanged(mVisualAngleMode);
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapVisualAngleChanged(mVisualAngleMode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -894,15 +885,13 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onCameraChange(int type, int value) {
|
||||
//CallerLogger.INSTANCE.i(M_MAP+TAG, "mapop--onCameraChange-: " + type + "," + value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraChangeFinish(@Nullable CameraPosition cameraPosition) {
|
||||
// CallerLogger.INSTANCE.i( M_MAP+TAG, "mapop--onCameraChangeFinish-: " + cameraPosition + "cost:" + ( System.currentTimeMillis() - startTime ) );
|
||||
if (cameraPosition != null) {
|
||||
Trace.beginSection("timer.onCameraChangeFinish");
|
||||
MogoMapListenerHandler.getInstance().onMapChanged(ObjectUtils.fromAMap(cameraPosition.getTarget()),
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapChanged(ObjectUtils.fromAMap(cameraPosition.getTarget()),
|
||||
cameraPosition.getZoom(),
|
||||
cameraPosition.getTilt(),
|
||||
cameraPosition.getBearing());
|
||||
@@ -935,7 +924,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
UiThreadHandler.post(() -> {
|
||||
try {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "currentUI = " + mCurrentUI);
|
||||
MogoMapListenerHandler.getInstance().onMapModeChanged(mCurrentUI);
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapModeChanged(mCurrentUI);
|
||||
CallerMapStyleListenerManager.INSTANCE.invokeMapStyleChange(styleId);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -996,56 +985,23 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
CallerMapDataCollectorManager.INSTANCE.setIsInit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncLocation2Map(MessagePad.GnssInfo gnssInfo) {
|
||||
if (!checkAMapView()) {
|
||||
return;
|
||||
}
|
||||
if (gnssInfo.getLongitude() == -1) {
|
||||
return;
|
||||
}
|
||||
LonLatPoint bean = new LonLatPoint();
|
||||
bean.setAngle(gnssInfo.getHeading());
|
||||
bean.setAltitude(gnssInfo.getAltitude());
|
||||
bean.setLongitude(gnssInfo.getLongitude());
|
||||
bean.setLatitude(gnssInfo.getLatitude());
|
||||
bean.setSatelliteTime(Double.valueOf(gnssInfo.getSatelliteTime() * 1000).longValue());
|
||||
bean.setSpeed((float) gnssInfo.getGnssSpeed());
|
||||
// RTKAutopilotLocationBean bean = new RTKAutopilotLocationBean();
|
||||
// bean.setYaw_rate(gnssInfo.getYawRate());
|
||||
// bean.setHeading(gnssInfo.getHeading());
|
||||
// bean.setAcceleration(gnssInfo.getAcceleration());
|
||||
// bean.setAlt(gnssInfo.getAltitude());
|
||||
// bean.setSystemTime(Double.valueOf(gnssInfo.getSystemTime()).longValue());
|
||||
// bean.setSatelliteTime(Double.valueOf(gnssInfo.getSatelliteTime() * 1000).longValue());
|
||||
// bean.setLon(gnssInfo.getLongitude());
|
||||
// bean.setLat(gnssInfo.getLatitude());
|
||||
// bean.setGnss_speed(((float) gnssInfo.getGnssSpeed()));
|
||||
// bean.setReceiverDataTime(System.currentTimeMillis());
|
||||
// 使用外部定位数据修改自车位置
|
||||
// mMapView.getLocationClient().updateRTKAutoPilotLocation(bean);
|
||||
mMapView.getLocationClient().updateLocation(bean);
|
||||
CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(getContext()).updateLocation(bean);
|
||||
CallerMapDataCollectorManager.INSTANCE.setIsInit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stepInVrMode(boolean isDayMode) {
|
||||
try {
|
||||
int mapStyle;
|
||||
if (isDayMode) {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_DAY_VR;
|
||||
mapStyle = MapAutoApi.MAP_STYLE_DAY_VR;
|
||||
} else {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_VR;
|
||||
mapStyle = MapAutoApi.MAP_STYLE_NIGHT_VR;
|
||||
}
|
||||
if (mMapView != null && mMapView.getMapAutoViewHelper() != null) {
|
||||
mMapView.getMapAutoViewHelper().setMapStyle(mapStyle);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// try {
|
||||
// int mapStyle;
|
||||
// if (isDayMode) {
|
||||
// mCurrentUI = EnumMapUI.MAP_STYLE_DAY_VR;
|
||||
// mapStyle = MapAutoApi.MAP_STYLE_DAY_VR;
|
||||
// } else {
|
||||
// mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_VR;
|
||||
// mapStyle = MapAutoApi.MAP_STYLE_NIGHT_VR;
|
||||
// }
|
||||
// if (mMapView != null && mMapView.getMapAutoViewHelper() != null) {
|
||||
// mMapView.getMapAutoViewHelper().setMapStyle(mapStyle);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1146,4 +1102,29 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.getMapAutoViewHelper().setAllGesturesEnabled(isEnable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData(MessagePad.GnssInfo gnssInfo) {
|
||||
LocationClient locationClient = mMapView.getLocationClient();
|
||||
if (locationClient != null) {
|
||||
locationClient.setIsUseExtraGPSData(true);//设置是否使用外界坐标
|
||||
locationClient.rtkEnable(true);//设置是否是高精定位
|
||||
|
||||
LonLatPoint lonLatPoint = new LonLatPoint();
|
||||
lonLatPoint.setAngle(gnssInfo.getHeading());
|
||||
lonLatPoint.setAltitude(gnssInfo.getAltitude());
|
||||
lonLatPoint.setLongitude(gnssInfo.getLongitude());
|
||||
lonLatPoint.setLatitude(gnssInfo.getLatitude());
|
||||
lonLatPoint.setSatelliteTime(Double.valueOf(gnssInfo.getSatelliteTime() * 1000).longValue());
|
||||
lonLatPoint.setSpeed((float) gnssInfo.getGnssSpeed());
|
||||
|
||||
locationClient.updateLocation(lonLatPoint);//更新新自动驾驶RTK相关数据
|
||||
|
||||
CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(getContext()).updateLocation(lonLatPoint);
|
||||
CallerMapDataCollectorManager.INSTANCE.setIsInit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class AMapWrapper implements IMogoMap {
|
||||
private static final String TAG = "AMapWrapper";
|
||||
|
||||
private static MapAutoViewHelper sAMap;
|
||||
private IMogoMapUIController mUIcontroller;
|
||||
private IMogoMapUIController mMapUIController;
|
||||
private MapAutoViewHelper mAMap;
|
||||
private MapAutoView mMapView;
|
||||
private IMogoUiSettings mUiSettings;
|
||||
@@ -63,10 +63,10 @@ public class AMapWrapper implements IMogoMap {
|
||||
this.mAMap = map;
|
||||
sAMap = map;
|
||||
this.mMapView = mapView;
|
||||
mUIcontroller = controller;
|
||||
mMapUIController = controller;
|
||||
// 设置实现自定义 info window
|
||||
MapAutoApi.INSTANCE.setInfoWindowAdapter(new AMapInfoWindowAdapter());
|
||||
AMapUIController.getInstance().initClient(mUIcontroller);
|
||||
AMapUIController.getInstance().initClient(mMapUIController);
|
||||
}
|
||||
|
||||
public static MapAutoViewHelper getAMap() {
|
||||
@@ -86,7 +86,7 @@ public class AMapWrapper implements IMogoMap {
|
||||
|
||||
@Override
|
||||
public IMogoMapUIController getUIController() {
|
||||
return mUIcontroller;
|
||||
return mMapUIController;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -101,7 +101,7 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
final IMogoMarker mogoMarker = new AMapMarkerWrapper(mAMap.addMarker(markerOptions), options);
|
||||
if (options.isAutoManager()) {
|
||||
MogoMarkersHandler.getInstance().add(tag, mogoMarker);
|
||||
MogoMarkersHandler.Companion.getMogoMarkersHandler().add(tag, mogoMarker);
|
||||
}
|
||||
return mogoMarker;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
mogoMarkers.add(new AMapMarkerWrapper(marker, options.get(i)));
|
||||
}
|
||||
MogoMarkersHandler.getInstance().add(tag, mogoMarkers);
|
||||
MogoMarkersHandler.Companion.getMogoMarkersHandler().add(tag, mogoMarkers);
|
||||
return mogoMarkers;
|
||||
}
|
||||
|
||||
@@ -211,48 +211,6 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTouchPoiEnable(boolean touchPoiEnable) {
|
||||
if (checkAMap()) {
|
||||
mAMap.setTouchPoiEnable(touchPoiEnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrafficEnable(boolean enable) {
|
||||
if (checkAMap()) {
|
||||
mAMap.setTraffic(enable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showBuildings(boolean enabled) {
|
||||
if (checkAMap()) {
|
||||
mAMap.showBuildings(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showIndoorMap(boolean enable) {
|
||||
if (checkAMap()) {
|
||||
// mAMap.showIndoorMap( enable );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMapText(boolean enable) {
|
||||
if (checkAMap()) {
|
||||
mAMap.showMapText(enable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAnimation() {
|
||||
if (checkAMap()) {
|
||||
// mAMap.stopAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getScalePerPixel() {
|
||||
if (checkAMap()) {
|
||||
@@ -279,8 +237,6 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,26 +1,12 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.location.ALocationClient;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.search.GeocodeSearchClient;
|
||||
import com.mogo.map.search.PoiSearchClient;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.map.search.traffic.IMogoTrafficSearch;
|
||||
import com.mogo.map.uicontroller.AMapUIController;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.zhidaoauto.map.sdk.open.HDTypes;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
import com.zhidaoauto.map.sdk.open.MapParams;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -28,84 +14,40 @@ import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
@Route(path = MapApiPath.PATH)
|
||||
public class CustomMapApiBuilder implements IMogoMapApiBuilder {
|
||||
public class CustomMapApiBuilder {
|
||||
|
||||
private static final String TAG = "CustomMapApiBuilder";
|
||||
|
||||
@Override
|
||||
public IMogoGeoSearch getGeoSearch(Context context) {
|
||||
return new GeocodeSearchClient(context);
|
||||
private static CustomMapApiBuilder sApiBuilder;
|
||||
|
||||
private static CustomMapApiBuilder getApiBuilder() {
|
||||
if (sApiBuilder == null) {
|
||||
synchronized (CustomMapApiBuilder.class) {
|
||||
if (sApiBuilder == null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "init");
|
||||
sApiBuilder = new CustomMapApiBuilder();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sApiBuilder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoLocationClient getLocationClient(Context context) {
|
||||
return new ALocationClient(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapUIController getMapUIController() {
|
||||
return AMapUIController.getInstance();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IMogoPoiSearch getPoiSearchClient(Context context, MogoPoiSearchQuery query) {
|
||||
return new PoiSearchClient(context, query);
|
||||
public static IMogoLocationClient getLocationClientDelegate(Context context) {
|
||||
return getApiBuilder().getLocationClient(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapView getMapView(Context context) {
|
||||
MapParams mapParams = MapParams.Companion.init();
|
||||
mapParams.setDebugMode(false)
|
||||
//todo 1-使用本地地图数据,0-使用在线地图数据
|
||||
//.setDataFileSource(1)
|
||||
.setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
|
||||
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_3D)
|
||||
.setHDVisibileArray(new int[]{HDTypes.DIVIDER.type,
|
||||
HDTypes.ROAD_AREA.type,
|
||||
HDTypes.STOP_LINE.type,
|
||||
HDTypes.ARROW.type,
|
||||
HDTypes.STATION_BRIDGE.type,
|
||||
HDTypes.ZEBRA_LINE.type,
|
||||
HDTypes.GREEN_BELT.type,
|
||||
HDTypes.DIVERSION.type,
|
||||
HDTypes.SAFE_ISLAND.type,
|
||||
HDTypes.ALPHANUMERIC.type,
|
||||
HDTypes.GUARDBAR.type,
|
||||
HDTypes.TRAFFIC_DEVICE.type,
|
||||
HDTypes.CABLE.type,
|
||||
HDTypes.SIGNAL_LINE.type})
|
||||
// .setZoom( 20 )
|
||||
// .setPointToCenter( 0.734375f, 0.5f )
|
||||
//todo 2D模式下需要注意ADAS部分遮挡
|
||||
//.setPointToCenter(0.5f, 0.5f)
|
||||
// 根据 FunctionBuildConfig 配置的皮肤样式设置题图的样式
|
||||
.setStyleMode(FunctionBuildConfig.skinMode == 0 ? MapParams.MAP_STYLE_NIGHT_VR : MapParams.MAP_STYLE_DAY_VR);
|
||||
//todo 临时放在这
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)){
|
||||
mapParams.setShadowEnable(false);
|
||||
}
|
||||
|
||||
MapAutoApi.INSTANCE.init(context, mapParams);
|
||||
MapAutoView mapAutoView = new MapAutoView(context);
|
||||
//mapAutoView.registerRenderListener(l -> Log.i(TAG, "renderTime: " + l));
|
||||
IMogoMapView mapView = new AMapViewWrapper(mapAutoView);
|
||||
return mapView;
|
||||
public static IMogoMapUIController getMapUIControllerDelegate() {
|
||||
return getApiBuilder().getMapUIController();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoTrafficSearch getTrafficSearch() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
CallerLogger.INSTANCE.d(TAG, "init");
|
||||
public static void destroy() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.exception.MogoMapException;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearchListener;
|
||||
import com.mogo.map.search.geo.MogoGeocodeAddress;
|
||||
import com.mogo.map.search.geo.MogoRegeocodeAddress;
|
||||
import com.mogo.map.search.geo.query.MogoGeocodeQuery;
|
||||
import com.mogo.map.search.geo.query.MogoRegeocodeQuery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 地理/逆地理位置搜索
|
||||
*/
|
||||
public class MogoGeoSearch implements IMogoGeoSearch {
|
||||
|
||||
private IMogoGeoSearch mDelegate;
|
||||
|
||||
public MogoGeoSearch( Context context ) {
|
||||
mDelegate = MogoMapDelegateFactory.getGeoSearchDelegate( context );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGeoSearchListener( IMogoGeoSearchListener listener ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setGeoSearchListener( listener );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoRegeocodeAddress getFromLocation( MogoRegeocodeQuery query ) throws MogoMapException {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getFromLocation( query );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoGeocodeAddress > getFromLocationName( MogoGeocodeQuery query ) throws MogoMapException {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getFromLocationName( query );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getFromLocationAsyn( MogoRegeocodeQuery query ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.getFromLocationAsyn( query );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getFromLocationNameAsyn( MogoGeocodeQuery query ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.getFromLocationNameAsyn( query );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.destroy();
|
||||
}
|
||||
mDelegate = null;
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@ package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.map.location.MogoLocationListenerRegister;
|
||||
|
||||
/**
|
||||
@@ -17,7 +17,7 @@ public class MogoLocationClient implements IMogoLocationClient {
|
||||
private static volatile MogoLocationClient sInstance;
|
||||
|
||||
public MogoLocationClient( Context context ) {
|
||||
mDelegate = MogoMapDelegateFactory.getLocationClientDelegate( context );
|
||||
mDelegate = CustomMapApiBuilder.getLocationClientDelegate( context );
|
||||
}
|
||||
|
||||
public static MogoLocationClient getInstance( Context context ) {
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.map.search.traffic.IMogoTrafficSearch;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/17
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
class MogoMapDelegateFactory {
|
||||
|
||||
private static final String TAG = "MogoMapDelegateFactory";
|
||||
|
||||
private static IMogoMapApiBuilder sApiBuilder;
|
||||
|
||||
private static IMogoMapApiBuilder getApiBuilder() {
|
||||
if (sApiBuilder == null) {
|
||||
synchronized (MogoMapDelegateFactory.class) {
|
||||
if (sApiBuilder == null) {
|
||||
sApiBuilder = ARouter.getInstance().navigation(IMogoMapApiBuilder.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sApiBuilder;
|
||||
}
|
||||
|
||||
public static IMogoGeoSearch getGeoSearchDelegate(Context context) {
|
||||
return getApiBuilder().getGeoSearch(context);
|
||||
}
|
||||
|
||||
public static IMogoLocationClient getLocationClientDelegate(Context context) {
|
||||
return getApiBuilder().getLocationClient(context);
|
||||
}
|
||||
|
||||
public static IMogoMapUIController getMapUIControllerDelegate() {
|
||||
return getApiBuilder().getMapUIController();
|
||||
}
|
||||
|
||||
public static IMogoPoiSearch getPoiSearchClientDelegate(Context context, MogoPoiSearchQuery query) {
|
||||
return getApiBuilder().getPoiSearchClient(context, query);
|
||||
}
|
||||
|
||||
public static void destroy() {
|
||||
getApiBuilder().destroy();
|
||||
}
|
||||
|
||||
public static IMogoMapView getMapView(Context context) {
|
||||
return getApiBuilder().getMapView(context);
|
||||
}
|
||||
|
||||
public static IMogoTrafficSearch getTrafficSearch() {
|
||||
return getApiBuilder().getTrafficSearch();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,14 +3,12 @@ package com.mogo.map;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.uicontroller.CarCursorOption;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
@@ -26,7 +24,7 @@ import mogo.telematics.pad.MessagePad;
|
||||
* @author congtaowang
|
||||
* @since 2019-12-26
|
||||
* <p>
|
||||
* 描述
|
||||
* 地图控制
|
||||
*/
|
||||
public class MogoMapUIController implements IMogoMapUIController {
|
||||
|
||||
@@ -40,6 +38,12 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
initDelegate();
|
||||
}
|
||||
|
||||
private void initDelegate() {
|
||||
if (mDelegate == null) {
|
||||
mDelegate = CustomMapApiBuilder.getMapUIControllerDelegate();
|
||||
}
|
||||
}
|
||||
|
||||
public static MogoMapUIController getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (MogoMapUIController.class) {
|
||||
@@ -51,10 +55,6 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public void setDelegate(IMogoMapUIController mDelegate) {
|
||||
this.mDelegate = mDelegate;
|
||||
}
|
||||
|
||||
public static synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
@@ -334,27 +334,11 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncLocation2Map(MessagePad.GnssInfo gnssInfo) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.syncLocation2Map(gnssInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
mDelegate = null;
|
||||
}
|
||||
|
||||
private void initDelegate() {
|
||||
if (mDelegate == null) {
|
||||
mDelegate = MogoMapDelegateFactory.getMapUIControllerDelegate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void stepInVrMode(boolean isDayMode) {
|
||||
initDelegate();
|
||||
@@ -428,4 +412,12 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
mDelegate.setAllGesturesEnabled(isEnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData(MessagePad.GnssInfo gnssInfo) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setExtraGPSData(gnssInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,10 @@ import android.widget.FrameLayout;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.uicontroller.AMapUIController;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -33,27 +37,24 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
private boolean mIsVrMode = false;
|
||||
private MapAutoView mapAutoView;
|
||||
|
||||
@Override
|
||||
protected void addMapView(Context context) {
|
||||
mMapView = MogoMapDelegateFactory.getMapView(context);
|
||||
if (mMapView != null) {
|
||||
if (mapAutoView == null) {
|
||||
mapAutoView = new MapAutoView(context);
|
||||
}
|
||||
if (mMapView == null) {
|
||||
mMapView = new AMapViewWrapper(mapAutoView);
|
||||
final View mapView = mMapView.getMapView();
|
||||
if (mapView != null) {
|
||||
addView(mapView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
} else {
|
||||
CallerLogger.INSTANCE.e(TAG, "create MapView instance failed.");
|
||||
}
|
||||
} else {
|
||||
CallerLogger.INSTANCE.e(TAG, "create IMogoMapView instance failed.");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isVrMode() {
|
||||
return mIsVrMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
@@ -87,4 +88,9 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
}
|
||||
|
||||
public void setExtraGPSData(MessagePad.GnssInfo gnssInfo) {
|
||||
AMapUIController.getInstance().setExtraGPSData(gnssInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -102,44 +102,44 @@ public class MogoMarkerManager implements IMogoMarkerManager {
|
||||
@Override
|
||||
public void removeMarkers( String tag ) {
|
||||
CallMarkersClearManager.INSTANCE.invokeClearAllMarkersOfTag(tag);
|
||||
MogoMarkersHandler.getInstance().remove( tag );
|
||||
MogoMarkersHandler.Companion.getMogoMarkersHandler().remove( tag );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeMarkers() {
|
||||
CallMarkersClearManager.INSTANCE.invokeClearAllMarkers();
|
||||
MogoMarkersHandler.getInstance().removeAll();
|
||||
MogoMarkersHandler.Companion.getMogoMarkersHandler().removeAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visibleAllMarkers() {
|
||||
MogoMarkersHandler.getInstance().visibleAll();
|
||||
MogoMarkersHandler.Companion.getMogoMarkersHandler().visibleAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inVisibleAllMarkers() {
|
||||
CallMarkersClearManager.INSTANCE.invokeClearAllMarkers();
|
||||
MogoMarkersHandler.getInstance().inVisibleAll();
|
||||
MogoMarkersHandler.Companion.getMogoMarkersHandler().inVisibleAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inVisibleWithoutMarkers(String ...owner) {
|
||||
MogoMarkersHandler.getInstance().inVisibleMarkers(owner);
|
||||
MogoMarkersHandler.Companion.getMogoMarkersHandler().inVisibleMarkers(owner);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< IMogoMarker > getMarkers( String tag ) {
|
||||
return MogoMarkersHandler.getInstance().getMarkers( tag );
|
||||
return MogoMarkersHandler.Companion.getMogoMarkersHandler().getMarkers( tag );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map< String, List< IMogoMarker > > getAllMarkers() {
|
||||
return MogoMarkersHandler.getInstance().getAllMarkers();
|
||||
return MogoMarkersHandler.Companion.getMogoMarkersHandler().getAllMarkers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeMarkersExcept( String tag ) {
|
||||
MogoMarkersHandler.getInstance().deleteAllExcept( tag );
|
||||
MogoMarkersHandler.Companion.getMogoMarkersHandler().deleteAllExcept( tag );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.exception.MogoMapException;
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearchListener;
|
||||
import com.mogo.map.search.poisearch.MogoPoiResult;
|
||||
import com.mogo.map.search.poisearch.MogoSearchBound;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoPoiSearch implements IMogoPoiSearch {
|
||||
|
||||
private IMogoPoiSearch mDelegate;
|
||||
|
||||
public MogoPoiSearch( Context context, MogoPoiSearchQuery query ) {
|
||||
mDelegate = MogoMapDelegateFactory.getPoiSearchClientDelegate( context, query );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPoiSearchListener( IMogoPoiSearchListener listener ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setPoiSearchListener( listener );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void searchPOIAsyn() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.searchPOIAsyn();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoPoiResult searchPOI() throws MogoMapException {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.searchPOI();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setQuery( MogoPoiSearchQuery query ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setQuery( query );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoPoiItem searchPOIId( String poiId ) throws MogoMapException {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.searchPOIId( poiId );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void searchPOIIdAsyn( String poiId ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.searchPOIIdAsyn( poiId );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBound( MogoSearchBound bound ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setBound( bound );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.destroy();
|
||||
}
|
||||
mDelegate = null;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.search.traffic.IMogoTrafficSearch;
|
||||
import com.mogo.map.search.traffic.IMogoTrafficSearchListener;
|
||||
|
||||
public class MogoTrafficSearch implements IMogoTrafficSearch {
|
||||
|
||||
private IMogoTrafficSearch mDelegate;
|
||||
|
||||
public MogoTrafficSearch() {
|
||||
mDelegate = MogoMapDelegateFactory.getTrafficSearch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void searchTrafficByRoad(String adCode, String roadName) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.searchTrafficByRoad(adCode, roadName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void searchTrafficByCircleArea(MogoLatLng mogoLatLng, int radius) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.searchTrafficByCircleArea(mogoLatLng, radius);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTrafficSearchListener(IMogoTrafficSearchListener listener) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.registerTrafficSearchListener(listener);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
|
||||
public class GDLocationClient implements AMapLocationListener {
|
||||
public class GDLocationClient implements AMapLocationListener, IMogoGDLocationClient {
|
||||
|
||||
private volatile static GDLocationClient gdLocationClient;
|
||||
private static final byte[] obj = new byte[0];
|
||||
@@ -27,31 +27,50 @@ public class GDLocationClient implements AMapLocationListener {
|
||||
}
|
||||
|
||||
//声明LocationClient对象
|
||||
private final AMapLocationClient mLocationClient;
|
||||
private AMapLocationClient mLocationClient;
|
||||
private String mCityCode;
|
||||
private AMapLocation mapLocation;
|
||||
|
||||
private GDLocationClient(Context context) {
|
||||
mLocationClient = new AMapLocationClient(context);
|
||||
//初始化定位参数
|
||||
//声明mLocationOption对象
|
||||
AMapLocationClientOption mLocationOption = new AMapLocationClientOption();
|
||||
//设置定位监听
|
||||
mLocationClient.setLocationListener(this);
|
||||
//设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
|
||||
mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
|
||||
//设置定位间隔,单位毫秒,默认为2000ms
|
||||
mLocationOption.setInterval(1000);
|
||||
//设置定位参数
|
||||
mLocationClient.setLocationOption(mLocationOption);
|
||||
AMapLocationClient.updatePrivacyShow(context, true, true);
|
||||
AMapLocationClient.updatePrivacyAgree(context, true);
|
||||
try {
|
||||
mLocationClient = new AMapLocationClient(context);
|
||||
|
||||
//初始化定位参数
|
||||
//声明mLocationOption对象
|
||||
AMapLocationClientOption mLocationOption = new AMapLocationClientOption();
|
||||
//设置定位监听
|
||||
mLocationClient.setLocationListener(this);
|
||||
//设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
|
||||
mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
|
||||
//设置定位间隔,单位毫秒,默认为2000ms
|
||||
mLocationOption.setInterval(1000);
|
||||
//设置定位参数
|
||||
mLocationClient.setLocationOption(mLocationOption);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
mLocationClient.startLocation();
|
||||
if (mLocationClient != null) {
|
||||
mLocationClient.startLocation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
if (mLocationClient != null) {
|
||||
mLocationClient.stopLocation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(AMapLocation aMapLocation) {
|
||||
if (aMapLocation != null) {
|
||||
mapLocation = aMapLocation;
|
||||
String cityCode = aMapLocation.getCityCode();
|
||||
if (cityCode != null && !cityCode.isEmpty()) {
|
||||
mCityCode = aMapLocation.getCityCode();
|
||||
@@ -61,7 +80,18 @@ public class GDLocationClient implements AMapLocationListener {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLastCityCode() {
|
||||
return mCityCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getLastLat() {
|
||||
return mapLocation != null ? mapLocation.getLatitude() : 0.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getLastLon() {
|
||||
return mapLocation != null ? mapLocation.getLongitude() : 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
package com.mogo.map.marker;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Point;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
|
||||
import com.mogo.map.utils.ObjectUtils;
|
||||
import com.zhidaoauto.map.sdk.open.abs.marker.MarkerAnimationListener;
|
||||
@@ -17,14 +14,11 @@ import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptorFactory;
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerScaleAnimation;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerTranslateAnimation;
|
||||
import com.zhidaoauto.map.sdk.open.query.LonLatPoint;
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Observable;
|
||||
import java.util.Observer;
|
||||
|
||||
@@ -96,12 +90,6 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
destroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideInfoWindow() {
|
||||
if ( mMarker != null ) {
|
||||
mMarker.hideInfoWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAlpha( float alpha ) {
|
||||
@@ -110,20 +98,6 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAnchor( float anchorU, float anchorV ) {
|
||||
if ( mMarker != null ) {
|
||||
mMarker.setAnchor( anchorU, anchorV );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDraggable( boolean paramBoolean ) {
|
||||
if ( mMarker != null ) {
|
||||
mMarker.setDraggable( paramBoolean );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIcon( Bitmap icon ) {
|
||||
if ( icon == null || icon.isRecycled() ) {
|
||||
@@ -154,17 +128,6 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInfoWindowEnable( boolean enabled ) {
|
||||
if ( mMarker != null ) {
|
||||
if ( enabled ) {
|
||||
mMarker.showInfoWindow();
|
||||
} else {
|
||||
mMarker.hideInfoWindow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMarkerOptions( MogoMarkerOptions opt ) {
|
||||
|
||||
@@ -188,12 +151,6 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
return mObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPeriod( int period ) {
|
||||
if ( mMarker != null ) {
|
||||
mMarker.setPeriod( period );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPosition( double lat, double lng ) {
|
||||
@@ -218,13 +175,6 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSnippet( String snippet ) {
|
||||
if ( mMarker != null ) {
|
||||
mMarker.setSnippet( snippet );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle( String title ) {
|
||||
if ( mMarker != null ) {
|
||||
@@ -246,27 +196,6 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setZIndex( int zIndex ) {
|
||||
if ( mMarker != null ) {
|
||||
mMarker.setZIndex( zIndex );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showInfoWindow() {
|
||||
if ( mMarker != null ) {
|
||||
mMarker.showInfoWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMarkerAssInfo() {
|
||||
if ( mMarker != null ) {
|
||||
return mMarker.getMarkeOptions().getAssInfo();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnMarkerClickListener( IMogoMarkerClickListener listener ) {
|
||||
@@ -278,26 +207,11 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
return mMogoMarkerClickListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInfoWindowAdapter( IMogoInfoWindowAdapter adapter ) {
|
||||
mMogoInfoWindowAdapter = adapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoInfoWindowAdapter getInfoWindowAdapter() {
|
||||
return mMogoInfoWindowAdapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMarkerIconView( IMogoMarkerIconViewCreator creator ) {
|
||||
if ( creator != null ) {
|
||||
View iconView = creator.createView( this );
|
||||
if ( iconView != null ) {
|
||||
mMarker.setIcon( iconView );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDestroyed() {
|
||||
return mIsDestroy;
|
||||
@@ -319,13 +233,6 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPositionByPixels( Point position ) {
|
||||
if ( mMarker != null ) {
|
||||
mMarker.setPosition( MapTools.INSTANCE.fromScreenLocation( position ) );
|
||||
}
|
||||
}
|
||||
|
||||
public Marker getMarker() {
|
||||
return mMarker;
|
||||
}
|
||||
@@ -335,13 +242,6 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
return mMogoMarkerOptions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startScaleAnimation( float fromX, float toX, float fromY, float toY, int duration, Interpolator interpolator ) {
|
||||
if ( isDestroyed() ) {
|
||||
return;
|
||||
}
|
||||
startScaleAnimation( fromX, toX, fromY, toY, duration, interpolator, null );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startScaleAnimation(float fromX, float toX, float fromY, float toY, int duration, Interpolator interpolator, final OnMarkerAnimationListener listener ) {
|
||||
@@ -384,55 +284,6 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
mMarker.startAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startJumpAnimation(float high, long duration, Interpolator interpolator, final OnMarkerAnimationListener listener ) {
|
||||
if ( isDestroyed() || high <= 0.0f || interpolator == null || duration < 0 ) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
final LonLatPoint latLng = ObjectUtils.fromMogo( getPosition() );
|
||||
// Point point = AMapWrapper.getAMap().getProjection().toScreenLocation(latLng);
|
||||
// point.y -= WindowUtils.dip2px(AbsMogoApplication.getApp(), high);
|
||||
// LatLng target = AMapWrapper.getAMap().getProjection().fromScreenLocation(point);
|
||||
//使用TranslateAnimation,填写一个需要移动的目标点
|
||||
MarkerTranslateAnimation animation = new MarkerTranslateAnimation( latLng );
|
||||
// animation.setInterpolator(interpolator);
|
||||
animation.setAnimationListener( new MarkerAnimationListener() {
|
||||
@Override
|
||||
public void onAnimationEnd( @NotNull Animation animation ) {
|
||||
if ( isDestroyed() ) {
|
||||
return;
|
||||
}
|
||||
if ( listener != null ) {
|
||||
listener.onAnimEnd();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat( @NotNull Animation animation ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationStart( @NotNull Animation animation ) {
|
||||
if ( isDestroyed() ) {
|
||||
return;
|
||||
}
|
||||
if ( listener != null ) {
|
||||
listener.onAnimStart();
|
||||
}
|
||||
}
|
||||
} );
|
||||
//整个移动所需要的时间
|
||||
animation.setDuration( duration * 1000 );
|
||||
//设置动画
|
||||
mMarker.setTranslateAnimation( animation );
|
||||
mMarker.startAnimation();
|
||||
} catch ( Exception e ) {
|
||||
CallerLogger.INSTANCE.e( TAG, e, "error." );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setClickable( boolean clickable ) {
|
||||
if ( mMarker != null ) {
|
||||
@@ -440,49 +291,6 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startSmooth( List< MogoLatLng > points, int duration ) {
|
||||
startSmoothInMs( points, duration * 1000 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startSmoothInMs( List< MogoLatLng > points, long duration ) {
|
||||
if ( isDestroyed() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( mMarker == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( points == null || points.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayList< LonLatPoint > newPoints = new ArrayList<>();
|
||||
for ( int i = 0; i < points.size(); i++ ) {
|
||||
LonLatPoint point = ObjectUtils.fromMogo( points.get( i ) );
|
||||
if ( point == null ) {
|
||||
continue;
|
||||
}
|
||||
newPoints.add( point );
|
||||
}
|
||||
if ( newPoints.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
mMarker.startSmooth( newPoints, ( int ) duration );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startScaleAnimationWithAlpha( float fromX, float toX, float fromY, float toY, float fromAlpha, float toAlpha, int duration, Interpolator interpolator, OnMarkerAnimationListener listener ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInfoWindowShowing() {
|
||||
return mMarker.isInfoWindowShown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGps( boolean isGps ) {
|
||||
@@ -491,36 +299,6 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String use3DResource( int model3D ) {
|
||||
try {
|
||||
mMarker.marker3DIcon( model3D );
|
||||
return mMarker.getMarkeOptions().getMarkerIconName();
|
||||
} catch ( Exception e ) {
|
||||
CallerLogger.INSTANCE.e( TAG, e, "use3DResource" );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void use3DResource( String resName ) {
|
||||
try {
|
||||
mMarker.getMarkeOptions().setVrIcon( true );
|
||||
mMarker.setMarkerOptions( mMarker.getMarkeOptions().setMarkerIconName( resName ) );
|
||||
} catch ( Exception e ) {
|
||||
CallerLogger.INSTANCE.e( TAG, e, "use3DResource" );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void use2DResource( String resName ) {
|
||||
try {
|
||||
mMarker.getMarkeOptions().setVrIcon( false );
|
||||
mMarker.setMarkerOptions( mMarker.getMarkeOptions().setMarkerIconName( resName ) );
|
||||
} catch ( Exception e ) {
|
||||
CallerLogger.INSTANCE.e( TAG, e, "use3DResource" );
|
||||
}
|
||||
}
|
||||
|
||||
private String mLastAnchorColor = "";
|
||||
|
||||
@@ -539,32 +317,6 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
mLastAnchorColor = anchorColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateInfoWindowView( View view ) {
|
||||
try {
|
||||
mMarker.setInfoWindowView( view );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateInfoWindowView( String viewResName ) {
|
||||
try {
|
||||
mMarker.setMarkerInfoName( viewResName );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInfoWindowOffset( int offsetX, int offsetY ) {
|
||||
try {
|
||||
mMarker.setInfoWindowOffset( offsetX, offsetY );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDynamicAnchorPosition( MogoLatLng latLng, float angle, long duration ) {
|
||||
@@ -583,15 +335,4 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMarkerInfoResName() {
|
||||
if ( mMarker != null ) {
|
||||
try {
|
||||
return mMarker.getMarkeOptions().getMarkerInfoName();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
package com.mogo.map.search;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.exception.MogoMapException;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearchListener;
|
||||
import com.mogo.map.search.geo.MogoGeocodeAddress;
|
||||
import com.mogo.map.search.geo.MogoRegeocodeAddress;
|
||||
import com.mogo.map.search.geo.query.MogoGeocodeQuery;
|
||||
import com.mogo.map.search.geo.query.MogoRegeocodeQuery;
|
||||
import com.mogo.map.utils.ObjectUtils;
|
||||
import com.zhidaoauto.map.sdk.open.query.GeocodeAddress;
|
||||
import com.zhidaoauto.map.sdk.open.query.GeocodeResult;
|
||||
import com.zhidaoauto.map.sdk.open.query.GeocodeSearch;
|
||||
import com.zhidaoauto.map.sdk.open.query.OnGeocodeSearchListener;
|
||||
import com.zhidaoauto.map.sdk.open.query.RegeocodeAddress;
|
||||
import com.zhidaoauto.map.sdk.open.query.RegeocodeResult;
|
||||
import com.zhidaoauto.map.sdk.open.query.RegeocodeQuery;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-19
|
||||
* <p>
|
||||
* 地理编码/逆地理编码自研实现
|
||||
*/
|
||||
public class GeocodeSearchClient implements IMogoGeoSearch, OnGeocodeSearchListener {
|
||||
|
||||
private GeocodeSearch mClient;
|
||||
private IMogoGeoSearchListener mListener;
|
||||
|
||||
public GeocodeSearchClient( Context context ) {
|
||||
mClient = new GeocodeSearch( context );
|
||||
mClient.setOnGeocodeSearchListener( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGeoSearchListener( IMogoGeoSearchListener listener ) {
|
||||
mListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoRegeocodeAddress getFromLocation( MogoRegeocodeQuery query ) throws MogoMapException {
|
||||
try {
|
||||
RegeocodeQuery regeocodeQuery = ObjectUtils.fromMogo(query);
|
||||
RegeocodeAddress regeocodeAddress = mClient.getFromLocation(regeocodeQuery);
|
||||
return ObjectUtils.fromAMap( regeocodeAddress );
|
||||
} catch ( Exception e ) {
|
||||
throw new MogoMapException( e );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoGeocodeAddress > getFromLocationName( MogoGeocodeQuery query ) throws MogoMapException {
|
||||
try {
|
||||
List<GeocodeAddress> geocodeAddress = mClient.getFromLocationName( ObjectUtils.fromMogo( query ) );
|
||||
if ( geocodeAddress != null ) {
|
||||
List< MogoGeocodeAddress > mogoGeocodeAddresses = new ArrayList<>();
|
||||
for ( GeocodeAddress address : geocodeAddress ) {
|
||||
MogoGeocodeAddress mogoGeocodeAddress = ObjectUtils.fromAMap( address );
|
||||
if ( mogoGeocodeAddress != null ) {
|
||||
mogoGeocodeAddresses.add( mogoGeocodeAddress );
|
||||
}
|
||||
}
|
||||
return mogoGeocodeAddresses;
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch ( Exception e ) {
|
||||
throw new MogoMapException( e );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getFromLocationAsyn( MogoRegeocodeQuery query ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.getFromLocationAsyn( ObjectUtils.fromMogo( query ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getFromLocationNameAsyn( MogoGeocodeQuery query ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.getFromLocationNameAsyn( ObjectUtils.fromMogo( query ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegeocodeSearched(RegeocodeResult regeocodeResult, int i ) {
|
||||
if ( mListener != null ) {
|
||||
mListener.onRegeocodeSearched( ObjectUtils.fromAMap( regeocodeResult ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGeocodeSearched(GeocodeResult geocodeResult, int i ) {
|
||||
if ( mListener != null ) {
|
||||
mListener.onGeocodeSearched( ObjectUtils.fromAMap( geocodeResult ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
mClient = null;
|
||||
mListener = null;
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
package com.mogo.map.search;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.search.inputtips.IMogoInputtipsListener;
|
||||
import com.mogo.map.search.inputtips.IMogoInputtipsSearch;
|
||||
import com.mogo.map.search.inputtips.MogoTip;
|
||||
import com.mogo.map.search.inputtips.query.MogoInputtipsQuery;
|
||||
import com.mogo.map.utils.ObjectUtils;
|
||||
import com.zhidaoauto.map.sdk.open.query.Inputtips;
|
||||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-20
|
||||
* <p>
|
||||
* 自研地图 inputtips搜索实现
|
||||
*/
|
||||
public class InputtipsSearch implements IMogoInputtipsSearch, InputtipsListener {
|
||||
|
||||
private static final String TAG = "InputtipsSearch";
|
||||
|
||||
private Inputtips mClient;
|
||||
private InputtipsQuery mQuery;
|
||||
private IMogoInputtipsListener mListener;
|
||||
|
||||
public InputtipsSearch(Context context, MogoInputtipsQuery query) {
|
||||
mQuery = ObjectUtils.fromMogo(query);
|
||||
mClient = new Inputtips(context, mQuery);
|
||||
mClient.setInputtipsListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setQuery(MogoInputtipsQuery query) {
|
||||
this.mQuery = ObjectUtils.fromMogo(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInputtipsListener(IMogoInputtipsListener listener) {
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestInputtipsAsyn() {
|
||||
if (mClient != null) {
|
||||
mClient.requestInputtipsAsyn();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetInputtips(List list, int i) {
|
||||
if (i == 0) {
|
||||
if (mListener != null) {
|
||||
mListener.onGetInputtips(getResult(list));
|
||||
}
|
||||
} else {
|
||||
CallerLogger.INSTANCE.e(TAG, "errorcode = " + i);
|
||||
}
|
||||
}
|
||||
|
||||
private List<MogoTip> getResult(List<Tip> tips) {
|
||||
List<MogoTip> mogoTips = new ArrayList<>();
|
||||
if (tips != null) {
|
||||
//只添加有坐标的结果
|
||||
for (Tip tip : tips) {
|
||||
MogoTip mogoTip = ObjectUtils.fromAMap(tip);
|
||||
if (mogoTip != null && mogoTip.getPoint() != null) {
|
||||
mogoTips.add(mogoTip);
|
||||
}
|
||||
}
|
||||
}
|
||||
return mogoTips;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
mClient = null;
|
||||
mListener = null;
|
||||
mQuery = null;
|
||||
}
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
package com.mogo.map.search;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.exception.MogoMapException;
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearchListener;
|
||||
import com.mogo.map.search.poisearch.MogoPoiResult;
|
||||
import com.mogo.map.search.poisearch.MogoSearchBound;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.map.utils.ObjectUtils;
|
||||
import com.zhidaoauto.map.sdk.open.query.OnPoiSearchListener;
|
||||
import com.zhidaoauto.map.sdk.open.query.PoiItem;
|
||||
import com.zhidaoauto.map.sdk.open.query.PoiSearch;
|
||||
import com.zhidaoauto.map.sdk.open.query.PoiSearchResult;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* poi搜索自研实现
|
||||
* <p>
|
||||
* 错误码对照表:https://lbs.amap.com/api/android-sdk/guide/map-tools/error-code
|
||||
*/
|
||||
public class PoiSearchClient implements IMogoPoiSearch, OnPoiSearchListener {
|
||||
|
||||
private static final String TAG = "PoiSearchClient";
|
||||
|
||||
private MogoPoiSearchQuery mQuery;
|
||||
private PoiSearch mClient;
|
||||
private IMogoPoiSearchListener mListener;
|
||||
private MogoSearchBound mBound;
|
||||
|
||||
public PoiSearchClient( Context context, MogoPoiSearchQuery query ) {
|
||||
try {
|
||||
mQuery = query;
|
||||
mClient = new PoiSearch( context, ObjectUtils.fromMogo( mQuery ) );
|
||||
mClient.setOnPoiSearchListener( this );
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPoiSearchListener( IMogoPoiSearchListener listener ) {
|
||||
mListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void searchPOIAsyn() {
|
||||
if ( mClient != null ) {
|
||||
mClient.searchPOIAsyn();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoPoiResult searchPOI() throws MogoMapException {
|
||||
if ( mClient != null ) {
|
||||
try {
|
||||
PoiSearchResult search = mClient.searchPOI();
|
||||
return ObjectUtils.fromAMap( search );
|
||||
} catch ( Exception e ) {
|
||||
throw new MogoMapException( e );
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setQuery( MogoPoiSearchQuery query ) {
|
||||
mQuery = query;
|
||||
if ( mClient != null ) {
|
||||
mClient.setQuery( ObjectUtils.fromMogo( mQuery ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoPoiItem searchPOIId( String poiId ) throws MogoMapException {
|
||||
if ( mClient != null ) {
|
||||
try {
|
||||
PoiItem poiItem = mClient.searchPOIId( poiId );
|
||||
return ObjectUtils.fromAMap( poiItem );
|
||||
} catch ( Exception e ) {
|
||||
throw new MogoMapException( e );
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void searchPOIIdAsyn( String poiId ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.searchPOIIdAsyn( poiId );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBound( MogoSearchBound bound ) {
|
||||
mBound = bound;
|
||||
if ( mClient != null ) {
|
||||
mClient.setBound( ObjectUtils.fromMogo( mBound ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPoiSearched( PoiSearchResult poiResult, int errorCode ) {
|
||||
if ( errorCode != 0 ) {
|
||||
CallerLogger.INSTANCE.e( TAG, "errorcode is %d", errorCode );
|
||||
}
|
||||
if ( mListener != null ) {
|
||||
mListener.onPoiSearched( ObjectUtils.fromAMap( poiResult ), errorCode );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPoiItemSearched( PoiItem poiItem, int errorCode ) {
|
||||
if ( errorCode != 0 ) {
|
||||
CallerLogger.INSTANCE.e( TAG, "errorcode is %d", errorCode );
|
||||
}
|
||||
if ( mListener != null ) {
|
||||
mListener.onPoiItemSearched( ObjectUtils.fromAMap( poiItem ), errorCode );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
mQuery = null;
|
||||
mClient = null;
|
||||
mListener = null;
|
||||
mBound = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPoiCategorySearched(@Nullable List list, int errorCode) {
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user