/**
  * Animates the underlying {@link OpenStreetMapView} that it centers the passed {@link GeoPoint}
  * in the end.
  *
  * @param gp GeoPoint to be centered in the end.
  * @param aSmoothness steps made during animation. I.e.: {@link
  *     OpenStreetMapViewController.ANIMATION_SMOOTHNESS_LOW}, {@link
  *     OpenStreetMapViewController.ANIMATION_SMOOTHNESS_DEFAULT}, {@link
  *     OpenStreetMapViewController.ANIMATION_SMOOTHNESS_HIGH}
  * @param aDuration in Milliseconds. I.e.: {@link
  *     OpenStreetMapViewController.ANIMATION_DURATION_SHORT}, {@link
  *     OpenStreetMapViewController.ANIMATION_DURATION_DEFAULT}, {@link
  *     OpenStreetMapViewController.ANIMATION_DURATION_LONG}
  */
 public void animateTo(
     final GeoPoint gp,
     final AnimationType aAnimationType,
     final int aSmoothness,
     final int aDuration) {
   animateTo(gp.getLatitudeE6(), gp.getLongitudeE6(), aAnimationType, aSmoothness, aDuration);
 }
 /**
  * Animates the underlying {@link OpenStreetMapView} that it centers the passed {@link GeoPoint}
  * in the end. Uses: {@link OpenStreetMapViewController.ANIMATION_SMOOTHNESS_DEFAULT} and {@link
  * OpenStreetMapViewController.ANIMATION_DURATION_DEFAULT}.
  *
  * @param gp
  */
 public void animateTo(final GeoPoint gp, final AnimationType aAnimationType) {
   animateTo(
       gp.getLatitudeE6(),
       gp.getLongitudeE6(),
       aAnimationType,
       ANIMATION_DURATION_DEFAULT,
       ANIMATION_SMOOTHNESS_DEFAULT);
 }
示例#3
0
 public void fromPref(SharedPreferences settings) {
   final String strlocation = settings.getString("SearchResultLocation", "");
   if (strlocation.length() > 0) {
     mLocation = GeoPoint.fromDoubleString(strlocation);
     mDescr = settings.getString("SearchResultDescr", "");
   }
 }
示例#4
0
 public void toPref(SharedPreferences.Editor editor) {
   if (mLocation != null) {
     editor.putString("SearchResultDescr", mDescr);
     editor.putString("SearchResultLocation", mLocation.toDoubleString());
   } else {
     editor.putString("SearchResultDescr", "");
     editor.putString("SearchResultLocation", "");
   }
 }
示例#5
0
  private void doSaveAction() {
    mPoiPoint.Title = mTitle.getText().toString();
    mPoiPoint.CategoryId = (int) mSpinner.getSelectedItemId();
    mPoiPoint.Descr = mDescr.getText().toString();
    mPoiPoint.GeoPoint =
        GeoPoint.fromDouble(
            CoordFormatter.convert(mLat.getText().toString()),
            CoordFormatter.convert(mLon.getText().toString()));
    mPoiPoint.Hidden = mHidden.isChecked();
    try {
      mPoiPoint.Alt = Double.parseDouble(mAlt.getText().toString());
    } catch (NumberFormatException e) {
    }

    mPoiManager.updatePoi(mPoiPoint);
    finish();

    Toast.makeText(PoiActivity.this, R.string.message_saved, Toast.LENGTH_SHORT).show();
  }