This commit is contained in:
wangcongtao
2020-03-18 20:50:22 +08:00
parent 78f87fbfd6
commit 0f0bd23d11
9 changed files with 43 additions and 11 deletions

View File

@@ -50,7 +50,7 @@ public class NaviClient implements IMogoNavi {
private NaviClient( Context context ) {
mAMapNavi = AMapNavi.getInstance( context );
//mAMapNavi.setEmulatorNaviSpeed( 120 );
mAMapNavi.setEmulatorNaviSpeed( 120 );
mAMapNavi.setUseInnerVoice( true );
mAMapNaviListener = new NaviListenerAdapter( context, mAMapNavi, this );
mAimlessModeListener = new AimlessModeListenerAdapter() {

View File

@@ -4,6 +4,7 @@ import com.amap.api.maps.model.LatLng;
import com.amap.api.maps.model.LatLngBounds;
import com.mogo.map.MogoLatLng;
import com.mogo.map.exception.MogoMapException;
import com.mogo.utils.logger.Logger;
import java.util.List;
@@ -15,6 +16,8 @@ import java.util.List;
*/
public class MogoMapUtils {
private static final String TAG = "MogoMapUtils";
public static LatLngBounds getLatLngBounds( MogoLatLng carPosition, List< MogoLatLng > lonLats, boolean lockCarPosition ) throws Exception {
if ( lonLats == null || lonLats.isEmpty() ) {
@@ -74,6 +77,21 @@ public class MogoMapUtils {
return null;
}
if ( east < west ) {
double tmp = east;
east = west;
west = tmp;
}
if( north < south ){
double tmp = north;
north = south;
south = tmp;
}
Logger.d( TAG, "west = %s, east = %s, north = %s, south = %s", west, east, north, south );
return new LatLngBounds.Builder().include( new LatLng( east, north ) ).include( new LatLng( west, south ) ).build();
}
}

View File

@@ -8,5 +8,5 @@
android:id="@+id/map_amap_id_cursor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_1" />
android:src="@drawable/map_api_ic_current_location2_cursor" />
</LinearLayout>