opt: main page, add polyline api, add back to launcher logic; bugfix: map resume when back to mainactivity
This commit is contained in:
@@ -7,6 +7,7 @@ import android.content.IntentFilter;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.Trace;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
@@ -461,6 +462,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
*/
|
||||
private boolean invokeRefreshWhenTranslationByUser( MogoLatLng latLng ) {
|
||||
try {
|
||||
Trace.beginSection( "timer.invokeRefreshWhenTranslationByUser" );
|
||||
float factor = 0.0f;
|
||||
if ( mIsVertical ) {
|
||||
factor = getMapCameraFactWidth();
|
||||
@@ -472,6 +474,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
Logger.d( TAG, "invokeRefreshWhenTranslationByUser,mLastCustomRefreshCenterLocation = %s, latLng = %s", mLastCustomRefreshCenterLocation, latLng );
|
||||
float distance = Utils.calculateLineDistance( latLng, mLastCustomRefreshCenterLocation );
|
||||
Trace.endSection();
|
||||
return distance > factor;
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "warming. " );
|
||||
|
||||
@@ -425,9 +425,12 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
* @param onlineCarList
|
||||
*/
|
||||
private void drawOnlineCarMarkers( List< MarkerOnlineCar > onlineCarList ) {
|
||||
// 将数据同步给在线车辆,避免每次 perform 的时候去拉取,造成消耗
|
||||
if ( onlineCarList == null || onlineCarList.isEmpty() ) {
|
||||
MogoDataHandler.getInstance().invoke( ServiceConst.CARD_TYPE_USER_DATA, new ArrayList<>( ) );
|
||||
return;
|
||||
}
|
||||
MogoDataHandler.getInstance().invoke( ServiceConst.CARD_TYPE_USER_DATA, onlineCarList );
|
||||
double nearlyDistance = Float.MAX_VALUE;
|
||||
for ( MarkerOnlineCar markerOnlineCar : onlineCarList ) {
|
||||
MarkerLocation markerLocation = markerOnlineCar.getLocation();
|
||||
|
||||
Reference in New Issue
Block a user