Merge branch 'dev_robotaxi-d-app-module_290_220715_2.9.0' into 'test_robotaxi-d-app-module_290_220715_2.9.0.1'
合并dev_v2.9.0到test_v2.9.0.1 See merge request zhjt/AndroidApp/MoGoEagleEye!121
This commit is contained in:
BIN
OCH/mogo-och-bus-passenger/src/main/assets/map_style.data
Executable file → Normal file
BIN
OCH/mogo-och-bus-passenger/src/main/assets/map_style.data
Executable file → Normal file
Binary file not shown.
BIN
OCH/mogo-och-bus-passenger/src/main/assets/map_style_extra.data
Executable file → Normal file
BIN
OCH/mogo-och-bus-passenger/src/main/assets/map_style_extra.data
Executable file → Normal file
Binary file not shown.
@@ -16,7 +16,7 @@ public class BusPassengerMapAssetStyleUtil {
|
||||
byte[] buffer1 = null;
|
||||
InputStream is1 = null;
|
||||
try {
|
||||
is1 = context.getResources().getAssets().open(fileName); //eg. small_map_style.data
|
||||
is1 = context.getResources().getAssets().open(fileName); //eg. over_view_style.data
|
||||
int lenght1 = is1.available();
|
||||
buffer1 = new byte[lenght1];
|
||||
is1.read(buffer1);
|
||||
@@ -39,7 +39,7 @@ public class BusPassengerMapAssetStyleUtil {
|
||||
byte[] buffer1 = null;
|
||||
InputStream is1 = null;
|
||||
try {
|
||||
is1 = context.getResources().getAssets().open(fileName); //eg. small_map_style_extra.data
|
||||
is1 = context.getResources().getAssets().open(fileName); //eg. over_view_style_extra.data
|
||||
int lenght1 = is1.available();
|
||||
buffer1 = new byte[lenght1];
|
||||
is1.read(buffer1);
|
||||
|
||||
BIN
OCH/mogo-och-taxi-passenger/src/main/assets/map_style.data
Executable file → Normal file
BIN
OCH/mogo-och-taxi-passenger/src/main/assets/map_style.data
Executable file → Normal file
Binary file not shown.
0
OCH/mogo-och-taxi-passenger/src/main/assets/map_style_extra.data
Executable file → Normal file
0
OCH/mogo-och-taxi-passenger/src/main/assets/map_style_extra.data
Executable file → Normal file
@@ -16,7 +16,7 @@ public class TaxiPassengerMapAssetStyleUtil {
|
||||
byte[] buffer1 = null;
|
||||
InputStream is1 = null;
|
||||
try {
|
||||
is1 = context.getResources().getAssets().open(fileName); //eg. small_map_style.data
|
||||
is1 = context.getResources().getAssets().open(fileName); //eg. over_view_style.data
|
||||
int lenght1 = is1.available();
|
||||
buffer1 = new byte[lenght1];
|
||||
is1.read(buffer1);
|
||||
@@ -39,7 +39,7 @@ public class TaxiPassengerMapAssetStyleUtil {
|
||||
byte[] buffer1 = null;
|
||||
InputStream is1 = null;
|
||||
try {
|
||||
is1 = context.getResources().getAssets().open(fileName); //eg. small_map_style_extra.data
|
||||
is1 = context.getResources().getAssets().open(fileName); //eg. over_view_style_extra.data
|
||||
int lenght1 = is1.available();
|
||||
buffer1 = new byte[lenght1];
|
||||
is1.read(buffer1);
|
||||
|
||||
@@ -81,8 +81,8 @@ public class TaxiNaviFragment extends BaseTaxiUIFragment implements AMapNaviView
|
||||
aMap.setCustomMapStyle(
|
||||
new CustomMapStyleOptions()
|
||||
.setEnable(true)
|
||||
.setStyleData(MapAssetStyleUtils.getAssetsStyle(getContext(), "small_map_style.data"))
|
||||
.setStyleExtraData(MapAssetStyleUtils.getAssetsExtraStyle(getContext(), "small_map_style_extra.data"))
|
||||
.setStyleData(MapAssetStyleUtils.getAssetsStyle(getContext(), "over_view_style.data"))
|
||||
.setStyleExtraData(MapAssetStyleUtils.getAssetsExtraStyle(getContext(), "over_view_style_extra.data"))
|
||||
);
|
||||
|
||||
//设置希望展示的地图缩放级别
|
||||
|
||||
@@ -17,7 +17,7 @@ import androidx.annotation.Nullable;
|
||||
import com.amap.api.maps.AMap;
|
||||
import com.amap.api.maps.CameraUpdate;
|
||||
import com.amap.api.maps.CameraUpdateFactory;
|
||||
import com.amap.api.maps.TextureMapView;
|
||||
import com.amap.api.maps.MapView;
|
||||
import com.amap.api.maps.UiSettings;
|
||||
import com.amap.api.maps.model.BitmapDescriptor;
|
||||
import com.amap.api.maps.model.BitmapDescriptorFactory;
|
||||
@@ -65,7 +65,7 @@ public class AMapCustomView
|
||||
extends RelativeLayout
|
||||
implements IMoGoMapLocationListener {
|
||||
public static final String TAG = "AMapCustomView";
|
||||
private TextureMapView mAMapView;
|
||||
private MapView mAMapView;
|
||||
private AMap mAMap;
|
||||
private int zoomLevel = 15;
|
||||
private CameraUpdate mCameraUpdate;
|
||||
@@ -94,6 +94,7 @@ public class AMapCustomView
|
||||
|
||||
private MogoLocation mLocation;
|
||||
private boolean isFirstLocation = true;
|
||||
CustomMapStyleOptions mCustomMapStyleOptions;
|
||||
|
||||
public AMapCustomView(Context context) {
|
||||
this(context, null);
|
||||
@@ -140,20 +141,22 @@ public class AMapCustomView
|
||||
Log.d(TAG, "initAMapView");
|
||||
mCameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel);
|
||||
mAMap = mAMapView.getMap();
|
||||
mCustomMapStyleOptions = new CustomMapStyleOptions();
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
mCustomMapStyleOptions.setStyleData(MapAssetStyleUtils.getAssetsStyle(getContext(), "over_view_style.data"));
|
||||
mCustomMapStyleOptions.setStyleExtraData(MapAssetStyleUtils.getAssetsExtraStyle(getContext(), "over_view_style_extra.data"));
|
||||
} else {
|
||||
mCustomMapStyleOptions.setStyleData(MapAssetStyleUtils.getAssetsStyle(getContext(), "over_view_style_bus.data"));
|
||||
mCustomMapStyleOptions.setStyleExtraData(MapAssetStyleUtils.getAssetsExtraStyle(getContext(), "over_view_style_extra_bus.data"));
|
||||
}
|
||||
mAMap.setOnMapLoadedListener(() -> {
|
||||
Log.d(TAG, "---onMapLoaded---");
|
||||
CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions();
|
||||
// 加载自定义样式
|
||||
customMapStyleOptions.setEnable(true);
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
customMapStyleOptions.setStyleData(MapAssetStyleUtils.getAssetsStyle(getContext(), "over_view_style.data"));
|
||||
customMapStyleOptions.setStyleExtraData(MapAssetStyleUtils.getAssetsExtraStyle(getContext(), "over_view_style_extra.data"));
|
||||
} else {
|
||||
customMapStyleOptions.setStyleData(MapAssetStyleUtils.getAssetsStyle(getContext(), "over_view_style_bus.data"));
|
||||
customMapStyleOptions.setStyleExtraData(MapAssetStyleUtils.getAssetsExtraStyle(getContext(), "over_view_style_extra_bus.data"));
|
||||
if (mCustomMapStyleOptions != null) {
|
||||
// 加载自定义样式
|
||||
mCustomMapStyleOptions.setEnable(true);
|
||||
// 设置自定义样式
|
||||
mAMap.setCustomMapStyle(mCustomMapStyleOptions);
|
||||
}
|
||||
// 设置自定义样式
|
||||
mAMap.setCustomMapStyle(customMapStyleOptions);
|
||||
// 实时路况图层关闭,必须添加在loaded结束之后,其他位置不生效
|
||||
mAMap.setTrafficEnabled(false);
|
||||
});
|
||||
@@ -269,13 +272,11 @@ public class AMapCustomView
|
||||
public void onLocationChanged(@org.jetbrains.annotations.Nullable MogoLocation location, int from) {
|
||||
mLocation = location;
|
||||
MarkerDrawerManager.INSTANCE.setLonLat(new Pair(location.getLongitude(), location.getLatitude()));
|
||||
UiThreadHandler.post(() -> {
|
||||
drawCarMarker(location);
|
||||
if (isFirstLocation) {
|
||||
displayCustomOverView();
|
||||
isFirstLocation = false;
|
||||
}
|
||||
});
|
||||
drawCarMarker(location);
|
||||
if (isFirstLocation) {
|
||||
displayCustomOverView();
|
||||
isFirstLocation = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreateView(Bundle savedInstanceState) {
|
||||
|
||||
@@ -129,8 +129,8 @@ public class SmallMapDirectionView
|
||||
// 加载自定义样式
|
||||
CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions()
|
||||
.setEnable(true)
|
||||
.setStyleData(MapAssetStyleUtils.getAssetsStyle(getContext(), "small_map_style.data"))
|
||||
.setStyleExtraData(MapAssetStyleUtils.getAssetsExtraStyle(getContext(), "small_map_style_extra.data"));
|
||||
.setStyleData(MapAssetStyleUtils.getAssetsStyle(getContext(), "over_view_style.data"))
|
||||
.setStyleExtraData(MapAssetStyleUtils.getAssetsExtraStyle(getContext(), "over_view_style_extra.data"));
|
||||
// 设置自定义样式
|
||||
mAMap.setCustomMapStyle(customMapStyleOptions);
|
||||
//设置希望展示的地图缩放级别
|
||||
@@ -146,8 +146,8 @@ public class SmallMapDirectionView
|
||||
// 加载自定义样式
|
||||
CustomMapStyleOptions customMapStyleOptions1 = new CustomMapStyleOptions()
|
||||
.setEnable(true)
|
||||
.setStyleData(MapAssetStyleUtils.getAssetsStyle(getContext(), "small_map_style.data"))
|
||||
.setStyleExtraData(MapAssetStyleUtils.getAssetsExtraStyle(getContext(), "small_map_style_extra.data"));
|
||||
.setStyleData(MapAssetStyleUtils.getAssetsStyle(getContext(), "over_view_style.data"))
|
||||
.setStyleExtraData(MapAssetStyleUtils.getAssetsExtraStyle(getContext(), "over_view_style_extra.data"));
|
||||
// 设置自定义样式
|
||||
mAMap.setCustomMapStyle(customMapStyleOptions1);
|
||||
mAMapNaviView.getMap().setPointToCenter(mAMapNaviView.getWidth() / 2, mAMapNaviView.getHeight() / 2);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true">
|
||||
|
||||
<com.amap.api.maps.TextureMapView
|
||||
<com.amap.api.maps.MapView
|
||||
android:id="@+id/aMapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -16,7 +16,7 @@ public class MapAssetStyleUtils {
|
||||
byte[] buffer1 = null;
|
||||
InputStream is1 = null;
|
||||
try {
|
||||
is1 = context.getResources().getAssets().open(fileName); //eg. small_map_style.data
|
||||
is1 = context.getResources().getAssets().open(fileName); //eg. over_view_style.data
|
||||
int lenght1 = is1.available();
|
||||
buffer1 = new byte[lenght1];
|
||||
is1.read(buffer1);
|
||||
@@ -39,7 +39,7 @@ public class MapAssetStyleUtils {
|
||||
byte[] buffer1 = null;
|
||||
InputStream is1 = null;
|
||||
try {
|
||||
is1 = context.getResources().getAssets().open(fileName); //eg. small_map_style_extra.data
|
||||
is1 = context.getResources().getAssets().open(fileName); //eg. over_view_style_extra.data
|
||||
int lenght1 = is1.available();
|
||||
buffer1 = new byte[lenght1];
|
||||
is1.read(buffer1);
|
||||
|
||||
Reference in New Issue
Block a user