优化已知问题
This commit is contained in:
@@ -61,7 +61,6 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
marker.setMObject( this );
|
||||
MarkerWrapperClickHelper.getInstance().setMogoMarkerMap( marker.getId(), this );
|
||||
}
|
||||
marker.setSaveBitmapEnable( true );
|
||||
setObject( mogoMarkerOptions.getObject() );
|
||||
this.mMogoMarkerOptions = mogoMarkerOptions;
|
||||
mMogoMarkerOptions.addObserver( this );
|
||||
@@ -141,12 +140,12 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
if ( icons == null || icons.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
ArrayList<BitmapDescriptor> descriptors = new ArrayList<>();
|
||||
ArrayList< BitmapDescriptor > descriptors = new ArrayList<>();
|
||||
for ( Bitmap icon : icons ) {
|
||||
if ( icon == null || icon.isRecycled() ) {
|
||||
continue;
|
||||
}
|
||||
descriptors.add( BitmapDescriptorFactory.INSTANCE.fromBitmap(icon));
|
||||
descriptors.add( BitmapDescriptorFactory.INSTANCE.fromBitmap( icon ) );
|
||||
}
|
||||
if ( descriptors.isEmpty() ) {
|
||||
return;
|
||||
@@ -265,16 +264,16 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
@Override
|
||||
public void setOnMarkerClickListener( IMogoMarkerClickListener listener ) {
|
||||
mMogoMarkerClickListener = listener;
|
||||
if ( mMarker != null ) {
|
||||
mMarker.setOnMarkClickListener( new OnMarkClickListener() {
|
||||
@Override
|
||||
public void onMarkClick( @NotNull Marker marker ) {
|
||||
if ( mMogoMarkerClickListener != null ) {
|
||||
mMogoMarkerClickListener.onMarkerClicked( AMapMarkerWrapper.this );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
// if ( mMarker != null ) {
|
||||
// mMarker.setOnMarkClickListener( new OnMarkClickListener() {
|
||||
// @Override
|
||||
// public void onMarkClick( @NotNull Marker marker ) {
|
||||
// if ( mMogoMarkerClickListener != null ) {
|
||||
// mMogoMarkerClickListener.onMarkerClicked( AMapMarkerWrapper.this );
|
||||
// }
|
||||
// }
|
||||
// } );
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -505,9 +504,14 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
@Override
|
||||
public void use3DResource( int model3D ) {
|
||||
try {
|
||||
mMarker.setMarkerOptions( mMarker.getMarkeOptions().marker3DIcon( model3D ) );
|
||||
mMarker.setMarkerOptions( mMarker.getMarkeOptions().anchorColor("#00FF00").marker3DIcon( model3D ) );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "use3DResource" );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAnchorColor( String anchorColor ) {
|
||||
mMarker.setMarkerOptions( mMarker.getMarkeOptions().anchorColor( anchorColor ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.map.impl.custom.utils;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
@@ -89,6 +90,11 @@ public class ObjectUtils {
|
||||
}
|
||||
if (opt.getIcon3DRes() != 0) {
|
||||
markerOptions.marker3DIcon(opt.getIcon3DRes());
|
||||
try {
|
||||
Color.parseColor(opt.getAnchorColor());
|
||||
markerOptions.anchorColor( opt.getAnchorColor() );
|
||||
} catch ( Exception e ) {
|
||||
}
|
||||
}
|
||||
if (!TextUtils.isEmpty(opt.getTitle())) {
|
||||
markerOptions.title(opt.getTitle());
|
||||
|
||||
Reference in New Issue
Block a user