This commit is contained in:
wangcongtao
2020-12-22 11:21:53 +08:00
parent 181ab87807
commit ea3518b676
23 changed files with 130 additions and 37 deletions

View File

@@ -21,12 +21,13 @@ public class AMapMarkerClickHandler {
private static volatile AMapMarkerClickHandler sInstance;
private AMapMarkerClickHandler(){}
private AMapMarkerClickHandler() {
}
public static AMapMarkerClickHandler getInstance(){
if( sInstance == null ){
synchronized( AMapMarkerClickHandler.class ) {
if( sInstance == null ){
public static AMapMarkerClickHandler getInstance() {
if ( sInstance == null ) {
synchronized ( AMapMarkerClickHandler.class ) {
if ( sInstance == null ) {
sInstance = new AMapMarkerClickHandler();
}
}
@@ -34,7 +35,7 @@ public class AMapMarkerClickHandler {
return sInstance;
}
public synchronized void release(){
public synchronized void release() {
sInstance = null;
}
@@ -47,13 +48,16 @@ public class AMapMarkerClickHandler {
if ( marker == null ) {
return false;
}
Map<String, IMogoMarker> mogoMarkerMap = MarkerWrapperClickHelper.getInstance().getMogoMarkerMap();
if ( mogoMarkerMap.containsKey(marker.getId())) {
IMogoMarker mogoMarker = mogoMarkerMap.get(marker.getId());
Map< String, IMogoMarker > mogoMarkerMap = MarkerWrapperClickHelper.getInstance().getMogoMarkerMap();
if ( mogoMarkerMap.containsKey( marker.getId() ) ) {
IMogoMarker mogoMarker = mogoMarkerMap.get( marker.getId() );
final IMogoMarkerClickListener listener = mogoMarker.getOnMarkerClickListener();
Logger.d( "AMapMarkerWrapper", "marker 点击回调:%s -> %s", mogoMarker, marker );
if ( listener != null ) {
listener.onMarkerClicked( mogoMarker );
boolean result = listener.onMarkerClicked( mogoMarker );
if ( result ) {
return true;
}
}
return MogoMarkersHandler.getInstance().onMarkerClicked( mogoMarker );
}

View File

@@ -339,13 +339,11 @@ public class AMapViewWrapper implements IMogoMapView,
if ( mMapView.getMapAutoViewHelper() != null ) {
switch ( ui ) {
case CarUp_2D:
mMapView.getMapAutoViewHelper().setMapViewPerspective( MapAutoApi.MAP_PERSPECTIVE_2D );
break;
case CarUp_3D:
mMapView.getMapAutoViewHelper().setMapViewPerspective( MapAutoApi.MAP_PERSPECTIVE_3D );
mMapView.getMapAutoViewHelper().setMapViewPerspective( MapAutoApi.MAP_PERSPECTIVE_UP_CAR );
break;
case NorthUP_2D:
mMapView.getMapAutoViewHelper().setRotateGesturesEnabled( false );
mMapView.getMapAutoViewHelper().setMapViewPerspective( MapAutoApi.MAP_PERSPECTIVE_UP_NORTH );
break;
}
}

View File

@@ -59,6 +59,7 @@ 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 );

View File

@@ -126,15 +126,15 @@ public class ObjectUtils {
location.setLongitude( aLocation.getLon() );
location.setAltitude( aLocation.getAltitude() );
// location.setTime( aLocation.getTime() );
// location.setBearing( aLocation.getBearing() );
location.setBearing( aLocation.getHeading() );
// location.setAccuracy( aLocation.getAccuracy() );
// location.setCityCode( aLocation.getCityCode() );
// location.setCityName( aLocation.getCity() );
location.setCityCode( aLocation.getCityCode() );
location.setCityName( aLocation.getCity() );
location.setProvider( aLocation.getProvider() );
// location.setAddress( aLocation.getAddress() );
// location.setDistrict( aLocation.getDistrict() );
// location.setProvince( aLocation.getProvince() );
// location.setAdCode( aLocation.getAdCode() );
location.setAddress( aLocation.getAddress() );
location.setDistrict( aLocation.getDistrict() );
location.setProvince( aLocation.getProvince() );
location.setAdCode( aLocation.getAdCode() );
// location.setLocationDetail( aLocation.getLocationDetail() );
// location.setPoiName( aLocation.getPoiName() );
// location.setAoiName( aLocation.getAoiName() );