[android] - wrap longitude values from core (#7852)
This commit is contained in:
@@ -242,7 +242,7 @@ public final class CameraPosition implements Parcelable {
|
||||
public Builder(double[] nativeCameraValues) {
|
||||
super();
|
||||
if (nativeCameraValues != null && nativeCameraValues.length == 5) {
|
||||
target(new LatLng(nativeCameraValues[0], nativeCameraValues[1]));
|
||||
target(new LatLng(nativeCameraValues[0], nativeCameraValues[1]).wrap());
|
||||
bearing(MathUtils.convertNativeBearing(nativeCameraValues[2]));
|
||||
tilt(nativeCameraValues[3]);
|
||||
zoom(nativeCameraValues[4]);
|
||||
|
||||
@@ -127,13 +127,8 @@ public class LatLng implements ILatLng, Parcelable {
|
||||
* @return New LatLng object with wrapped Longitude
|
||||
*/
|
||||
public LatLng wrap() {
|
||||
LatLng wrappedVersion = new LatLng(this);
|
||||
double lon = wrappedVersion.getLongitude();
|
||||
if (lon < GeoConstants.MIN_LONGITUDE || lon > GeoConstants.MAX_LONGITUDE) {
|
||||
wrappedVersion.setLongitude(MathUtils.wrap(wrappedVersion.getLongitude(), GeoConstants.MIN_LONGITUDE,
|
||||
GeoConstants.MAX_LONGITUDE));
|
||||
}
|
||||
return wrappedVersion;
|
||||
longitude = MathUtils.wrap(longitude, GeoConstants.MIN_LONGITUDE, GeoConstants.MAX_LONGITUDE);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -353,7 +353,8 @@ final class NativeMapView {
|
||||
if (isDestroyedOn("")) {
|
||||
return new LatLng();
|
||||
}
|
||||
return nativeGetLatLng(nativeMapViewPtr);
|
||||
// wrap longitude values coming from core
|
||||
return nativeGetLatLng(nativeMapViewPtr).wrap();
|
||||
}
|
||||
|
||||
public void resetPosition() {
|
||||
@@ -708,7 +709,7 @@ final class NativeMapView {
|
||||
return new LatLng();
|
||||
}
|
||||
return nativeLatLngForProjectedMeters(nativeMapViewPtr, projectedMeters.getNorthing(),
|
||||
projectedMeters.getEasting());
|
||||
projectedMeters.getEasting()).wrap();
|
||||
}
|
||||
|
||||
public PointF pixelForLatLng(LatLng latLng) {
|
||||
@@ -724,7 +725,7 @@ final class NativeMapView {
|
||||
if (isDestroyedOn("latLngForPixel")) {
|
||||
return new LatLng();
|
||||
}
|
||||
return nativeLatLngForPixel(nativeMapViewPtr, pixel.x / pixelRatio, pixel.y / pixelRatio);
|
||||
return nativeLatLngForPixel(nativeMapViewPtr, pixel.x / pixelRatio, pixel.y / pixelRatio).wrap();
|
||||
}
|
||||
|
||||
public double getTopOffsetPixelsForAnnotationSymbol(String symbolName) {
|
||||
|
||||
Reference in New Issue
Block a user