mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2024-11-19 02:29:25 +01:00
Handle GoogleMapOptions
fixes several wrong positioned maps bugs
This commit is contained in:
parent
f7b9a6dc3a
commit
2751bdac1c
@ -108,7 +108,39 @@ public class GoogleMapOptions implements SafeParcelable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Creator<GoogleMapOptions> CREATOR = new Creator<GoogleMapOptions>() {
|
public int getMapType() {
|
||||||
|
return mapType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CameraPosition getCamera() {
|
||||||
|
return camera;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isZoomControlsEnabled() {
|
||||||
|
return zoomControlsEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCompassEnabled() {
|
||||||
|
return compassEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isScrollGesturesEnabled() {
|
||||||
|
return scrollGesturesEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isZoomGesturesEnabled() {
|
||||||
|
return zoomGesturesEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isTiltGesturesEnabled() {
|
||||||
|
return tiltGesturesEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isRotateGesturesEnabled() {
|
||||||
|
return rotateGesturesEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Creator<GoogleMapOptions> CREATOR = new Creator<GoogleMapOptions>() {
|
||||||
public GoogleMapOptions createFromParcel(Parcel source) {
|
public GoogleMapOptions createFromParcel(Parcel source) {
|
||||||
return new GoogleMapOptions(source);
|
return new GoogleMapOptions(source);
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ import com.google.android.gms.maps.model.internal.*;
|
|||||||
import com.google.android.maps.MapController;
|
import com.google.android.maps.MapController;
|
||||||
import com.google.android.maps.MapView;
|
import com.google.android.maps.MapView;
|
||||||
import org.microg.gms.maps.camera.CameraUpdate;
|
import org.microg.gms.maps.camera.CameraUpdate;
|
||||||
|
import org.microg.gms.maps.camera.CameraUpdateFactoryImpl;
|
||||||
import org.microg.gms.maps.markup.*;
|
import org.microg.gms.maps.markup.*;
|
||||||
|
|
||||||
public class GoogleMapImpl {
|
public class GoogleMapImpl {
|
||||||
@ -49,6 +50,7 @@ public class GoogleMapImpl {
|
|||||||
private final ViewGroup view;
|
private final ViewGroup view;
|
||||||
private final GoogleMapOptions options;
|
private final GoogleMapOptions options;
|
||||||
private final Delegate delegate = new Delegate();
|
private final Delegate delegate = new Delegate();
|
||||||
|
private final UiSettings uiSettings = new UiSettings();
|
||||||
private final Projection projection = new Projection();
|
private final Projection projection = new Projection();
|
||||||
private MapView mapView;
|
private MapView mapView;
|
||||||
private int mapType = 1;
|
private int mapType = 1;
|
||||||
@ -63,11 +65,22 @@ public class GoogleMapImpl {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d(TAG, "Sorry, can't create legacy MapView");
|
Log.d(TAG, "Sorry, can't create legacy MapView");
|
||||||
}
|
}
|
||||||
this.options = options;
|
this.options = options;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
try {
|
||||||
|
delegate.animateCamera(new CameraUpdateFactoryImpl().newCameraPosition(options.getCamera()));
|
||||||
|
delegate.setMapType(options.getMapType());
|
||||||
|
uiSettings.setCompassEnabled(options.isCompassEnabled());
|
||||||
|
uiSettings.setZoomControlsEnabled(options.isZoomControlsEnabled());
|
||||||
|
uiSettings.setRotateGesturesEnabled(options.isRotateGesturesEnabled());
|
||||||
|
uiSettings.setScrollGesturesEnabled(options.isScrollGesturesEnabled());
|
||||||
|
uiSettings.setTiltGesturesEnabled(options.isTiltGesturesEnabled());
|
||||||
|
uiSettings.setZoomGesturesEnabled(options.isZoomGesturesEnabled());
|
||||||
|
} catch (RemoteException ignored) {
|
||||||
|
// It's not remote...
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IOnMarkerClickListener getMarkerClickListener() {
|
public IOnMarkerClickListener getMarkerClickListener() {
|
||||||
@ -242,7 +255,7 @@ public class GoogleMapImpl {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IUiSettingsDelegate getUiSettings() throws RemoteException {
|
public IUiSettingsDelegate getUiSettings() throws RemoteException {
|
||||||
return new UiSettings();
|
return uiSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user