@Override public com.car2go.maps.model.LatLng map(LatLng input) { return new com.car2go.maps.model.LatLng( input.latitude, input.longitude ); }
public LatLng createFromParcel(Parcel source) { return new LatLng(source); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof CameraPosition)) { return false; } CameraPosition that = (CameraPosition) o; return Float.compare(that.zoom, zoom) == 0 && target.equals(that.target); }
@Override public int hashCode() { int result = target.hashCode(); result = 31 * result + (zoom != +0.0f ? Float.floatToIntBits(zoom) : 0); return result; }
public static com.car2go.maps.model.LatLng convert(LatLng point) { return new com.car2go.maps.model.LatLng(point.latitude, point.longitude); }
/** * @return center of the region */ public LatLng getCenter() { // Implementation copied from original obfuscated version of LatLngBounds double var1 = (this.southwest.latitude + this.northeast.latitude) / 2.0D; double var3 = this.northeast.longitude; double var5 = this.southwest.longitude; double var7; if (var5 <= var3) { var7 = (var3 + var5) / 2.0D; } else { var7 = (var3 + 360.0D + var5) / 2.0D; } return new LatLng(var1, var7); }
/** * @return new instance of {@link LatLngBounds} * @throws IllegalStateException if less than 2 unique points were specified */ public LatLngBounds build() { if (Double.isNaN(southWestLongitude)) { throw new IllegalStateException("No included points"); } return new LatLngBounds( new LatLng(southWestLattitude, southWestLongitude), new LatLng(northEastLattitude, northEastLongitude) ); }
public static LatLng fromLocation(Location location) { return new LatLng(location.getLatitude(), location.getLongitude()); }
/** * Gets the current camera position. * * @return the camera position */ public CameraPosition currentCameraPosition() { MapStatus mapStatus = map.getMapStatus(); return new CameraPosition( new LatLng(mapStatus.target.latitude, mapStatus.target.longitude), mapStatus.zoom ); } }
/** * Returns the LatLng resulting from moving a distance from an origin * in the specified heading (expressed in degrees clockwise from north). * * @param from The LatLng from which to start. * @param distance The distance to travel. * @param heading The heading in degrees clockwise from north. */ public static LatLng computeOffset(LatLng from, double distance, double heading) { distance /= 6371009.0D; heading = Math.toRadians(heading); double fromLat = Math.toRadians(from.latitude); double fromLng = Math.toRadians(from.longitude); double cosDistance = Math.cos(distance); double sinDistance = Math.sin(distance); double sinFromLat = Math.sin(fromLat); double cosFromLat = Math.cos(fromLat); double sinLat = cosDistance * sinFromLat + sinDistance * cosFromLat * Math.cos(heading); double dLng = Math.atan2(sinDistance * cosFromLat * Math.sin(heading), cosDistance - sinFromLat * sinLat); return new LatLng(Math.toDegrees(Math.asin(sinLat)), Math.toDegrees(fromLng + dLng)); }
path.add(new LatLng((double) lat * 1.0E-5D, (double) lng * 1.0E-5D));
double lat = Math.atan2(z, Math.sqrt(x * x + y * y)); double lng = Math.atan2(y, x); return new LatLng(Math.toDegrees(lat), Math.toDegrees(lng));
return new LatLng(Math.toDegrees(fromLatRadians), Math.toDegrees(fromLngRadians)); } else { return null;
/** * @return {@link LatLng} with same coordinates as {@link IGeoPoint} */ public static LatLng toLatLng(IGeoPoint geoPoint) { return new LatLng( geoPoint.getLatitude(), geoPoint.getLongitude() ); }
private CameraPosition currentCameraPosition() { final IGeoPoint center = map.getMapCenter(); final int zoomLevel = map.getZoomLevel(); return new CameraPosition( new LatLng(center.getLatitude(), center.getLongitude()), zoomLevel ); }