marker infowindow的点击实现
This commit is contained in:
@@ -7,7 +7,9 @@ import com.mogo.map.marker.IMogoInfoWindowAdapter;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.zhidaoauto.map.sdk.open.abs.marker.InfoWindowAdapter;
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker;
|
||||
import com.zhidaoauto.map.sdk.open.marker.OnInfoWindowClickListener;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
@@ -18,7 +20,7 @@ import java.io.FileInputStream;
|
||||
* <p>
|
||||
* 自定义infowindow
|
||||
*/
|
||||
public final class AMapInfoWindowAdapter implements InfoWindowAdapter {
|
||||
public final class AMapInfoWindowAdapter implements InfoWindowAdapter, OnInfoWindowClickListener {
|
||||
|
||||
public View getInfoWindow( Marker marker ) {
|
||||
if ( marker.getMObject() instanceof IMogoMarker ) {
|
||||
@@ -26,17 +28,18 @@ public final class AMapInfoWindowAdapter implements InfoWindowAdapter {
|
||||
IMogoInfoWindowAdapter delegate = mogoMarker.getInfoWindowAdapter();
|
||||
if ( delegate != null ) {
|
||||
final View infoView = delegate.getInfoWindow( mogoMarker );
|
||||
if ( infoView != null ) {
|
||||
infoView.setOnClickListener( view -> {
|
||||
AMapMarkerClickHandler.getInstance().handleMarkerClicked( marker );
|
||||
} );
|
||||
}
|
||||
marker.setOnInfoWindowClickListener( this );
|
||||
return infoView;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInfoWindowClick( @NotNull Marker marker ) {
|
||||
AMapMarkerClickHandler.getInstance().handleMarkerClicked( marker );
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View getInfoContents(@Nullable Marker marker) {
|
||||
|
||||
Reference in New Issue
Block a user