/** * @return {@link com.car2go.maps.model.LatLngBounds.Builder} for {@link LatLngBounds} */ public static Builder builder() { return new Builder(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof VisibleRegion)) { return false; } VisibleRegion that = (VisibleRegion) o; return latLngBounds.equals(that.latLngBounds); }
@Override public com.car2go.maps.model.LatLng map(LatLng input) { return new com.car2go.maps.model.LatLng( input.latitude, input.longitude ); }
/** * @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) ); }
/** * 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 ); } }
private RectGeofence createFence() { return new RectGeofence(new LatLng(1, -1), new LatLng(-1, 1)); }
@Test public void testInside() throws Exception { assertTrue(createFence().contains(new LatLng(0, 0))); assertTrue(createFence().contains(new LatLng(0.999, 0.999))); assertTrue(createFence().contains(new LatLng(-0.999, 0.999))); assertTrue(createFence().contains(new LatLng(-0.999, -0.999))); assertTrue(createFence().contains(new LatLng(0.999, -0.999))); }
public static Projection convert(LatLngBounds bound) { return new BaiduProjection( new VisibleRegion( new com.car2go.maps.model.LatLngBounds( BaiduToModelConverter.convert(bound.southwest), BaiduToModelConverter.convert(bound.northeast) ) ) ); } }
public CameraPosition createFromParcel(Parcel source) { return new CameraPosition(source); }
@Override public List<LatLng> getPoints() { return options.getPoints(); }
@Override public int hashCode() { return latLngBounds.hashCode(); }
private CameraPosition currentCameraPosition() { final IGeoPoint center = map.getMapCenter(); final int zoomLevel = map.getZoomLevel(); return new CameraPosition( new LatLng(center.getLatitude(), center.getLongitude()), zoomLevel ); }
@Test(expected = IllegalArgumentException.class) public void testWrongRectNorthSouth() throws Exception { new RectGeofence(new LatLng(-1, -1), new LatLng(1, 1)); } }
@Test public void testOutside() throws Exception { assertFalse(createFence().contains(new LatLng(1.001, 0))); assertFalse(createFence().contains(new LatLng(-1.001, 0))); assertFalse(createFence().contains(new LatLng(0, 1.001))); assertFalse(createFence().contains(new LatLng(0, -1.001))); }
public LatLng createFromParcel(Parcel source) { return new LatLng(source); }
@Override public com.car2go.maps.model.CameraPosition map(CameraPosition input) { LatLng anyLatLng = AnyMapAdapter.adapt(input.target); return new com.car2go.maps.model.CameraPosition( anyLatLng, input.zoom ); }
@Test(expected = IllegalArgumentException.class) public void testWrongRectEastWest() throws Exception { new RectGeofence(new LatLng(1, 1), new LatLng(-1, -1)); }
public static com.car2go.maps.model.LatLng convert(LatLng point) { return new com.car2go.maps.model.LatLng(point.latitude, point.longitude); }