Search in sources :

Example 1 with AddressInformation

use of net.osmand.plus.activities.search.SearchAddressFragment.AddressInformation in project Osmand by osmandapp.

the class SearchByNameAbstractActivity method select.

protected void select(int mode) {
    LatLon searchPoint = settings.getLastSearchedPoint();
    AddressInformation ai = getAddressInformation();
    if (ai != null && searchPoint != null) {
        if (mode == ADD_TO_FAVORITE) {
            Bundle b = new Bundle();
            Dialog dlg = FavoriteDialogs.createAddFavouriteDialog(getActivity(), b);
            dlg.show();
            FavoriteDialogs.prepareAddFavouriteDialog(getActivity(), dlg, b, searchPoint.getLatitude(), searchPoint.getLongitude(), new PointDescription(PointDescription.POINT_TYPE_ADDRESS, ai.objectName));
        } else if (mode == NAVIGATE_TO) {
            DirectionsDialogs.directionsToDialogAndLaunchMap(getActivity(), searchPoint.getLatitude(), searchPoint.getLongitude(), ai.getHistoryName());
        } else if (mode == SHOW_ON_MAP) {
            showOnMap(searchPoint, ai);
        }
    }
}
Also used : LatLon(net.osmand.data.LatLon) AddressInformation(net.osmand.plus.activities.search.SearchAddressFragment.AddressInformation) Bundle(android.os.Bundle) Dialog(android.app.Dialog) PointDescription(net.osmand.data.PointDescription)

Aggregations

Dialog (android.app.Dialog)1 Bundle (android.os.Bundle)1 LatLon (net.osmand.data.LatLon)1 PointDescription (net.osmand.data.PointDescription)1 AddressInformation (net.osmand.plus.activities.search.SearchAddressFragment.AddressInformation)1