优化显示逻辑

This commit is contained in:
wangcongtao
2021-03-09 16:58:20 +08:00
parent 55c585bc44
commit 36e5356bfe
9 changed files with 70 additions and 19 deletions

View File

@@ -5,6 +5,7 @@ import android.graphics.Color;
import android.text.TextUtils;
import android.view.View;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.map.MogoLatLng;
import com.mogo.map.location.MogoLocation;
import com.mogo.map.marker.MogoMarkerOptions;
@@ -22,7 +23,10 @@ import com.mogo.map.search.poisearch.MogoPoiResult;
import com.mogo.map.search.poisearch.MogoSearchBound;
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
import com.mogo.map.uicontroller.MapCameraPosition;
import com.mogo.utils.logger.Logger;
import com.zhidaoauto.map.sdk.open.camera.CameraPosition;
import com.zhidaoauto.map.sdk.open.data.MapDataApi;
import com.zhidaoauto.map.sdk.open.data.SinglePointRoadInfo;
import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptor;
import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptorFactory;
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions;
@@ -65,11 +69,26 @@ public class ObjectUtils {
if ( icon == null || icon.isRecycled() ) {
continue;
}
descriptors.add( new BitmapDescriptor( icon ) );
}
}
// 吸附到路边
// if ( opt.isMatchOnRoadSide() ) {
// double coors[] = new double[]{opt.getLongitude(), opt.getLatitude()};
// if ( !opt.isGps() ) {
// coors = CoordinateUtils.transformGcj02toWgs84( opt.getLatitude(), opt.getLongitude() );
// opt.gps( true );
// }
// if ( coors != null ) {
// SinglePointRoadInfo singlePointRoadInfo = MapDataApi.INSTANCE.getSinglePointMatchRoad( ( ( float ) coors[0] ), ( ( float ) coors[1] ), ( ( float ) opt.getRotate() ), true, true );
// double data[] = PointInterpolatorUtil.mergeToRoad( coors[0], coors[1], singlePointRoadInfo.getCoords() );
// if ( data != null ) {
// opt.longitude( data[0] ).latitude( data[1] );
// }
// }
// }
MarkerOptions markerOptions = new MarkerOptions()
.position( new LonLatPoint( opt.getLongitude(), opt.getLatitude() ) )
.anchor( opt.getU(), opt.getV() )
@@ -85,7 +104,7 @@ public class ObjectUtils {
// .draggable( opt.isDraggable() )
.setInfoWindowOffset( opt.getOffsetX(), opt.getOffsetY() )
.zIndex( opt.getzIndex() );
if ( !TextUtils.isEmpty( opt.getResName() )) {
if ( !TextUtils.isEmpty( opt.getResName() ) ) {
markerOptions.setMarkerIconName( opt.getResName() );
markerOptions.vrEnable( opt.is3DMode() );
} else {