This commit is contained in:
wangcongtao
2020-04-15 16:25:25 +08:00
parent 2fdb909ea4
commit df1e308684
32 changed files with 749 additions and 482 deletions

View File

@@ -207,8 +207,7 @@ public class MogoServices implements IMogoMapListener,
mUiController.setLockZoom( ServiceConst.DEFAULT_LOCK_CAR_ZOOM_LEVEL );
mStatusManager.setUserInteractionStatus( TAG, true, false );
mUiController.recoverLockMode();
notifyRefreshData( mLastAutoRefreshLocation,
ServiceConst.DEFAULT_AUTO_REFRESH_DATA_RADIUS, mAutoRefreshCallback );
notifyRefreshData( mLastAutoRefreshLocation, ServiceConst.DEFAULT_AUTO_REFRESH_DATA_RADIUS, mAutoRefreshCallback );
}
};
private Context mContext;
@@ -505,6 +504,8 @@ public class MogoServices implements IMogoMapListener,
return;
}
Logger.d( TAG, "mLastZoomLevel = %s, zoom = %s", mLastZoomLevel, zoom );
// 手动刷新触发
if ( mLastZoomLevel - zoom > mCustomRefreshStrategy.getZoomOutLevel() ) {
// 缩放级别缩小
@@ -519,6 +520,7 @@ public class MogoServices implements IMogoMapListener,
msg.what = ServiceConst.MSG_MAP_CHANGED;
msg.obj = new RefreshObject( mCustomRefreshCallback, getQueryRadius(), latLng, 0 );
mThreadHandler.sendMessage( msg );
Logger.d( TAG, "平移触发" );
}
}
@@ -536,7 +538,6 @@ public class MogoServices implements IMogoMapListener,
*/
private boolean invokeRefreshWhenTranslationByUser( MogoLatLng latLng ) {
try {
Trace.beginSection( "timer.invokeRefreshWhenTranslationByUser" );
float factor = 0.0f;
if ( mIsVertical ) {
factor = getMapCameraFactWidth();
@@ -547,7 +548,7 @@ public class MogoServices implements IMogoMapListener,
return false;
}
float distance = Utils.calculateLineDistance( latLng, mLastCustomRefreshCenterLocation );
Trace.endSection();
Logger.d( TAG, "move distance = %s, factor = %s", distance, factor );
return distance > factor;
} catch ( Exception e ) {
Logger.e( TAG, e, "warming. " );

View File

@@ -78,7 +78,7 @@ public class ServiceConst {
public static final int DEFAULT_LOCK_CAR_ZOOM_LEVEL = 16;
/**
* 自动酸辛默认半径
* 自动刷新默认半径
*/
public static final int DEFAULT_AUTO_REFRESH_DATA_RADIUS = 2_000;

View File

@@ -606,18 +606,18 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
if ( markerCardResult == null ) {
return;
}
JSONArray array = new JSONArray();
final Map< String, Object > properties = new HashMap<>();
List< MarkerOnlineCar > onlineCarList = markerCardResult.getOnlineCar();
List< MarkerExploreWay > exploreWayList = markerCardResult.getExploreWay();
List< MarkerShareMusic > shareMusicList = markerCardResult.getShareMusic();
List< MarkerNoveltyInfo > noveltyInfoList = markerCardResult.getNoveltyInfo();
int size = onlineCarList == null ? 0 : onlineCarList.size();
fillNumberTrackEventBody( array, 3, size );
fillNumberTrackEventBody( properties, 3, size );
size = exploreWayList == null ? 0 : exploreWayList.size();
fillNumberTrackEventBody( array, 1, size );
fillNumberTrackEventBody( properties, 1, size );
size = shareMusicList == null ? 0 : shareMusicList.size();
fillNumberTrackEventBody( array, 4, size );
fillNumberTrackEventBody( properties, 4, size );
int num_gas_station = 0;
int num_traffic_check = 0;
@@ -650,18 +650,13 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
}
}
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 );
fillNumberTrackEventBody( properties, 2, num_gas_station );
fillNumberTrackEventBody( properties, 6, num_road_closed );
fillNumberTrackEventBody( properties, 5, num_traffic_check );
fillNumberTrackEventBody( properties, 7, num_shop_discount );
fillNumberTrackEventBody( properties, 8, num_fours_shop );
try {
if ( array.length() == 0 ) {
return;
}
final Map< String, Object > properties = new HashMap<>();
properties.put( "data", array.toString() );
MarkerServiceHandler.getMogoAnalytics().track( "Launcher_Data_Get", properties );
} catch ( Exception e ) {
e.printStackTrace();
@@ -706,17 +701,9 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
/**
* 统计埋点
*/
private synchronized 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();
}
private synchronized static void fillNumberTrackEventBody( Map< String, Object > properties, int type, int size ) {
properties.put( "type" + type, type );
properties.put( "num" + type, size );
}
/**