public GeoPoint toGeoPoint() { return new GeoPoint((int)(x*1.0E6), (int)(y*1.0E6)); }
public GeoPoint toGeoPoint() { return new GeoPoint((int)(x*1.0E6), (int)(y*1.0E6)); }
@Implementation public com.google.android.maps.Projection getProjection() { if (projection == null) { projection = new Projection() { @Override public Point toPixels(GeoPoint geoPoint, Point point) { if (point == null) { point = new Point(); } point.y = scaleDegree(geoPoint.getLatitudeE6(), realView.getBottom(), realView.getTop(), mapCenter.getLatitudeE6(), latitudeSpan); point.x = scaleDegree(geoPoint.getLongitudeE6(), realView.getLeft(), realView.getRight(), mapCenter.getLongitudeE6(), longitudeSpan); return point; } @Override public GeoPoint fromPixels(int x, int y) { int lat = scalePixel(y, realView.getBottom(), -realMapView.getHeight(), mapCenter.getLatitudeE6(), latitudeSpan); int lng = scalePixel(x, realView.getLeft(), realMapView.getWidth(), mapCenter.getLongitudeE6(), longitudeSpan); return new GeoPoint(lat, lng); } @Override public float metersToEquatorPixels(float v) { return 0; } }; } return projection; }
public void addOverlay(IStation station) { int latitude = (int) (station.getLatitude() * 1.0E6); int longitude = (int) (station.getLongitude() * 1.0E6); StationOverlay overlay = new StationOverlay(new GeoPoint(latitude, longitude), String.valueOf(station.getBikesAvailables()), String.valueOf(station.getSlotsAvailables())); mOverlays.add(overlay); stations.add(station); populate(); }
@Override public GeoPoint fromPixels(int x, int y) { int lat = scalePixel(y, realView.getBottom(), -realMapView.getHeight(), mapCenter.getLatitudeE6(), latitudeSpan); int lng = scalePixel(x, realView.getLeft(), realMapView.getWidth(), mapCenter.getLongitudeE6(), longitudeSpan); return new GeoPoint(lat, lng); }
float longitudeLineDistance = result[0]; GeoPoint leftGeo = new GeoPoint((int) (latitude * 1e6), (int) ((longitude - accuracy / longitudeLineDistance) * 1e6)); projection.toPixels(leftGeo, left);
@Override public void onLocationChanged(Location location) { if (mCaptureLocation) { mLocation = location; if (mLocation != null) { // Bug report: cached GeoPoint is being returned as the first value. // Wait for the 2nd value to be returned, which is hopefully not cached? ++mLocationCount; InfoLogger.geolog("GeoPointMapActivity: " + System.currentTimeMillis() + " onLocationChanged(" + mLocationCount + ") lat: " + mLocation.getLatitude() + " long: " + mLocation.getLongitude() + " acc: " + mLocation.getAccuracy() ); if (mLocationCount > 1) { mLocationStatus.setText(getString(R.string.location_provider_accuracy, mLocation.getProvider(), truncateFloat(mLocation.getAccuracy()))); mGeoPoint = new GeoPoint((int) (mLocation.getLatitude() * 1E6), (int) (mLocation.getLongitude() * 1E6)); mMapController.animateTo(mGeoPoint); if (mLocation.getAccuracy() <= mLocationAccuracy) { returnLocation(); } } } else { InfoLogger.geolog("GeoPointMapActivity: " + System.currentTimeMillis() + " onLocationChanged(" + mLocationCount + ") null location"); } } }
int latitude = (int) (cursor.getDouble(cursor.getColumnIndex("latitude")) * 1.0E6); int longitude = (int) (cursor.getDouble(cursor.getColumnIndex("longitude")) * 1.0E6); GeoPoint geoPoint = new GeoPoint(latitude, longitude); if (latitude < minLatitude) { minLatitude = latitude; mc.animateTo(new GeoPoint((maxLatitude + minLatitude) / 2, (maxLongitude + minLongitude) / 2)); mc.setZoom(14);
maxLongitude = Math.max(longitude, maxLongitude); minLongitude = Math.min(longitude, minLongitude); OverlayItem item = new OverlayItem(new GeoPoint(latitude, longitude), portion.getFromName(), null); itemizedOverlay.addOverlay(item); mapOverlays.add(itemizedOverlay); maxLongitude = Math.max(longitude, maxLongitude); minLongitude = Math.min(longitude, minLongitude); OverlayItem item = new OverlayItem(new GeoPoint(latitude, longitude), portion.getToName(), null); itemizedOverlay.addOverlay(item); mapOverlays.add(itemizedOverlay); mapOverlays.add(lineItemizedOverlay); mc.animateTo(new GeoPoint((maxLatitude + minLatitude) / 2, (maxLongitude + minLongitude) / 2));
int latitude = (int) (parkRelai.latitude * 1.0E6); int longitude = (int) (parkRelai.longitude * 1.0E6); GeoPoint geoPoint = new GeoPoint(latitude, longitude); if (latitude < minLatitude) { minLatitude = latitude; mc.animateTo(new GeoPoint((maxLatitude + minLatitude) / 2, (maxLongitude + minLongitude) / 2)); mc.setZoom(14);
minLongitude = longitude; OverlayItem item = new OverlayItem(new GeoPoint(latitude, longitude), portion.getFromName(), null); itemizedOverlay.addOverlay(item); mapOverlays.add(itemizedOverlay); minLongitude = longitude; OverlayItem item = new OverlayItem(new GeoPoint(latitude, longitude), portion.getToName(), null); itemizedOverlay.addOverlay(item); mapOverlays.add(itemizedOverlay); mapOverlays.add(lineItemizedOverlay); mc.animateTo(new GeoPoint((maxLatitude + minLatitude) / 2, (maxLongitude + minLongitude) / 2));
if ( intent.hasExtra(GeoPointWidget.LOCATION) ) { double[] location = intent.getDoubleArrayExtra(GeoPointWidget.LOCATION); mGeoPoint = new GeoPoint((int) (location[0] * 1E6), (int) (location[1] * 1E6));
int latitude = (int) (pointDeVente.latitude * 1.0E6); int longitude = (int) (pointDeVente.longitude * 1.0E6); GeoPoint geoPoint = new GeoPoint(latitude, longitude); if (pointDeVente.longitude > -2.0) { if (latitude < minLatitude) { mc.animateTo(new GeoPoint((maxLatitude + minLatitude) / 2, (maxLongitude + minLongitude) / 2)); mc.setZoom(14);
int latitude = (int) (parkRelai.latitude * 1.0E6); int longitude = (int) (parkRelai.longitude * 1.0E6); GeoPoint geoPoint = new GeoPoint(latitude, longitude); if (latitude < minLatitude) { minLatitude = latitude; mc.animateTo(new GeoPoint((maxLatitude + minLatitude) / 2, (maxLongitude + minLongitude) / 2)); mc.setZoom(14);
mc.animateTo(new GeoPoint((maxLatitude + minLatitude) / 2, (maxLongitude + minLongitude) / 2)); mc.setZoom(14);