opt
This commit is contained in:
@@ -32,6 +32,10 @@ import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -263,6 +267,8 @@ public class MarkerServiceHandler {
|
||||
lastMarker = null;
|
||||
getMarkerManager().removeMarkers();
|
||||
|
||||
JSONArray array = new JSONArray();
|
||||
|
||||
// 解析不同的Marker类型,然后对应的进行绘制
|
||||
if (response != null && response.getResult() != null) {
|
||||
MarkerCardResult markerCardResult = response.getResult();
|
||||
@@ -301,7 +307,7 @@ public class MarkerServiceHandler {
|
||||
|
||||
drawMapMarker(markerShowEntity);
|
||||
}
|
||||
analyticData(3, onlineCarList.size());
|
||||
fillNumberTrackEventBody(array, 3, onlineCarList.size());
|
||||
}
|
||||
|
||||
if (exploreWayList != null) {
|
||||
@@ -318,7 +324,7 @@ public class MarkerServiceHandler {
|
||||
drawMapMarker(markerShowEntity);
|
||||
}
|
||||
}
|
||||
analyticData(1, exploreWayList.size());
|
||||
fillNumberTrackEventBody(array, 1, exploreWayList.size());
|
||||
}
|
||||
|
||||
if (shareMusicList != null) {
|
||||
@@ -334,7 +340,7 @@ public class MarkerServiceHandler {
|
||||
|
||||
drawMapMarker(markerShowEntity);
|
||||
}
|
||||
analyticData(4, shareMusicList.size());
|
||||
fillNumberTrackEventBody(array, 4, shareMusicList.size());
|
||||
}
|
||||
|
||||
if (noveltyInfoList != null) {
|
||||
@@ -373,27 +379,42 @@ public class MarkerServiceHandler {
|
||||
break;
|
||||
}
|
||||
}
|
||||
analyticData(2, num_gas_station);
|
||||
analyticData(6, num_road_closed);
|
||||
analyticData(5, num_traffic_check);
|
||||
analyticData(7, num_shop_discount);
|
||||
analyticData(8, num_fours_shop);
|
||||
fillNumberTrackEventBody(array,2, num_gas_station);
|
||||
fillNumberTrackEventBody(array,6, num_road_closed);
|
||||
fillNumberTrackEventBody(array,5, num_traffic_check);
|
||||
fillNumberTrackEventBody(array,7, num_shop_discount);
|
||||
fillNumberTrackEventBody(array,8, num_fours_shop);
|
||||
}
|
||||
analyticData(array);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void fillNumberTrackEventBody(JSONArray arr, int type, int size){
|
||||
JSONObject object = new JSONObject( );
|
||||
try {
|
||||
object.put( "type", type );
|
||||
object.put( "num", size);
|
||||
if ( arr != null ) {
|
||||
arr.put( object );
|
||||
}
|
||||
} catch ( JSONException e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
getMapUIController().changeZoom(12);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计地图内数据获取
|
||||
*
|
||||
* @param type 类型
|
||||
* @param num marker数量
|
||||
* @param array 埋点数据
|
||||
*/
|
||||
private static void analyticData(int type, int num) {
|
||||
private static void analyticData(JSONArray array) {
|
||||
try {
|
||||
if ( array == null || array.length() == 0 ) {
|
||||
return;
|
||||
}
|
||||
final Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
properties.put("num", num);
|
||||
properties.put("data", array.toString());
|
||||
getMogoAnalytics().track("Launcher_Data_Get", properties);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -411,14 +432,14 @@ public class MarkerServiceHandler {
|
||||
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner(markerShowEntity.getMarkerType())
|
||||
.alpha( 0.7f )
|
||||
.object( markerShowEntity )
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
options.icon(markerView);
|
||||
|
||||
IMogoMarker marker = getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
|
||||
marker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
marker.setObject(markerShowEntity);
|
||||
marker.setAlpha(0.7f);
|
||||
return marker;
|
||||
} else {
|
||||
Logger.e(TAG, "Location 必须进行初始化!!!!!");
|
||||
|
||||
@@ -116,7 +116,7 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
case ServiceConst.MSG_TYPE_REFRESH_DECREASE:
|
||||
mRefreshRemainingTime -= ServiceConst.DECREASE_INTERVAL;
|
||||
if ( mRefreshRemainingTime == 0 ) {
|
||||
notifyRefreshData( mLastAutoRefreshLocation, 2_000, mAutoRefreshCallback );
|
||||
notifyRefreshData( mLastAutoRefreshLocation, getQueryRadius(), mAutoRefreshCallback );
|
||||
} else {
|
||||
mHandler.sendEmptyMessageDelayed( msg.what, ServiceConst.DECREASE_INTERVAL );
|
||||
}
|
||||
@@ -435,11 +435,11 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
// 自动刷新触发
|
||||
if ( mLastAutoRefreshLocation == null ) {
|
||||
mLastAutoRefreshLocation = new MogoLatLng( location.getLatitude(), location.getLongitude() );
|
||||
notifyRefreshData( mLastAutoRefreshLocation, 2_000, mAutoRefreshCallback );
|
||||
notifyRefreshData( mLastAutoRefreshLocation, getQueryRadius(), mAutoRefreshCallback );
|
||||
} else {
|
||||
float distance = Utils.calculateLineDistance( mLastAutoRefreshLocation, new MogoLatLng( location.getLatitude(), location.getLongitude() ) );
|
||||
if ( distance > mAutoRefreshStrategy.getDistance() ) {
|
||||
notifyRefreshData( mLastAutoRefreshLocation, 2_000, mAutoRefreshCallback );
|
||||
notifyRefreshData( mLastAutoRefreshLocation, getQueryRadius(), mAutoRefreshCallback );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class MogoReceiver extends BroadcastReceiver {
|
||||
/**
|
||||
* ADAS
|
||||
*/
|
||||
public static final String ADAS_ACTION = "com.mogo.launcher.adas";
|
||||
public static final String ADAS_ACTION = "com.zhidao.autopilot.adas";
|
||||
// ADAS 状态 0 - 关闭 1 - 打开
|
||||
public static final String PARAM_ADAS_STATUS = "adas_drawer_status";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user