Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
6cad3242e4
18 changed files with 300 additions and 155 deletions
|
@ -1,4 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources><string name="switch_to_raster_map_to_see">Vektorové mapy toto místo neobsahují. Mapová data můžete stáhnout v Nastaveních (Offline data), nebo se přepněte na online mapy.</string>
|
||||
<string name="tip_recent_changes_0_7_2_t">"Změny ve verzi 0.7.2 :
|
||||
\n\t- Native rendering pro všechna zařízení
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources><string name="avoid_in_routing_title">Osgoi...</string>
|
||||
<string name="avoid_in_routing_descr">Osgoi tollffyrdd, ffyrdd garw, fferïau</string>
|
||||
<string name="show_warnings_title">Dangos larymau</string>
|
||||
|
@ -76,7 +76,7 @@
|
|||
<string name="starting_point_too_far">Man cychwyn yn rhy bell o\'r ffordd agosaf</string>
|
||||
<string name="shared_location">Lleoliad rhanedig</string>
|
||||
<string name="avoid_motorway">Ceisiwch osgoi traffyrdd</string>
|
||||
<string name="auto_zoom_map_descr">Zoom Auto mapio yn ôl eich cyflymder (tra map wedi eu cydamseru gyda'r sefyllfa bresennol)</string>
|
||||
<string name="auto_zoom_map_descr">Zoom Auto mapio yn ôl eich cyflymder (tra map wedi eu cydamseru gyda\'r sefyllfa bresennol)</string>
|
||||
<string name="auto_zoom_map">Auto chwyddo map</string>
|
||||
<string name="tip_recent_changes_0_8_3_t">Newidiadau mewn 0.8.3: ↵
|
||||
\n\t* cyfarwyddyd llwybr Gwell ↵
|
||||
|
@ -86,7 +86,7 @@
|
|||
\n\t* Mae rhai bug chyfyngderau ↵
|
||||
tip_recent_changes_0_8_3_t Cyd-destun</string>
|
||||
<string name="snap_to_road_descr">Snap sefyllfa i ffyrdd yn ystod llywio</string>
|
||||
<string name="snap_to_road">Snap i'r ffordd</string>
|
||||
<string name="snap_to_road">Snap i\'r ffordd</string>
|
||||
<string name="osmand_short_description_80_chars">OsmAnd yn gais ffynhonnell agored ar gyfer llywio fapiau all-lein ac ar-lein</string>
|
||||
<string name="osmand_plus_short_description_80_chars">OsmAnd yn gais ffynhonnell agored ar gyfer llywio fapiau all-lein ac ar-lein</string>
|
||||
<string name="tip_update_index">Diweddaru Data All-lein</string>
|
||||
|
@ -115,8 +115,8 @@ Cyfrannol cof %4$s MB (terfyn Android %5$s MB, Dalvik %6$s MB).</string>
|
|||
<string name="osmand_parking_add_event">Ychwanegwch hysbysiad i calendr cais</string>
|
||||
<string name="osmand_parking_time_limit">Amser-gyfyngedig parcio</string>
|
||||
<string name="osmand_parking_time_no_limit">Amser-diderfyn parcio</string>
|
||||
<string name="osmand_parking_position_description">Mae'r sefyllfa eich car wedi parcio. %1$s</string>
|
||||
<string name="osmand_parking_position_description_add">I godi'r car yn:</string>
|
||||
<string name="osmand_parking_position_description">Mae\'r sefyllfa eich car wedi parcio. %1$s</string>
|
||||
<string name="osmand_parking_position_description_add">I godi\'r car yn:</string>
|
||||
<string name="osmand_parking_position_name">Pwynt parcio</string>
|
||||
<string name="osmand_parking_plugin_description">Mae hyn yn ategyn yn caniatáu i storio y lleoliad eich car wedi parcio.</string>
|
||||
<string name="osmand_parking_plugin_name">Ategyn Safle Parcio</string>
|
||||
|
@ -129,8 +129,8 @@ Cyfrannol cof %4$s MB (terfyn Android %5$s MB, Dalvik %6$s MB).</string>
|
|||
<string name="asap">cyn gynted â phosibl</string>
|
||||
<string name="save_route_as_gpx">Cadw llwybr fel GPX ffeil</string>
|
||||
<string name="route_roundabout">Cylchfan: cymryd %1$d allanfa ac yn mynd</string>
|
||||
<string name="route_kl">Cadwch i'r chwith ac ewch</string>
|
||||
<string name="route_kr">Cadwch i'r dde ac ewch</string>
|
||||
<string name="route_kl">Cadwch i\'r chwith ac ewch</string>
|
||||
<string name="route_kr">Cadwch i\'r dde ac ewch</string>
|
||||
<string name="rendering_attr_noPolygons_description">Gwneud yr holl nodweddion tir arwynebedd ar fap tryloyw</string>
|
||||
<string name="rendering_attr_noPolygons_name">Dim polygonau</string>
|
||||
<string name="rendering_attr_appMode_name">Rendro modd</string>
|
||||
|
@ -151,12 +151,12 @@ Cyfrannol cof %4$s MB (terfyn Android %5$s MB, Dalvik %6$s MB).</string>
|
|||
<string name="left_side_navigation">Chwith-law gyrru</string>
|
||||
<string name="left_side_navigation_descr">Dewiswch ar gyfer gwledydd gyda chwith traffig</string>
|
||||
<string name="download_link_and_local_description">Cliciwch yma i lawrlwytho neu ddiweddaru data all-lein. \nCliciwch unrhyw eitem presennol i weld mwy o fanylion, bwyso a dal i deactivate neu ddileu. Data cyfredol ar y ddyfais (%1$s am ddim):</string>
|
||||
<string name="unknown_from_location">Nid yw man cychwyn hwn wedi'i benderfynu eto</string>
|
||||
<string name="unknown_location">Sefyllfa nad yw'n hysbys eto</string>
|
||||
<string name="unknown_from_location">Nid yw man cychwyn hwn wedi\'i benderfynu eto</string>
|
||||
<string name="unknown_location">Sefyllfa nad yw\'n hysbys eto</string>
|
||||
<string name="context_menu_item_directions">Cyfarwyddiadau i fan hyn</string>
|
||||
<string name="modify_transparency">Addasu tryloywder (0 - tryloyw, 255 - afloyw)</string>
|
||||
<string name="confirm_interrupt_download">Ydych chi eisiau i dorri ar draws llwytho ffeil?</string>
|
||||
<string name="basemap_was_selected_to_download">Basemap yn ofynnol ar gyfer gweithredu'n briodol cais a dewiswyd ef i lawrlwytho.</string>
|
||||
<string name="basemap_was_selected_to_download">Basemap yn ofynnol ar gyfer gweithredu\'n briodol cais a dewiswyd ef i lawrlwytho.</string>
|
||||
<string name="select_index_file_to_download">Ni ddaethpwyd o hyd. Os gallwch ni all ddod o hyd i\'ch rhanbarth, gallwch wneud eich hun (gweler http://osmand.net).</string>
|
||||
<string name="local_indexes_cat_tile">Mapiau Ar-lein (teils)</string>
|
||||
<string name="local_indexes_cat_map">Fapiau all-lein (fector)</string>
|
||||
|
@ -181,7 +181,7 @@ Cyfrannol cof %4$s MB (terfyn Android %5$s MB, Dalvik %6$s MB).</string>
|
|||
<string name="tip_recent_changes_0_8_0_t">Newidiadau mewn 0.8.0:
|
||||
\n\t- *ymarferoldeb Ategyn*
|
||||
\n\t - ymarferoldeb y rhan fwyaf o ei grwpio yn ôl nodweddion a gellir eu galluogi / anabl yn y Rheolwr Ategyn
|
||||
Gallwch alluogi (ar-lein neu cached) Ffynonellau teils map, lleoliadau olrhain, a nodweddion newydd a fu'n bodoli eraill.
|
||||
Gallwch alluogi (ar-lein neu cached) Ffynonellau teils map, lleoliadau olrhain, a nodweddion newydd a fu\'n bodoli eraill.
|
||||
\n\t- *data cymorth newydd map offline*
|
||||
\n\t - Map rendro yn dod yn gyflymach ac yn fwy manwl gywir (arfordir a phroblemau ardal dan ddŵr yn cael eu gosod yn bennaf).
|
||||
\n\t - Mae angen i chi lawrlwytho data all-lein hollol newydd (ni fydd hen ddata yn cael ei gefnogi anymore)
|
||||
|
@ -189,7 +189,7 @@ Gallwch alluogi (ar-lein neu cached) Ffynonellau teils map, lleoliadau olrhain,
|
|||
\n\t - llwybrau All-lein yn dod yn fwy cadarn
|
||||
\n\t *Defnyddioldeb a phrofiad UI*
|
||||
\n\t - Gwell mewn llawer o ardaloedd</string>
|
||||
<string name="vector_maps_may_display_faster_on_some_devices">Mapiau fector debygol arddangos yn gyflymach. Efallai na gweithio'n dda ar rai dyfeisiau.</string>
|
||||
<string name="vector_maps_may_display_faster_on_some_devices">Mapiau fector debygol arddangos yn gyflymach. Efallai na gweithio\'n dda ar rai dyfeisiau.</string>
|
||||
<string name="play_commands_of_currently_selected_voice">Chwarae gorchmynion llais a ddewiswyd ar hyn o bryd</string>
|
||||
<string name="debugging_and_development">OsmAnd datblygu</string>
|
||||
<string name="native_rendering">Rendro Brodorol</string>
|
||||
|
@ -239,7 +239,7 @@ Gallwch alluogi (ar-lein neu cached) Ffynonellau teils map, lleoliadau olrhain,
|
|||
<string name="back">Yn ôl</string>
|
||||
<string name="back_left">Cefn ar y chwith</string>
|
||||
<string name="left">Chwith</string>
|
||||
<string name="front_left">Flaen, o'r chwith</string>
|
||||
<string name="front_left">Flaen, o\'r chwith</string>
|
||||
<string name="accuracy">Cywirdeb</string>
|
||||
<string name="altitude">Uchder</string>
|
||||
</resources>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources><string name="show_warnings_title">Warnungen anzeigen…</string>
|
||||
<string name="show_warnings_descr">Warnungen für Tempolimits, stationäre Radarkontrollen, Rüttelschwellen u.Ä.</string>
|
||||
<string name="use_compass_navigation_descr">Kompass verwenden, wenn keine andere Richtungsbestimmung möglich</string>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources><string name="btn_add_tag">Προσθήκη Ετικέτας</string>
|
||||
<string name="btn_advanced_mode">Advanced Mode...</string>
|
||||
<string name="poi_filter_parking">Στάθμευση</string>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources><string name="use_fluorescent_overlays">Sovrapposizioni fluorescenti</string>
|
||||
<string name="use_fluorescent_overlays_descr">Usa colori fluorescenti per mostrare tracce e percorsi</string>
|
||||
<string name="offline_edition">Modifiche offline</string>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources><string name="live_monitoring_mode_off">Start Live tracking</string>
|
||||
<string name="live_monitoring_mode_on">Stop Live tracking</string>
|
||||
<string name="layer_map_appearance">Configureer scherm…</string>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources><string name="amenity_type_administrative">Administrativo</string>
|
||||
<string name="amenity_type_barrier">Barreira</string>
|
||||
<string name="amenity_type_education">Educação</string>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources><string name="download_link_and_local_description">Загрузите или обновите локальные данные. \nЧтобы получить дополнительную информацию о карте, выделите ее в списке. Удерживайте карту, если вы хотите удалить или деактивировать. \nДанные на устройстве (%1$s свободно):</string>
|
||||
<string name="unknown_from_location">Начальное местоположение еще не определено</string>
|
||||
<string name="unknown_location">Местоположение еще не определено</string>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources><string name="screen_is_locked">För att låsa upp skärmen trycker låsikon</string>
|
||||
<string name="map_widget_top_text">Gatunamn</string>
|
||||
<string name="map_widget_back_to_loc">Var är jag</string>
|
||||
|
@ -404,7 +404,7 @@ OsmAnd aktivt utvecklas och vårt projekt och dess fortsatta framsteg bygger på
|
|||
\n\t\Vrid inte (norr är uppåt)\'- Karta inte kommer att roteras. Norr kommer alltid upp
|
||||
\n\t\'Till rörelseriktning\' - Karta kommer kontinuerligt anpassas till din kurs
|
||||
\n\t\'Till kompass\' - Karta kommer kontinuerligt anpassas till enhetens kompass läsning</string>
|
||||
<string name="binary_map_download_success">Ladda framgångsrika.\n\t\n\tFör användning aktivera \'Meny\' -> \'Definiera Visa\' -> \'Karta källa...\' -> \ 'Offline vektorkartor\'.</string>
|
||||
<string name="binary_map_download_success">Ladda framgångsrika.\n\t\n\tFör användning aktivera \'Meny\' -> \'Definiera Visa\' -> \'Karta källa...\' -> \ \'Offline vektorkartor\'.</string>
|
||||
<string name="tip_day_night_mode">Dag/nattläge</string>
|
||||
<string name="tip_osm_improve">Förbättra OSM data</string>
|
||||
<string name="download_files_not_enough_space">Det finns inte tillräckligt med ledigt utrymme för att ladda ner %1$s MB (tillgängliga: %2$s).</string>
|
||||
|
@ -527,7 +527,7 @@ OsmAnd aktivt utvecklas och vårt projekt och dess fortsatta framsteg bygger på
|
|||
<string name="gpx_option_reverse_route">Omvänd GPX riktning</string>
|
||||
<string name="gpx_option_destination_point">Använd aktuell destination</string>
|
||||
<string name="gpx_option_from_start_point">Passera längs hela spåret</string>
|
||||
<string name="switch_to_vector_map_to_see">Offline vektor map närvarande för den här platsen. \n\t\n\tFör användning aktivera \'Meny\' -> \'Definiera utsikt\' -> \ 'Kartkälla...\' -> \'Offline vektorkartor\'.</string>
|
||||
<string name="switch_to_vector_map_to_see">Offline vektor map närvarande för den här platsen. \n\t\n\tFör användning aktivera \'Meny\' -> \'Definiera utsikt\' -> \ \'Kartkälla...\' -> \'Offline vektorkartor\'.</string>
|
||||
<string name="choose_audio_stream">Röstvägledning utgång</string>
|
||||
<string name="choose_audio_stream_descr">Välj kanal att spela röstvägledning (systemberoende)</string>
|
||||
<string name="voice_stream_voice_call">Röstsamtal ljud</string>
|
||||
|
|
|
@ -9,6 +9,26 @@
|
|||
1. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
|
||||
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
||||
-->
|
||||
<string name="tip_recent_changes_0_8_4_t">Changes in 0.8.4 :
|
||||
</string>
|
||||
<string name="tip_recent_changes_0_8_3_t">Changes in 0.8.3 :
|
||||
\n\t* Intermediate points
|
||||
\n\t* Improved route guidance
|
||||
\n\t* Avoid motorways option
|
||||
\n\t* Cycleway=track display
|
||||
\n\t* better UI finish (icons)
|
||||
\n\t* lots of bug fixes
|
||||
</string>
|
||||
|
||||
<string name="navigate_to">Set as destination</string>
|
||||
<string name="context_menu_item_last_intermediate_point">Set last target point</string>
|
||||
<string name="context_menu_item_first_intermediate_point">Set first target point</string>
|
||||
<string name="add_as_last_destination_point">Add as last intermedate point</string>
|
||||
<string name="add_as_first_destination_point">Add as first intermediate point</string>
|
||||
<string name="replace_destination_point">Replace destination point</string>
|
||||
<string name="new_destination_point_dialog">You already have destination point set.</string>
|
||||
<string name="target_point">Target point %1$s</string>
|
||||
<string name="target_points">Targets</string>
|
||||
<string name="intermediate_point_too_far">Intermediate point %1$s too far from nearest road.</string>
|
||||
<string name="arrived_at_intermediate_point">You have arrived at your intermediate point</string>
|
||||
<string name="context_menu_item_intermediate_point">Add intermediate point</string>
|
||||
|
@ -34,13 +54,6 @@
|
|||
<string name="avoid_motorway">Avoid motorways</string>
|
||||
<string name="auto_zoom_map_descr">Auto zoom map according to your speed (while map is synchronized with current position)</string>
|
||||
<string name="auto_zoom_map">Auto zoom map</string>
|
||||
<string name="tip_recent_changes_0_8_3_t">Changes in 0.8.3 :
|
||||
\n\t* Improved route guidance
|
||||
\n\t* Avoid motorways option
|
||||
\n\t* Cycleway=track display
|
||||
\n\t* better UI finish (icons)
|
||||
\n\t* Some bug fixes
|
||||
</string>
|
||||
<string name="snap_to_road_descr">Snap position to roads during navigation</string>
|
||||
<string name="snap_to_road">Snap to road</string>
|
||||
<string name="tip_recent_changes_0_8_2_t">Changes in 0.8.2 :
|
||||
|
@ -999,7 +1012,6 @@
|
|||
<string name="save_track_interval_descr">Choose positioning interval for tracks</string>
|
||||
<string name="save_track_to_gpx_descrp">Tracks will be saved to track directory grouped by days</string>
|
||||
<string name="save_track_to_gpx">Log track to GPX file</string>
|
||||
<string name="navigate_to">Set as destination</string>
|
||||
<string name="update_tile">Update map</string>
|
||||
<string name="reload_tile">Reload tile</string>
|
||||
<string name="mark_point">Target</string>
|
||||
|
|
|
@ -26,6 +26,7 @@ import net.osmand.plus.activities.search.SearchHistoryHelper;
|
|||
import net.osmand.plus.render.RendererRegistry;
|
||||
import net.osmand.plus.routing.RouteProvider.RouteService;
|
||||
import net.osmand.render.RenderingRulesStorage;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
|
@ -1012,7 +1013,7 @@ public class OsmandSettings {
|
|||
return list;
|
||||
}
|
||||
|
||||
public boolean setIntermediatePoint(double latitude, double longitude, String historyDescription, int index) {
|
||||
public boolean insertIntermediatePoint(double latitude, double longitude, String historyDescription, int index) {
|
||||
List<LatLon> ps = getIntermediatePoints();
|
||||
ps.add(index, new LatLon(latitude, longitude));
|
||||
if (historyDescription != null) {
|
||||
|
|
|
@ -14,7 +14,6 @@ import java.util.LinkedHashSet;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import net.londatiga.android.ActionItem;
|
||||
import net.londatiga.android.QuickAction;
|
||||
|
@ -38,8 +37,6 @@ import android.os.AsyncTask;
|
|||
import android.os.Bundle;
|
||||
import android.text.Spannable;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.ContextMenu.ContextMenuInfo;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
|
@ -51,7 +48,6 @@ import android.widget.AutoCompleteTextView;
|
|||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ExpandableListView;
|
||||
import android.widget.ExpandableListView.ExpandableListContextMenuInfo;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
@ -102,29 +98,6 @@ public class FavouritesActivity extends OsmandExpandableListActivity {
|
|||
favouritesAdapter.setFavoriteGroups(helper.getFavoriteGroups());
|
||||
getExpandableListView().setAdapter(favouritesAdapter);
|
||||
|
||||
/* Add Context-Menu listener to the ListView. */
|
||||
getExpandableListView().setOnCreateContextMenuListener(new View.OnCreateContextMenuListener(){
|
||||
|
||||
@Override
|
||||
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
|
||||
int child = ExpandableListView.getPackedPositionChild(((ExpandableListContextMenuInfo)menuInfo).packedPosition);
|
||||
int group = ExpandableListView.getPackedPositionGroup(((ExpandableListContextMenuInfo)menuInfo).packedPosition);
|
||||
if (child == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
menu.add(0, SHOW_ON_MAP, 0, R.string.show_poi_on_map);
|
||||
menu.add(0, NAVIGATE_TO, 1, R.string.favourites_context_menu_navigate);
|
||||
|
||||
final FavouritePoint point = (FavouritePoint) favouritesAdapter.getChild(group, child);
|
||||
if(point.isStored()){
|
||||
menu.add(0, EDIT_ITEM, 2, R.string.favourites_context_menu_edit);
|
||||
menu.add(0, DELETE_ITEM, 3, R.string.favourites_context_menu_delete);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
findViewById(R.id.CancelButton).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -276,29 +249,6 @@ public class FavouritesActivity extends OsmandExpandableListActivity {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onContextItemSelected(MenuItem aItem) {
|
||||
ContextMenuInfo menuInfo = aItem.getMenuInfo();
|
||||
int child = ExpandableListView.getPackedPositionChild(((ExpandableListContextMenuInfo)menuInfo).packedPosition);
|
||||
int group = ExpandableListView.getPackedPositionGroup(((ExpandableListContextMenuInfo)menuInfo).packedPosition);
|
||||
final FavouritePoint point = (FavouritePoint) favouritesAdapter.getChild(group, child);
|
||||
if (aItem.getItemId() == SHOW_ON_MAP) {
|
||||
OsmandSettings settings = getMyApplication().getSettings();
|
||||
settings.SHOW_FAVORITES.set(true);
|
||||
settings.setMapLocationToShow(point.getLatitude(), point.getLongitude(),
|
||||
Math.max(12, settings.getLastKnownMapZoom()), null, getString(R.string.favorite)+":\n " + point.getName(), point);
|
||||
MapActivity.launchMapActivityMoveToTop(this);
|
||||
} else if (aItem.getItemId() == NAVIGATE_TO) {
|
||||
getMyApplication().getSettings().setPointToNavigate(point.getLatitude(), point.getLongitude(), getString(R.string.favorite)+" : " + point.getName());
|
||||
MapActivity.launchMapActivityMoveToTop(this);
|
||||
} else if (aItem.getItemId() == EDIT_ITEM) {
|
||||
return editPoint(point);
|
||||
}
|
||||
if (aItem.getItemId() == DELETE_ITEM) {
|
||||
return deletePoint(point);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean editPoint(final FavouritePoint point) {
|
||||
Builder builder = new AlertDialog.Builder(this);
|
||||
|
|
|
@ -33,7 +33,6 @@ import net.osmand.plus.routing.RoutingHelper;
|
|||
import net.osmand.plus.views.AnimateDraggingMapThread;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
import net.osmand.plus.views.PointLocationLayer;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.AlertDialog.Builder;
|
||||
import android.app.Dialog;
|
||||
|
@ -41,6 +40,7 @@ import android.app.Notification;
|
|||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnCancelListener;
|
||||
import android.content.DialogInterface.OnDismissListener;
|
||||
|
@ -292,7 +292,7 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
|
|||
Object toShow = settings.getAndClearObjectToShow();
|
||||
if(settings.isRouteToPointNavigateAndClear()){
|
||||
// always enable and follow and let calculate it (GPS is not accessible in garage)
|
||||
mapActions.getDirections(getLastKnownLocation(), true);
|
||||
mapActions.getDirections(getLastKnownLocation(), false);
|
||||
}
|
||||
if(mapLabelToShow != null && latLonToShow != null){
|
||||
mapLayers.getContextMenuLayer().setSelectedObject(toShow);
|
||||
|
@ -934,14 +934,23 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
|
|||
}
|
||||
return zoomDelta;
|
||||
}
|
||||
|
||||
public void removeIntermediatePoint(boolean updateRoute, int index){
|
||||
mapLayers.getNavigationLayer().getIntermediatePoints().remove(index);
|
||||
settings.deleteIntermediatePoint(index);
|
||||
if(updateRoute && ( routingHelper.isRouteBeingCalculated() || routingHelper.isRouteCalculated() ||
|
||||
routingHelper.isFollowingMode())) {
|
||||
routingHelper.setFinalAndCurrentLocation(settings.getPointToNavigate(),
|
||||
settings.getIntermediatePoints(), getLastKnownLocation(), routingHelper.getCurrentGPXRoute());
|
||||
}
|
||||
}
|
||||
|
||||
public void navigateToPoint(LatLon point, boolean updateRoute, boolean intermediate){
|
||||
public void navigateToPoint(LatLon point, boolean updateRoute, int intermediate){
|
||||
if(point != null){
|
||||
if(!intermediate) {
|
||||
if(intermediate < 0) {
|
||||
settings.setPointToNavigate(point.getLatitude(), point.getLongitude(), null);
|
||||
} else {
|
||||
int sz = mapLayers.getNavigationLayer().getIntermediatePoints().size();
|
||||
settings.setIntermediatePoint(point.getLatitude(), point.getLongitude(), null, sz);
|
||||
settings.insertIntermediatePoint(point.getLatitude(), point.getLongitude(), null, intermediate);
|
||||
}
|
||||
} else {
|
||||
settings.clearPointToNavigate();
|
||||
|
@ -967,7 +976,7 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
|
|||
return mapLayers.getNavigationLayer().getPointToNavigate();
|
||||
}
|
||||
|
||||
public List<LatLon> getIntermediatePoitns(){
|
||||
public List<LatLon> getIntermediatePoints(){
|
||||
return mapLayers.getNavigationLayer().getIntermediatePoints();
|
||||
}
|
||||
|
||||
|
@ -1316,7 +1325,7 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
|
|||
public void onAccuracyChanged(Sensor sensor, int accuracy) {
|
||||
}
|
||||
|
||||
public static void launchMapActivityMoveToTop(Activity activity){
|
||||
public static void launchMapActivityMoveToTop(Context activity){
|
||||
Intent newIntent = new Intent(activity, OsmandIntents.getMapActivity());
|
||||
newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
activity.startActivity(newIntent);
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.osmand.AndroidUtils;
|
|||
import net.osmand.CallbackWithObject;
|
||||
import net.osmand.FavouritePoint;
|
||||
import net.osmand.GPXUtilities;
|
||||
import net.osmand.OsmAndFormatter;
|
||||
import net.osmand.GPXUtilities.GPXFile;
|
||||
import net.osmand.LogUtil;
|
||||
import net.osmand.Version;
|
||||
|
@ -38,6 +39,7 @@ import net.osmand.plus.ResourceManager;
|
|||
import net.osmand.plus.activities.search.SearchActivity;
|
||||
import net.osmand.plus.routing.RouteProvider.GPXRouteParams;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.views.AnimateDraggingMapThread;
|
||||
import net.osmand.plus.views.BaseMapLayer;
|
||||
import net.osmand.plus.views.MapTileLayer;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
|
@ -48,6 +50,7 @@ import android.app.Dialog;
|
|||
import android.app.ProgressDialog;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnMultiChoiceClickListener;
|
||||
import android.content.Intent;
|
||||
|
@ -74,6 +77,7 @@ import android.widget.AutoCompleteTextView;
|
|||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||
import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ListAdapter;
|
||||
|
@ -403,7 +407,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
}
|
||||
|
||||
|
||||
public void getDirections(final Location from, boolean followEnabled) {
|
||||
public void getDirections(final Location from, boolean gpxRouteEnabled) {
|
||||
|
||||
final RoutingHelper routingHelper = mapActivity.getRoutingHelper();
|
||||
|
||||
|
@ -474,7 +478,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
settings.FOLLOW_THE_GPX_ROUTE.set(null);
|
||||
routingHelper.setFollowingMode(false);
|
||||
routingHelper.setFinalAndCurrentLocation(mapActivity.getPointToNavigate(),
|
||||
mapActivity.getIntermediatePoitns(),from, null);
|
||||
mapActivity.getIntermediatePoints(),from, null);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -512,7 +516,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
settings.FOLLOW_THE_ROUTE.set(true);
|
||||
settings.FOLLOW_THE_GPX_ROUTE.set(null);
|
||||
routingHelper.setFollowingMode(true);
|
||||
routingHelper.setFinalAndCurrentLocation(mapActivity.getPointToNavigate(), mapActivity.getIntermediatePoitns(),
|
||||
routingHelper.setFinalAndCurrentLocation(mapActivity.getPointToNavigate(), mapActivity.getIntermediatePoints(),
|
||||
current, null);
|
||||
dialog.dismiss();
|
||||
getMyApplication().showDialogInitializingCommandPlayer(mapActivity);
|
||||
|
@ -529,13 +533,14 @@ public class MapActivityActions implements DialogProvider {
|
|||
|
||||
builder.setView(view);
|
||||
builder.setTitle(R.string.get_directions);
|
||||
if (followEnabled) {
|
||||
if (gpxRouteEnabled) {
|
||||
builder.setPositiveButton(R.string.follow, followCall);
|
||||
builder.setNeutralButton(R.string.gpx_navigation, useGpxNavigation);
|
||||
builder.setNegativeButton(R.string.only_show, onlyShowCall);
|
||||
} else {
|
||||
// view.findViewById(R.id.TextView).setVisibility(View.GONE);
|
||||
builder.setPositiveButton(R.string.show_gpx_route, onlyShowCall);
|
||||
builder.setPositiveButton(R.string.follow, followCall);
|
||||
builder.setNeutralButton(R.string.only_show, onlyShowCall);
|
||||
builder.setNegativeButton(R.string.default_buttons_cancel, null);
|
||||
}
|
||||
builder.show();
|
||||
|
@ -709,11 +714,20 @@ public class MapActivityActions implements DialogProvider {
|
|||
|
||||
adapter.registerItem(R.string.context_menu_item_navigate_point, R.drawable.list_view_set_destination);
|
||||
adapter.registerItem(R.string.context_menu_item_directions, R.drawable.list_activities_directions_to_here);
|
||||
if(settings.getPointToNavigate() != null) {
|
||||
if(mapActivity.getIntermediatePoints().size() == 0) {
|
||||
adapter.registerItem(R.string.context_menu_item_intermediate_point, R.drawable.list_view_set_intermediate);
|
||||
} else {
|
||||
adapter.registerItem(R.string.context_menu_item_first_intermediate_point, R.drawable.list_view_set_intermediate);
|
||||
adapter.registerItem(R.string.context_menu_item_last_intermediate_point, R.drawable.list_view_set_intermediate);
|
||||
}
|
||||
}
|
||||
adapter.registerItem(R.string.context_menu_item_show_route, R.drawable.list_view_show_route_from_here);
|
||||
adapter.registerItem(R.string.context_menu_item_search, R.drawable.list_view_search_near_here);
|
||||
adapter.registerItem(R.string.context_menu_item_share_location, R.drawable.list_view_share_location);
|
||||
adapter.registerItem(R.string.context_menu_item_add_favorite, R.drawable.list_activities_favorites);
|
||||
adapter.registerItem(R.string.context_menu_item_intermediate_point, R.drawable.list_view_set_intermediate);
|
||||
|
||||
|
||||
|
||||
OsmandPlugin.registerMapContextMenu(mapActivity, latitude, longitude, adapter, selectedObj);
|
||||
|
||||
|
@ -754,10 +768,10 @@ public class MapActivityActions implements DialogProvider {
|
|||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
mapActivity.startActivity(intent);
|
||||
} else if (standardId == R.string.context_menu_item_navigate_point) {
|
||||
mapActivity.navigateToPoint(new LatLon(latitude, longitude), true, false);
|
||||
mapActivity.navigateToPoint(new LatLon(latitude, longitude), true, -1);
|
||||
} else if (standardId == R.string.context_menu_item_directions) {
|
||||
Location loc = mapActivity.getLastKnownLocation();
|
||||
mapActivity.navigateToPoint(new LatLon(latitude, longitude), false, false);
|
||||
mapActivity.navigateToPoint(new LatLon(latitude, longitude), false, -1);
|
||||
// always enable and follow and let calculate it (GPS is not accessible in garage)
|
||||
getDirections(loc, true);
|
||||
} else if (standardId == R.string.context_menu_item_show_route) {
|
||||
|
@ -768,7 +782,11 @@ public class MapActivityActions implements DialogProvider {
|
|||
getDirections(loc, true);
|
||||
}
|
||||
} else if (standardId == R.string.context_menu_item_intermediate_point) {
|
||||
mapActivity.navigateToPoint(new LatLon(latitude, longitude), true, true);
|
||||
mapActivity.navigateToPoint(new LatLon(latitude, longitude), true, mapActivity.getIntermediatePoints().size());
|
||||
} else if (standardId == R.string.context_menu_item_first_intermediate_point) {
|
||||
mapActivity.navigateToPoint(new LatLon(latitude, longitude), true, 0);
|
||||
} else if (standardId == R.string.context_menu_item_last_intermediate_point) {
|
||||
mapActivity.navigateToPoint(new LatLon(latitude, longitude), true, mapActivity.getIntermediatePoints().size());
|
||||
} else if (standardId == R.string.context_menu_item_share_location) {
|
||||
shareLocation(latitude, longitude, mapActivity.getMapView().getZoom());
|
||||
} else if (standardId == R.string.context_menu_item_add_favorite) {
|
||||
|
@ -934,7 +952,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
mapActivity.updateApplicationModeSettings();
|
||||
mapView.refreshMap(changed);
|
||||
} else {
|
||||
mapActivity.navigateToPoint(null, true, false);
|
||||
mapActivity.navigateToPoint(null, true, -1);
|
||||
}
|
||||
mapView.refreshMap();
|
||||
return true;
|
||||
|
@ -997,6 +1015,17 @@ public class MapActivityActions implements DialogProvider {
|
|||
return true;
|
||||
}
|
||||
});
|
||||
optionsMenuHelper.registerOptionsMenuItem(R.string.target_points, R.string.target_points, new OnOptionsMenuClick() {
|
||||
@Override
|
||||
public void prepareOptionsMenu(Menu menu, MenuItem item) {
|
||||
item.setVisible(mapActivity.getIntermediatePoints().size() > 0);
|
||||
}
|
||||
@Override
|
||||
public boolean onClick(MenuItem item) {
|
||||
openIntermediatePointsDialog();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (Version.isGpsStatusEnabled(mapActivity) && !Version.isBlackberry(mapActivity)) {
|
||||
optionsMenuHelper.registerOptionsMenuItem(R.string.show_gps_status, R.string.show_gps_status,
|
||||
android.R.drawable.ic_menu_compass, new OnOptionsMenuClick() {
|
||||
|
@ -1034,6 +1063,88 @@ public class MapActivityActions implements DialogProvider {
|
|||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
return optionsMenuHelper.onClick(item);
|
||||
}
|
||||
|
||||
public void openIntermediatePointsDialog(){
|
||||
Builder builder = new AlertDialog.Builder(mapActivity);
|
||||
final ArrayList<LatLon> intermediates = new ArrayList<LatLon>(mapActivity.getIntermediatePoints());
|
||||
final int targetPointInd = mapActivity.getPointToNavigate() == null ? -1 : intermediates.size();
|
||||
if(mapActivity.getPointToNavigate() != null) {
|
||||
intermediates.add(mapActivity.getPointToNavigate());
|
||||
}
|
||||
final List<String> intermediateNames = new ArrayList<String>();
|
||||
double lat = mapActivity.getMapView().getLatitude();
|
||||
double lon = mapActivity.getMapView().getLongitude();
|
||||
for (int i = 0; i < intermediates.size(); i++) {
|
||||
double meters = MapUtils.getDistance(intermediates.get(i), lat, lon);
|
||||
intermediateNames.add((i+1)+". " +
|
||||
mapActivity.getString(R.string.target_point, OsmAndFormatter.getFormattedDistance((float) meters, mapActivity)));
|
||||
}
|
||||
final boolean[] checkedIntermediates = new boolean[intermediateNames.size()];
|
||||
ListAdapter listadapter = new ArrayAdapter<String>(mapActivity, R.layout.layers_list_activity_item, R.id.title,
|
||||
intermediateNames) {
|
||||
@Override
|
||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||
// User super class to create the View
|
||||
View v = super.getView(position, convertView, parent);
|
||||
TextView tv = (TextView) v.findViewById(R.id.title);
|
||||
tv.setText(intermediateNames.get(position));
|
||||
|
||||
checkedIntermediates[position] = true;
|
||||
if(position == targetPointInd) {
|
||||
tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.list_view_set_destination, 0, 0, 0);
|
||||
final CheckBox ch = ((CheckBox) v.findViewById(R.id.check_item));
|
||||
ch.setVisibility(View.GONE);
|
||||
} else {
|
||||
tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.list_view_set_intermediate, 0, 0, 0);
|
||||
final CheckBox ch = ((CheckBox) v.findViewById(R.id.check_item));
|
||||
ch.setVisibility(View.VISIBLE);
|
||||
ch.setChecked(true);
|
||||
ch.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
checkedIntermediates[position] = isChecked;
|
||||
}
|
||||
});
|
||||
}
|
||||
return v;
|
||||
}
|
||||
};
|
||||
builder.setAdapter(listadapter, new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
AnimateDraggingMapThread thread = mapActivity.getMapView().getAnimatedDraggingThread();
|
||||
LatLon pointToNavigate = intermediates.get(which);
|
||||
float fZoom = mapActivity.getMapView().getFloatZoom() < 15 ? 15 : mapActivity.getMapView().getFloatZoom();
|
||||
thread.startMoving(pointToNavigate.getLatitude(), pointToNavigate.getLongitude(), fZoom, true);
|
||||
}
|
||||
});
|
||||
builder.setPositiveButton(R.string.default_buttons_ok, new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
int cnt = 0;
|
||||
for (int i = checkedIntermediates.length - 1; i >= 0; i--) {
|
||||
if (!checkedIntermediates[i]) {
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
if (cnt > 0) {
|
||||
for (int i = checkedIntermediates.length - 1; i >= 0; i--) {
|
||||
if (!checkedIntermediates[i]) {
|
||||
cnt--;
|
||||
mapActivity.removeIntermediatePoint(cnt == 0, i);
|
||||
if (cnt == 0) {
|
||||
mapActivity.getMapView().refreshMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
builder.show();
|
||||
}
|
||||
|
||||
private void startGpsStatusIntent() {
|
||||
Intent intent = new Intent();
|
||||
|
@ -1065,31 +1176,30 @@ public class MapActivityActions implements DialogProvider {
|
|||
}
|
||||
}
|
||||
|
||||
private void whereAmIDialog() {
|
||||
final List<String> items = new ArrayList<String>();
|
||||
items.add(getString(R.string.show_location));
|
||||
items.add(getString(R.string.show_details));
|
||||
AlertDialog.Builder menu = new AlertDialog.Builder(mapActivity);
|
||||
menu.setItems(items.toArray(new String[items.size()]),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int item) {
|
||||
dialog.dismiss();
|
||||
switch (item) {
|
||||
case 0:
|
||||
mapActivity.backToLocationImpl();
|
||||
break;
|
||||
case 1:
|
||||
mapActivity.getNavigationInfo().show(settings.getPointToNavigate(), mapActivity.getMapLayers().
|
||||
getLocationLayer().getHeading());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
menu.show();
|
||||
}
|
||||
private void whereAmIDialog() {
|
||||
final List<String> items = new ArrayList<String>();
|
||||
items.add(getString(R.string.show_location));
|
||||
items.add(getString(R.string.show_details));
|
||||
AlertDialog.Builder menu = new AlertDialog.Builder(mapActivity);
|
||||
menu.setItems(items.toArray(new String[items.size()]), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int item) {
|
||||
dialog.dismiss();
|
||||
switch (item) {
|
||||
case 0:
|
||||
mapActivity.backToLocationImpl();
|
||||
break;
|
||||
case 1:
|
||||
mapActivity.getNavigationInfo().show(settings.getPointToNavigate(),
|
||||
mapActivity.getMapLayers().getLocationLayer().getHeading());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
menu.show();
|
||||
}
|
||||
|
||||
public static void createDirectionsActions(final QuickAction qa , final LatLon location, final Object obj, final String name, final int z, final Activity activity,
|
||||
final boolean saveHistory, final OnClickListener onShow){
|
||||
|
@ -1119,27 +1229,61 @@ public class MapActivityActions implements DialogProvider {
|
|||
if(onShow != null) {
|
||||
onShow.onClick(v);
|
||||
}
|
||||
app.getSettings().setPointToNavigate(location.getLatitude(), location.getLongitude(), name);
|
||||
MapActivity.launchMapActivityMoveToTop(activity);
|
||||
navigateToPoint(activity, location.getLatitude(), location.getLongitude(), name);
|
||||
// app.getSettings().setPointToNavigate(location.getLatitude(), location.getLongitude(), name);
|
||||
// MapActivity.launchMapActivityMoveToTop(activity);
|
||||
qa.dismiss();
|
||||
}
|
||||
});
|
||||
qa.addActionItem(setAsDestination);
|
||||
|
||||
ActionItem directionsTo = new ActionItem();
|
||||
directionsTo.setIcon(activity.getResources().getDrawable(R.drawable.list_activities_directions_to_here));
|
||||
directionsTo.setTitle(activity.getString(R.string.context_menu_item_directions));
|
||||
directionsTo.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(onShow != null) {
|
||||
onShow.onClick(v);
|
||||
}
|
||||
app.getSettings().setPointToNavigate(location.getLatitude(), location.getLongitude(), true, name);
|
||||
MapActivity.launchMapActivityMoveToTop(activity);
|
||||
qa.dismiss();
|
||||
}
|
||||
});
|
||||
qa.addActionItem(directionsTo);
|
||||
// ActionItem directionsTo = new ActionItem();
|
||||
// directionsTo.setIcon(activity.getResources().getDrawable(R.drawable.list_activities_directions_to_here));
|
||||
// directionsTo.setTitle(activity.getString(R.string.context_menu_item_directions));
|
||||
// directionsTo.setOnClickListener(new OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// if(onShow != null) {
|
||||
// onShow.onClick(v);
|
||||
// }
|
||||
// navigateToPoint(activity, location.getLatitude(), location.getLongitude(), name);
|
||||
// qa.dismiss();
|
||||
// }
|
||||
// });
|
||||
// qa.addActionItem(directionsTo);
|
||||
}
|
||||
|
||||
public static void navigateToPoint(final Context activity, final double lat, final double lon, final String name){
|
||||
final OsmandApplication app = ((OsmandApplication) activity.getApplicationContext());
|
||||
if(app.getSettings().getPointToNavigate() != null) {
|
||||
Builder builder = new AlertDialog.Builder(activity);
|
||||
builder.setTitle(R.string.new_destination_point_dialog);
|
||||
builder.setItems(new String[] {
|
||||
activity.getString(R.string.replace_destination_point),
|
||||
activity.getString(R.string.add_as_first_destination_point),
|
||||
activity.getString(R.string.add_as_last_destination_point)
|
||||
}, new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if(which == 0) {
|
||||
app.getSettings().setPointToNavigate(lat, lon, true, name);
|
||||
} else if(which == 2) {
|
||||
int sz = app.getSettings().getIntermediatePoints().size();
|
||||
app.getSettings().insertIntermediatePoint(lat, lon, name, sz);
|
||||
//LatLon pt = app.getSettings().getPointToNavigate();
|
||||
// app.getSettings().insertIntermediatePoint(pt.getLatitude(), pt.getLongitude(), null, sz);
|
||||
//app.getSettings().setPointToNavigate(lat, lon, true, name);
|
||||
} else {
|
||||
app.getSettings().insertIntermediatePoint(lat, lon, name, 0);
|
||||
}
|
||||
MapActivity.launchMapActivityMoveToTop(activity);
|
||||
}
|
||||
});
|
||||
builder.show();
|
||||
} else {
|
||||
app.getSettings().setPointToNavigate(lat, lon, true, name);
|
||||
MapActivity.launchMapActivityMoveToTop(activity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -256,7 +256,14 @@ public class NavigatePointActivity extends Activity implements SearchActivityChi
|
|||
double lon = convert(((TextView) findViewById(R.id.LongitudeEdit)).getText().toString());
|
||||
|
||||
if(navigate){
|
||||
settings.setPointToNavigate(lat, lon, getString(R.string.point_on_map, lat, lon));
|
||||
if(activity != null) {
|
||||
MapActivityActions.navigateToPoint(activity, lat, lon, getString(R.string.point_on_map, lat, lon));
|
||||
} else {
|
||||
MapActivityActions.navigateToPoint(this, lat, lon, getString(R.string.point_on_map, lat, lon));
|
||||
}
|
||||
if(dlg != null){
|
||||
dlg.dismiss();
|
||||
}
|
||||
} else {
|
||||
// in case when it is dialog
|
||||
if(activity != null) {
|
||||
|
@ -266,8 +273,9 @@ public class NavigatePointActivity extends Activity implements SearchActivityChi
|
|||
settings.setMapLocationToShow(lat, lon, Math.max(12, settings.getLastKnownMapZoom()),
|
||||
getString(R.string.point_on_map, lat, lon));
|
||||
}
|
||||
close();
|
||||
}
|
||||
close();
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
((TextView) findViewById(R.id.ValidateTextView)).setVisibility(View.VISIBLE);
|
||||
((TextView) findViewById(R.id.ValidateTextView)).setText(R.string.invalid_locations);
|
||||
|
|
|
@ -10,6 +10,7 @@ import net.osmand.plus.OsmandSettings;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.RegionAddressRepository;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.activities.MapActivityActions;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
@ -235,11 +236,12 @@ public class SearchAddressActivity extends Activity {
|
|||
finish();
|
||||
} else {
|
||||
if (navigateTo) {
|
||||
osmandSettings.setPointToNavigate(searchPoint.getLatitude(), searchPoint.getLongitude(), historyName);
|
||||
MapActivityActions.navigateToPoint(SearchAddressActivity.this, searchPoint.getLatitude(), searchPoint.getLongitude(), historyName);
|
||||
} else {
|
||||
osmandSettings.setMapLocationToShow(searchPoint.getLatitude(), searchPoint.getLongitude(), zoom, historyName);
|
||||
MapActivity.launchMapActivityMoveToTop(SearchAddressActivity.this);
|
||||
}
|
||||
MapActivity.launchMapActivityMoveToTop(SearchAddressActivity.this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -355,15 +355,20 @@ public class RouteInfoControls {
|
|||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
AnimateDraggingMapThread thread = view.getAnimatedDraggingThread();
|
||||
LatLon pointToNavigate = getPointToNavigate();
|
||||
if (pointToNavigate != null) {
|
||||
float fZoom = view.getFloatZoom() < 15 ? 15 : view.getFloatZoom();
|
||||
thread.startMoving(pointToNavigate.getLatitude(), pointToNavigate.getLongitude(), fZoom, true);
|
||||
}
|
||||
click(view);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void click(final OsmandMapTileView view) {
|
||||
AnimateDraggingMapThread thread = view.getAnimatedDraggingThread();
|
||||
LatLon pointToNavigate = getPointToNavigate();
|
||||
if (pointToNavigate != null) {
|
||||
float fZoom = view.getFloatZoom() < 15 ? 15 : view.getFloatZoom();
|
||||
thread.startMoving(pointToNavigate.getLatitude(), pointToNavigate.getLongitude(), fZoom, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateInfo() {
|
||||
int d = getDistance();
|
||||
|
@ -423,6 +428,16 @@ public class RouteInfoControls {
|
|||
final OsmandMapTileView view = map.getMapView();
|
||||
DistanceToPointInfoControl distanceControl = new DistanceToPointInfoControl(map, 0, paintText, paintSubText, map.getResources()
|
||||
.getDrawable(R.drawable.info_intermediate), view) {
|
||||
|
||||
@Override
|
||||
protected void click(OsmandMapTileView view) {
|
||||
if(map.getIntermediatePoints().size() > 1) {
|
||||
map.getMapActions().openIntermediatePointsDialog();
|
||||
} else {
|
||||
super.click(view);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LatLon getPointToNavigate() {
|
||||
return map.getFirstIntermediatePoint();
|
||||
|
|
|
@ -673,8 +673,12 @@ double polygonArea(MapDataObject* obj, float mult) {
|
|||
}
|
||||
|
||||
|
||||
bool sortByOrder(const MapDataObjectPrimitive& i,const MapDataObjectPrimitive& j) { return (i.order<j.order); }
|
||||
bool sortByRevOrder(const MapDataObjectPrimitive& i,const MapDataObjectPrimitive& j) { return (i.order>j.order); }
|
||||
bool sortByOrder(const MapDataObjectPrimitive& i,const MapDataObjectPrimitive& j) {
|
||||
if( i.order == j.order) return i.typeInd < j.typeInd;
|
||||
return (i.order<j.order); }
|
||||
bool sortPolygonsOrder(const MapDataObjectPrimitive& i,const MapDataObjectPrimitive& j) {
|
||||
if( i.order == j.order) return i.typeInd < j.typeInd;
|
||||
return (i.order>j.order); }
|
||||
|
||||
void sortObjectsByProperOrder(std::vector <MapDataObject* > mapDataObjects,
|
||||
RenderingRuleSearchRequest* req, RenderingContext* rc,
|
||||
|
@ -726,7 +730,7 @@ void sortObjectsByProperOrder(std::vector <MapDataObject* > mapDataObjects,
|
|||
|
||||
}
|
||||
}
|
||||
sort(polygonsArray.begin(), polygonsArray.end(), sortByRevOrder);
|
||||
sort(polygonsArray.begin(), polygonsArray.end(), sortPolygonsOrder);
|
||||
sort(pointsArray.begin(), pointsArray.end(), sortByOrder);
|
||||
sort(linesArray.begin(), linesArray.end(), sortByOrder);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue