/** * 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); }
public void fromPref(SharedPreferences settings) { final String strlocation = settings.getString("SearchResultLocation", ""); if (strlocation.length() > 0) { mLocation = GeoPoint.fromDoubleString(strlocation); mDescr = settings.getString("SearchResultDescr", ""); } }
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", ""); } }
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(); }