From 615946301760716453aed34d7c908eb9a7d38a68 Mon Sep 17 00:00:00 2001
From: TacoTheDank
Date: Sat, 15 Aug 2020 19:17:02 -0400
Subject: [PATCH 1/5] Update grammar and links in multiple files
---
AUTHORS.md | 8 +++---
ISSUE_TEMPLATE.md | 28 +++++++++++--------
LICENSE | 70 ++++++++++++++++-------------------------------
README.md | 69 ++++++++++++++++++++++++++++++++++++----------
4 files changed, 99 insertions(+), 76 deletions(-)
diff --git a/AUTHORS.md b/AUTHORS.md
index c418f81d10..59f4e936c4 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -1,7 +1,7 @@
-### Credits to all major contributors/developers:
-Major contributors /developers listed here https://github.com/osmandapp/osmandapp.github.io/blob/master/website/help/about.html#L8
+### Credits to all major contributors / developers:
+Major contributors / developers listed here https://github.com/osmandapp/osmandapp.github.io/blob/master/website/help/about.html#L8
### Other Pull requests
-Copyright © All authors of translations and pull requests could be found in commits history:
+Copyright © All authors of translations and pull requests can be found in the commit history:
- Translations are under special “contributor” name ‘weblate’
- - Pull requests have two committers, first is original contributor and second is project maintainer
+ - Pull requests have two committers: first is original contributor, and second is project maintainer
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
index 8f5f620041..32940e1a27 100644
--- a/ISSUE_TEMPLATE.md
+++ b/ISSUE_TEMPLATE.md
@@ -1,26 +1,32 @@
Before entering an issue, please read the information below.
-```GitHub is a main development tool for developers. There are hundreds requests a month and there are only few developers. So by opening an issue, please know that your issue will be sent out to all developers and acknowledge that it could be closed without explanation or with a brief message. Comments on the closed issues are also sent to all developers, so you will definitely will be heard. However, there is no guarantee that a developer will pick up the issue to work on it.```
+```GitHub is our main development tool for our developers. There are hundreds of requests a month and there are relatively few developers.
+So by opening an issue, please know that your issue will be sent out to all developers and acknowledge that it could be closed without explanation or with just a brief message.
+Comments on the closed issues are also sent to all developers, so you will definitely will be heard.
+However, there is no guarantee that a developer will pick up the issue to work on it.```
-In case you are not sure to open issue or not, please send your request to support support@osmand.net. For **general questions** about OsmAnd, please use the [Google group](https://groups.google.com/forum/#!forum/osmand).
+In case you aren't sure whether to open an issue or not, please send your request to support@osmand.net.
+For **general questions** about OsmAnd, please use the [Google group](https://groups.google.com/forum/#!forum/osmand).
-Please be sure to have read our [FAQ](http://osmand.net/help-online) before creating an issue here. (Also, tell us in Google Groups when the FAQ is wrong or outdated.)
+Please be sure to read our [FAQ](https://osmand.net/help-online) before creating an issue here.
+(Also, tell us in Google Groups when the FAQ is wrong or outdated.)
-The best way to get help about an OsmAnd issue is to create a valid and detailed issue content.
+The best way to get help about an OsmAnd issue is to create a valid and detailed issue.
Please give us the following information so that we can try to **reproduce** your issue:
-What version of OsmAnd are you using, on what device and Android/iOS version?
+What version of OsmAnd are you using, and on what device and Android/iOS version?
-Do you use the offline maps offered within the OsmAnd app for download, or online (tile / raster) maps?
+Do you use the offline maps offered within the OsmAnd app for download, or the online (tile / raster) maps?
-If you have an issue related to offline maps, tell us the exact name of the map file where the issue occurs, and its edition date.
+If you have an issue related to offline maps, tell us the exact name of the map file where the issue occurs and its edition date.
__*In case of wrong routing:*__
-Tell us whether you have used OsmAnd's in-app offline routing, or any online routing provider like YOURS, OpenRouteService or OSRM.
+Tell us whether you have used OsmAnd's in-app offline routing or any online routing provider like YOURS, OpenRouteService, OSRM, etc.
-What routing profile is chosen in OsmAnd app? (car, bike, pedestrian, fastest or shortest)
+What routing profile is chosen in the OsmAnd app? (car, bike, pedestrian, fastest or shortest, etc.)
-Please specify as exactly as possible the start and end point of your route by telling us city name and street name so that we can find it via in-app address search easily. Also, a permalink from openstreetmap.org can be helpful.
+Please specify (as exact as possible) the start and end point of your route by telling us the city and street name so that we can find it via the in-app address search easily.
+Also, a permalink from [openstreetmap.org](https://www.openstreetmap.org/) can be helpful.
-Tell us your expected routing, and how OsmAnd routes, or add screenshots here.
+Tell us your expected routing and how OsmAnd routes, or add screenshots here.
diff --git a/LICENSE b/LICENSE
index d63b1a7204..5f96ead1b4 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,11 +1,11 @@
OsmAnd – OSM Automated Navigation Directions – navigation software based on OpenStreetMap.
- Copyright © 2010–2018 OsmAnd BV (Amstelveen, Netherlands - KvK 62066714, BTW 854627704B01).
+ Copyright © 2010–2020 OsmAnd BV (Amstelveen, Netherlands - KvK 62066714, BTW 854627704B01).
- The code in this repository is covered by *GPLv3* (for code) and the artwork is covered by [ CC-BY-NC-ND 4.0 ](https://creativecommons.org/licenses/by-nc-nd/4.0/) (for artwork), except some 3rd party libs and resources.
- ATTENTION: please be aware that some artwork has proprietary license.
+ The code in this repository is covered by *GPLv3* (for code) and the artwork is covered by [CC-BY-NC-ND 4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/) (for artwork), except for some third-party libraries and resources.
+ ATTENTION: Please be aware that some artwork uses a proprietary license.
- Main AUTHORS (more detailed list in AUTHORS):
+ Main AUTHORS (more detailed list in AUTHORS.md):
Victor Shcherb – all parts of the project, originator
Alexey Pelykh – rendering and core parts
Hardy Mueller – main parts of the project, mostly rendering, UI interaction design
@@ -30,33 +30,33 @@
* Source code in main repositories is covered by GPLv3 (license exceptions below):
- https://github.com/osmandapp/Osmand/tree/master/OsmAnd
- https://github.com/osmandapp/Osmand/tree/master/OsmAnd-java
- - https://github.com/osmandapp/Osmand-core/tree/legacy_core
- - https://github.com/osmandapp/Osmand-core/
+ - https://github.com/osmandapp/OsmAnd-core/tree/legacy_core
+ - https://github.com/osmandapp/OsmAnd-core
- https://github.com/osmandapp/OsmAnd-misc
- https://github.com/osmandapp/OsmAnd-tools
- https://github.com/osmandapp/OsmAnd-resources
- * UI Design and UX work, such as layout, icons is covered by CC-BY-NC-ND
+ * UI Design and UX work, such as layout and icons, are covered by [CC-BY-NC-ND 4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/)
- https://github.com/osmandapp/Osmand/tree/master/OsmAnd/res and others
Restriction to UI/UX CC-BY-NC-ND:
- * Publishing applications using the OsmAnd UI/UX code to Google Play, Amazon Market or Apple Store must be done with written permission*
+ * Publishing applications using the OsmAnd UI/UX code to Google Play, Amazon Market, or Apple Store must be done with written permission.*
* Map icons are taken from sjjb and some are drawn and distributed under Public Domain (except icons8)
- https://github.com/osmandapp/OsmAnd-resources/tree/master/icons/svg
- some icons are from http://osm-icons.org/wiki/Icons (CC-0 by Markus59, CC BY-SA 2.0)
- * Integration with Qt library in (https://github.com/osmandapp/Osmand-core/) - dynamic linking
- - LGPL (http://www.qt.io/qt-licensing-terms/)
+ * Integration with Qt library in (https://github.com/osmandapp/OsmAnd-core) - dynamic linking
+ - LGPL (https://www.qt.io/terms-conditions/)
- * Map icons and their derived primitives are covered by proprietary license:
+ * Map icons and their derived primitives are covered by a proprietary license:
- © icons8.com (https://github.com/osmandapp/OsmAnd-resources/tree/master/icons/svg/icons8)
- * Generated voice files from TTS files are covered by proprietary license:
+ * Generated voice files from TTS files are covered by a proprietary license:
- Voice files (https://github.com/osmandapp/OsmAnd-resources/tree/master/voice)
* Fonts (https://github.com/osmandapp/OsmAnd-resources/tree/master/rendering_styles/fonts)
- - Google Fonts (Apache License 2)
+ - Google Fonts (Apache License 2.0)
* Map icons (Mapnik):
- Open-SVG-Map-Icons - Public Domain
@@ -65,49 +65,27 @@
- SherlockBar - Apache License - https://github.com/osmandapp/Osmand/tree/master/SherlockBar (https://github.com/JakeWharton/ActionBarSherlock/blob/master/LICENSE.txt)
* Patched libraries:
- - Protobuf - New BSD License (patches - https://github.com/osmandapp/Osmand/tree/master/OsmAnd-java/protobuf-src, https://github.com/osmandapp/OsmAnd-core/tree/legacy_core/externals/protobuf)
- - Expat - (https://github.com/osmandapp/OsmAnd-core/tree/legacy_core/externals/expat)
- - Freetype - (https://github.com/osmandapp/OsmAnd-core/tree/legacy_core/externals/freetype)
- - Giflib - (https://github.com/osmandapp/OsmAnd-core/tree/legacy_core/externals/giflib)
+ - Protobuf - New BSD License (patches - https://github.com/osmandapp/Osmand/tree/master/OsmAnd-java/src/main/java/com/google/protobuf, https://github.com/osmandapp/OsmAnd-core/tree/legacy_core/externals/protobuf)
- Jpeg - (https://github.com/osmandapp/OsmAnd-core/tree/legacy_core/externals/jpeg)
- - Libpng - (https://github.com/osmandapp/OsmAnd-core/tree/legacy_core/externals/libpng)
- Skia - (https://github.com/osmandapp/OsmAnd-core/tree/legacy_core/externals/skia)
- - ZLib - (https://github.com/osmandapp/OsmAnd-core/tree/legacy_core/externals/zlib)
+ - android-openmap-framework - (https://github.com/osmandapp/Osmand/tree/master/OsmAnd-java/src/main/java/com/jwetherell/openmap/common)
+ - mapbox-vector-tile - (https://github.com/osmandapp/Osmand/tree/master/OsmAnd-java/src/main/java/com/wdtinc/mapbox_vector_tile)
* 3rd party libraries present in the libs folder (https://github.com/osmandapp/Osmand/tree/master/OsmAnd-java/libs):
- - bzip2-20090327.jar Bzip2 - Apache License
- - commons-logging-1.1.1.jar - Apache License
- gnu-trove-osmand.jar GNU trove - LGPL
- - icu4j-49_1.jar - ICU license (http://source.icu-project.org/repos/icu/icu/trunk/license.html)
- - json-20090211.jar - BSD alike (http://www.json.org/license.html)
- - junidecode-0.1.jar - BSD-4-Clause-UC (http://sourceforge.net/projects/junidecode/)
- - kxml2-2.3.0.jar - BSD license (http://www.kxml.org/)
- - tuprolog.jar - LGPL (http://apice.unibo.it/xwiki/bin/view/Tuprolog/)
- - OpenMap framework - Apache License (https://code.google.com/p/android-openmap-framework/)
+ - icu4j-49_1_patched.jar - ICU license (https://home.unicode.org/basic-info/projects/#/icu/icu/trunk/license.html)
* Pull-requests and translations:
- - All pull requests are accepted under MIT License (most honorable contributors are mentioned in AUTHORS list)
-
- * Libraries not used in final product (https://github.com/osmandapp/OsmAnd-tools/tree/master/OsmAndMapCreator/libi)
- - Ant libraries - (tools) https://github.com/osmandapp/Osmand/tree/master/OsmAnd/ant-lib
- - jleveldb-v01.jar
- - jsch-20120101.jar
- - junit-4.10.jar
- - mysql-connector-java-5.1.18-bin.jar
- - sqlite-jdbc-3.7.6.3-20110609.081603-3.jar
- - h2-latest.jar
+ - All pull requests are accepted under MIT License (most honorable contributors are mentioned in AUTHORS list).
* Special tools for new rendering (GPLv3)
- - https://github.com/osmandapp/OsmAnd-tools/tree/master/obf-inspector
- - https://github.com/osmandapp/OsmAnd-tools/tree/master/obf-verifier
- - https://github.com/osmandapp/OsmAnd-tools/tree/master/route-tester
+ - https://github.com/osmandapp/OsmAnd-tools
- * OSM data 2014
- - Extracts - https://github.com/osmandapp/OsmAnd-misc/blob/master/osm-planet/osm-data/
+ * OSM data
+ - Extracts - https://github.com/osmandapp/OsmAnd-misc/tree/master/osm-planet/osm-data
* Data files
- - Country boundaries - https://github.com/osmandapp/OsmAnd-misc/tree/master/osm-planet/geo-polygons © by Geofabrik - data free to use
- - Country boundaries - https://github.com/osmandapp/OsmAnd-misc/tree/master/osm-planet/gislab-polygons © by http://be.gis-lab.info - data free to use
+ - Country boundaries - https://github.com/osmandapp/OsmAnd-misc/tree/master/osm-planet/polygons © by Geofabrik - data free to use
* Subway icons
- Moscow: Art Lebedev Studio (http://www.artlebedev.ru/everything/metro/logo/) [Public domain], undefined
@@ -119,7 +97,7 @@
- Kazan: «Kazan-metro-Logo» (Россиянин) - own work. Under Public domain Commons license from the site - https://commons.wikimedia.org/wiki/File:Kazan-metro-Logo.svg#/media/File:Kazan-metro-Logo.svg
- Tbilisi: «Metro Tbilisi logo» (Carnby) - own work. Under CC BY-SA 3.0 license from site - https://commons.wikimedia.org/wiki/File:Metro_Tbilisi_logo.svg#/media/File:Metro_Tbilisi_logo.svg
- Minsk: «Minsk metro logo» (Skip405) - own work. Under Public domain Commons license from the site - https://commons.wikimedia.org/wiki/File:Minsk_metro_logo.svg#/media/File:Minsk_metro_logo.svg
- - Nizhny Novgorod: «NNMetro» (AlexTref871) - own work. This vector image includes elements borrowed from another image: Coat of arms of Nizhny Novgorod Region.svg.. Under Public domain Commons licensefrom the site - https://commons.wikimedia.org/wiki/File:NNMetro.svg#/media/File:NNMetro.svg
+ - Nizhny Novgorod: «NNMetro» (AlexTref871) - own work. This vector image includes elements borrowed from another image: Coat of arms of Nizhny Novgorod Region.svg.. Under Public domain Commons licensefrom the site - https://commons.wikimedia.org/wiki/File:NNMetro.svg#/media/File:NNMetro.svg
- Novosibirsk: «Logo-Nsk-Metro» (AlexTref871) - own work. Under Public domain Commons license from the site - https://commons.wikimedia.org/wiki/File:Logo-Nsk-Metro.svg#/media/File:Logo-Nsk-Metro.svg
- Yekaterinburg: «Ekt-metro-logo-01» (AlexTref871) - own work. Under CC BY-SA 4.0 license from site - https://commons.wikimedia.org/wiki/File:Ekt-metro-logo-01.svg#/media/File:Ekt-metro-logo-01.svg
- New York: «MTA New York City Subway logo» (Metropolitan Transportation Authority) - http://mta.info/. Under Public domain Commons license from the site - https://commons.wikimedia.org/wiki/File:MTA_New_York_City_Subway_logo.svg#/media/File:MTA_New_York_City_Subway_logo.svg
@@ -152,7 +130,7 @@
- Los Angeles: "Lametro" by Los Angeles County Metropolitan Transportation Authority. Original uploader was Cheeselouise at en.wikipedia - Metro materials at http://www.metro.net/riding_metro/pocket_guide_cambodian_printers.pdf. Licensed under Public Domain via Commons - https://commons.wikimedia.org/wiki/File:Lametro.svg#/media/File:Lametro.svg
* Depth maps
- - The GEBCO_2014 Grid, version 20150318, www.gebco.net
+ - The GEBCO_2020 Grid, www.gebco.net
- U.S. Bureau of Ocean Energy Management (24 may 2017,12m per pixel)
- South_Padre_Island_DEM_4133: Grothe, P.G., L.A. Taylor, B.W. Eakins, K.S. Carignan, D.Z. Friday, and M. Love, 2012. Digital Elevation Models of South Padre Island, Texas: Procedures, Data Sources and Analysis, NOAA National Geophysical Data Center technical report, Boulder, CO, 15 pp.
- Corpus_Christi_DEM_1035: Taylor, L.A., B.W. Eakins, K.S. Carignan, R.R. Warnken, T. Sazonova, and D.C. Schoolcraft, 2008. Digital Elevation Model of Corpus Christi, Texas: Procedures, Data Sources and Analysis, NOAA Technical Memorandum NESDIS NGDC-11, National Geophysical Data Center, Boulder, CO, 19 pp.
diff --git a/README.md b/README.md
index 825ff4602d..83dbde7b9a 100644
--- a/README.md
+++ b/README.md
@@ -5,16 +5,20 @@ To get started, continue with the basic description below, then find more detail
You are welcome to discuss any question regarding the project at the Google group OsmAnd. Please do not use comments on wiki pages because it is rather difficult to find them.
-
+
-
-
-
+
+
+
Functionality
-------------
-**OsmAnd (OSM Automated Navigation Directions)** is a map and navigation application with access to the free, worldwide, and high-quality OpenStreetMap (OSM) data. All map data can be stored on your device's memory card for offline use. Via your device's GPS, OsmAnd offers routing, with optical and voice guidance, for car, bike, and pedestrian. All the main functionalities work both online and offline (no internet needed).
+**OsmAnd (OSM Automated Navigation Directions)** is a map and navigation application with access to the free, worldwide, and high-quality OpenStreetMap (OSM) database.
+All map data can be stored on your device's memory card for offline use.
+Via your device's GPS, OsmAnd offers routing, with optical and voice guidance, for car, bike, and pedestrian usage.
+All main functionalities work both online and offline (no internet needed).
+
## Some of the main features:
@@ -40,7 +44,7 @@ Functionality
* High quality information from the world's best collaborative projects
* Global maps from OpenStreetMap, available per country or region
* Wikipedia POIs, great for sightseeing (not available in free version)
- * Unlimited free download, directly from the app (download limit 16 map files in free version)
+ * Unlimited free downloading, directly from the app (download limit is 16 map files in free version)
* Always up-to-date maps (updated at least once a month)
* Compact offline vector maps
* Select between complete map data and just road network (Example: All of Japan is 700 MB, or 200 MB for the road network only)
@@ -53,23 +57,29 @@ Functionality
* Share your location so that your friends can find you
#### Bicycle and Pedestrian Features
- * The maps include foot, hiking, and bike paths, great for outdoor activities
- * Special routing and display modes for bike and pedestrian
- * Optional public transport stops (bus, tram, train) including line names
+ * The maps include foot, hiking, and bike paths (great for outdoor activities)
+ * Special routing and display modes for bike and pedestrian usage
+ * Optional public transport stops (bus, tram, train), including line names
* Optional trip recording to local GPX file or online service
* Optional speed and altitude display
- * Display of contour lines and hill-shading (via additional plugin)
+ * Display of contour lines and hill-shading (via additional paid plugin)
#### Directly Contribute to OpenStreetMap
* Report map bugs
* Upload GPX tracks to OSM directly from the app
* Add POIs and directly upload them to OSM (or later if offline)
- * Optional trip recording also in background mode (while device is in sleep mode)
-
-OsmAnd is open source and actively being developed. Everyone can contribute to the application by reporting bugs, [improving translations](https://hosted.weblate.org/projects/osmand/), or coding new features. The project is in a lively selected of continuous improvement by all these forms of developer and user interaction. The project progress also relies on financial contributions to fund the development, coding, and testing of new functionality. By buying OsmAnd+ and subscribing to OsmAnd Live you help the application to be even more awesome! It is also possible to make a general donation, see http://osmand.net/help-online#buy_app.
+ * Optional trip recording in background mode (while device is in sleep mode)
-#### Approximate map coverage and quality:
+OsmAnd is open-source and actively being developed.
+Everyone can contribute to the application by reporting bugs, [improving translations](https://hosted.weblate.org/projects/osmand/), or coding new features.
+The project experiences continuous improvement by all such forms of developer and user interaction.
+The project progress also relies on financial contributions to fund the development, coding, and testing of new functionality.
+By buying OsmAnd+ and subscribing to OsmAnd Live, you help the application become even more awesome!
+It is also possible to make a general donation (see https://osmand.net/help-online#buy_app).
+
+
+#### Approximate map coverage and quality:
| Region | |
|----------------|------|
| Western Europe | ++++ |
@@ -84,5 +94,34 @@ OsmAnd is open source and actively being developed. Everyone can contribute to t
| Antarctica | + |
##### List of countries supported
-Basically world wide: Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, Bolivia, Bonaire, Bosnia and Herzegovina, Botswana, Brazil, British Virgin Islands, Brunei, Bulgaria, Burkina Faso, Burundi, Cambodia, Cameroon, Canada, Cape Verde, Central African Republic, Chad, Chile, China, Colombia, Comoros, Congo, Costa Rica, Croatia, Cuba, Curaçao, Cyprus, Czechia, Denmark, Djibouti, Dominica, Dominican Republic, Ecuador, Egypt, El Salvador, Equatorial Guinea, Eritrea, Estonia, Ethiopia, Fiji, Finland, France, French Guiana, French Polynesia, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, Guinea-Bissau, Guyana, Haiti, Vatican, Honduras, Hong Kong, Hungary, Iceland, India, Indonesia, Iran, Iraq, Ireland, Isle of Man, Israel, Italy, Ivory Coast, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, North Korea and South Korea, Kuwait, Kyrgyzstan, Laos, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, Macedonia, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, Martinique, Mauritania, Mauritius, Mayotte, Mexico, Micronesia, Moldova, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, Netherlands Antilles, New Caledonia, New Zealand, Nicaragua, Niger, Nigeria, Norway, Oman, Pakistan, Palau, Palestinian Territory, Panama, Papua New Guinea, Paraguay, Peru, Philippines, Poland, Portugal, Puerto Rico, Qatar, Romania, Russia, Rwanda, Saint Barthelemy, Saint Helena, Saint Kitts and Nevis, Saint Lucia, Saint Martin, Saint Pierre and Miquelon, Saint Vincent and the Grenadines, Samoa, San Marino, Saudi Arabia, Senegal, Serbia, Seychelles, Sierra Leone, Singapore, Slovakia, Slovenia, Somalia, South Africa, South Georgia, South Sudan, Spain, Sri Lanka, Sudan, Suriname, Swaziland, Sweden, Switzerland, Syria, Taiwan, Tajikistan, Tanzania, Thailand, Timor-Leste, Togo, Tokelau, Tonga, Trinidad and Tobago, Tunisia, Turkey, Turkmenistan, Tuvalu, Uganda, Ukraine, United Arab Emirates, United Kingdom (UK), United States of America (USA), Uruguay, Uzbekistan, Vanuatu, Venezuela, Vietnam, Wallis and Futuna, Western Sahara, Yemen, Zambia, Zimbabwe.
+Basically world wide: Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla,
+Antigua and Barbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan,
+Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda,
+Bhutan, Bolivia, Bonaire, Bosnia and Herzegovina, Botswana, Brazil,
+British Virgin Islands, Brunei, Bulgaria, Burkina Faso, Burundi, Cambodia, Cameroon,
+Canada, Cape Verde, Central African Republic, Chad, Chile, China, Colombia, Comoros,
+Congo, Costa Rica, Croatia, Cuba, Curaçao, Cyprus, Czechia, Denmark, Djibouti, Dominica,
+Dominican Republic, Ecuador, Egypt, El Salvador, Equatorial Guinea, Eritrea, Estonia,
+Ethiopia, Fiji, Finland, France, French Guiana, French Polynesia, Gabon, Gambia,
+Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam,
+Guatemala, Guernsey, Guinea, Guinea-Bissau, Guyana, Haiti, Vatican, Honduras, Hong Kong,
+Hungary, Iceland, India, Indonesia, Iran, Iraq, Ireland, Isle of Man, Israel, Italy,
+Ivory Coast, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati,
+North Korea and South Korea, Kuwait, Kyrgyzstan, Laos, Latvia, Lebanon, Lesotho,
+Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, Macedonia, Madagascar,
+Malawi, Malaysia, Maldives, Mali, Malta, Martinique, Mauritania, Mauritius, Mayotte,
+Mexico, Micronesia, Moldova, Monaco, Mongolia, Montenegro, Montserrat, Morocco,
+Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, Netherlands Antilles,
+New Caledonia, New Zealand, Nicaragua, Niger, Nigeria, Norway, Oman, Pakistan, Palau,
+Palestinian Territory, Panama, Papua New Guinea, Paraguay, Peru, Philippines, Poland,
+Portugal, Puerto Rico, Qatar, Romania, Russia, Rwanda, Saint Barthelemy, Saint Helena,
+Saint Kitts and Nevis, Saint Lucia, Saint Martin, Saint Pierre and Miquelon,
+Saint Vincent and the Grenadines, Samoa, San Marino, Saudi Arabia, Senegal, Serbia,
+Seychelles, Sierra Leone, Singapore, Slovakia, Slovenia, Somalia, South Africa,
+South Georgia, South Sudan, Spain, Sri Lanka, Sudan, Suriname, Swaziland, Sweden,
+Switzerland, Syria, Taiwan, Tajikistan, Tanzania, Thailand, Timor-Leste, Togo,
+Tokelau, Tonga, Trinidad and Tobago, Tunisia, Turkey, Turkmenistan, Tuvalu, Uganda,
+Ukraine, United Arab Emirates, United Kingdom (UK), United States of America (USA),
+Uruguay, Uzbekistan, Vanuatu, Venezuela, Vietnam, Wallis and Futuna, Western Sahara,
+Yemen, Zambia, Zimbabwe.
From 598a16e71b96e10effb6473ed57e920d1112c438 Mon Sep 17 00:00:00 2001
From: serg
Date: Mon, 17 Aug 2020 16:00:28 +0300
Subject: [PATCH 2/5] Fix #9582
---
.../ParkingTypeBottomSheetDialogFragment.java | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingTypeBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingTypeBottomSheetDialogFragment.java
index ae819b460c..616a51cd23 100644
--- a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingTypeBottomSheetDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingTypeBottomSheetDialogFragment.java
@@ -63,20 +63,21 @@ public class ParkingTypeBottomSheetDialogFragment extends MenuBottomSheetDialogF
if (plugin.isParkingEventAdded()) {
plugin.showDeleteEventWarning(mapActivity);
}
+
if (limited) {
plugin.setParkingPosition(latitude, longitude, true);
- plugin.showSetTimeLimitDialog(mapActivity, new Dialog(getContext()));
- mapActivity.refreshMap();
+ plugin.showSetTimeLimitDialog(mapActivity, new Dialog(mapActivity));
} else {
plugin.addOrRemoveParkingEvent(false);
plugin.setParkingPosition(latitude, longitude, false);
- plugin.showContextMenuIfNeeded(mapActivity, true);
-
- mapActivity.refreshMap();
}
+ mapActivity.refreshMap();
mapActivity.getMyApplication().getFavorites().setSpecialPoint(
plugin.getParkingPosition(), SpecialPointType.PARKING, null);
+ if (!limited) {
+ plugin.showContextMenuIfNeeded(mapActivity, true);
+ }
+ dismiss();
}
- dismiss();
}
}
From 4406b60c6d0efe72f97914388007cddca8706311 Mon Sep 17 00:00:00 2001
From: Guillaume Gonnet
Date: Mon, 17 Aug 2020 18:35:12 +0200
Subject: [PATCH 3/5] Allow custom "user-agent" for tile download
---
.../main/java/net/osmand/map/ITileSource.java | 2 ++
.../java/net/osmand/map/MapTileDownloader.java | 3 ++-
.../java/net/osmand/map/TileSourceManager.java | 18 ++++++++++++++++++
.../src/net/osmand/plus/SQLiteTileSource.java | 15 ++++++++++++++-
.../plus/resources/AsyncLoadingThread.java | 3 ++-
.../net/osmand/plus/resources/TilesCache.java | 2 +-
.../plus/settings/backend/SettingsHelper.java | 5 ++++-
7 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/OsmAnd-java/src/main/java/net/osmand/map/ITileSource.java b/OsmAnd-java/src/main/java/net/osmand/map/ITileSource.java
index 38ba3493e1..7c643bbf5b 100644
--- a/OsmAnd-java/src/main/java/net/osmand/map/ITileSource.java
+++ b/OsmAnd-java/src/main/java/net/osmand/map/ITileSource.java
@@ -32,6 +32,8 @@ public interface ITileSource {
public String getReferer();
+ public String getUserAgent();
+
public void deleteTiles(String path);
public int getAvgSize();
diff --git a/OsmAnd-java/src/main/java/net/osmand/map/MapTileDownloader.java b/OsmAnd-java/src/main/java/net/osmand/map/MapTileDownloader.java
index 058942f494..c6e99519b4 100644
--- a/OsmAnd-java/src/main/java/net/osmand/map/MapTileDownloader.java
+++ b/OsmAnd-java/src/main/java/net/osmand/map/MapTileDownloader.java
@@ -90,6 +90,7 @@ public class MapTileDownloader {
public final int yTile;
public String url;
public String referer = null;
+ public String userAgent = null;
public boolean error;
public DownloadRequest(String url, File fileToSave, int xTile, int yTile, int zoom) {
@@ -266,7 +267,7 @@ public class MapTileDownloader {
request.setError(false);
try {
URLConnection connection = NetworkUtils.getHttpURLConnection(request.url);
- connection.setRequestProperty("User-Agent", USER_AGENT); //$NON-NLS-1$
+ connection.setRequestProperty("User-Agent", Algorithms.isEmpty(request.userAgent) ? USER_AGENT : request.userAgent); //$NON-NLS-1$
if (request.referer != null)
connection.setRequestProperty("Referer", request.referer); //$NON-NLS-1$
connection.setConnectTimeout(CONNECTION_TIMEOUT);
diff --git a/OsmAnd-java/src/main/java/net/osmand/map/TileSourceManager.java b/OsmAnd-java/src/main/java/net/osmand/map/TileSourceManager.java
index e093fc6d0c..9885aa2fbf 100644
--- a/OsmAnd-java/src/main/java/net/osmand/map/TileSourceManager.java
+++ b/OsmAnd-java/src/main/java/net/osmand/map/TileSourceManager.java
@@ -68,6 +68,7 @@ public class TileSourceManager {
private String[] randomsArray;
private String rule;
private String referer;
+ private String userAgent;
private boolean hidden; // if hidden in configure map settings, for example mapillary sources
private boolean isRuleAcceptable = true;
@@ -261,6 +262,14 @@ public class TileSourceManager {
this.referer = referer;
}
+ public String getUserAgent() {
+ return userAgent;
+ }
+
+ public void setUserAgent(String userAgent) {
+ this.userAgent = userAgent;
+ }
+
@Override
public int getTileSize() {
return tileSize;
@@ -484,6 +493,9 @@ public class TileSourceManager {
if (!Algorithms.isEmpty(tm.getReferer())) {
properties.put("referer", tm.getReferer());
}
+ if (!Algorithms.isEmpty(tm.getUserAgent())) {
+ properties.put("user_agent", tm.getUserAgent());
+ }
properties.put("ext", tm.getTileFormat());
properties.put("min_zoom", tm.getMinimumZoomSupported() + "");
@@ -708,6 +720,12 @@ public class TileSourceManager {
}
String randoms = attributes.get("randoms");
TileSourceTemplate templ = new TileSourceTemplate(name, urlTemplate, ext, maxZoom, minZoom, tileSize, bitDensity, avgTileSize);
+ if (attributes.get("referer") != null) {
+ templ.setReferer(attributes.get("referer"));
+ }
+ if (attributes.get("user_agent") != null) {
+ templ.setUserAgent(attributes.get("user_agent"));
+ }
if(expirationTime >= 0) {
templ.setExpirationTimeMinutes(expirationTime);
}
diff --git a/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java b/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java
index 4ef77d76c7..b3d7ceb144 100644
--- a/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java
+++ b/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java
@@ -39,6 +39,7 @@ public class SQLiteTileSource implements ITileSource {
private static final String ELLIPSOID = "ellipsoid";
private static final String INVERTED_Y = "inverted_y";
private static final String REFERER = "referer";
+ private static final String USER_AGENT = "useragent";
private static final String TIME_COLUMN = "timecolumn";
private static final String EXPIRE_MINUTES = "expireminutes";
private static final String RULE = "rule";
@@ -62,6 +63,7 @@ public class SQLiteTileSource implements ITileSource {
private String[] randomsArray;
private String rule = null;
private String referer = null;
+ private String userAgent = null;
int tileSize = 256;
boolean tileSizeSpecified = false;
@@ -93,7 +95,7 @@ public class SQLiteTileSource implements ITileSource {
}
public SQLiteTileSource(OsmandApplication ctx, String name, int minZoom, int maxZoom, String urlTemplate,
- String randoms, boolean isEllipsoid, boolean invertedY, String referer,
+ String randoms, boolean isEllipsoid, boolean invertedY, String referer, String userAgent,
boolean timeSupported, long expirationTimeMillis, boolean inversiveZoom, String rule) {
this.ctx = ctx;
this.name = name;
@@ -104,6 +106,7 @@ public class SQLiteTileSource implements ITileSource {
this.expirationTimeMillis = expirationTimeMillis;
this.randoms = randoms;
this.referer = referer;
+ this.userAgent = userAgent;
this.rule = rule;
this.invertedY = invertedY;
this.timeSupported = timeSupported;
@@ -120,6 +123,7 @@ public class SQLiteTileSource implements ITileSource {
this.expirationTimeMillis = tileSource.getExpirationTimeMillis();
this.randoms = tileSource.getRandoms();
this.referer = tileSource.getReferer();
+ this.userAgent = tileSource.getUserAgent();
this.invertedY = tileSource.isInvertedYTile();
this.timeSupported = tileSource.isTimeSupported();
this.inversiveZoom = tileSource.getInversiveZoom();
@@ -139,6 +143,7 @@ public class SQLiteTileSource implements ITileSource {
addInfoColumn(db, ELLIPSOID, isEllipsoid ? "1" : "0");
addInfoColumn(db, INVERTED_Y, invertedY ? "1" : "0");
addInfoColumn(db, REFERER, referer);
+ addInfoColumn(db, USER_AGENT, userAgent);
addInfoColumn(db, TIME_COLUMN, timeSupported ? "yes" : "no");
addInfoColumn(db, EXPIRE_MINUTES, String.valueOf(getExpirationTimeMinutes()));
@@ -264,6 +269,10 @@ public class SQLiteTileSource implements ITileSource {
if(refererId != -1) {
referer = cursor.getString(refererId);
}
+ int userAgentId = list.indexOf(USER_AGENT);
+ if(userAgentId != -1) {
+ userAgent = cursor.getString(userAgentId);
+ }
int tnumbering = list.indexOf(TILENUMBERING);
if(tnumbering != -1) {
inversiveZoom = BIG_PLANET_TILE_NUMBERING.equalsIgnoreCase(cursor.getString(tnumbering));
@@ -673,4 +682,8 @@ public class SQLiteTileSource implements ITileSource {
return referer;
}
+ public String getUserAgent() {
+ return userAgent;
+ }
+
}
diff --git a/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java b/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java
index 27559ee966..59f62e30b5 100644
--- a/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java
+++ b/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java
@@ -105,12 +105,13 @@ public class AsyncLoadingThread extends Thread {
}
public TileLoadDownloadRequest(File dirWithTiles, String url, File fileToSave, String tileId, ITileSource source, int tileX,
- int tileY, int zoom, String referer) {
+ int tileY, int zoom, String referer, String userAgent) {
super(url, fileToSave, tileX, tileY, zoom);
this.dirWithTiles = dirWithTiles;
this.tileSource = source;
this.tileId = tileId;
this.referer = referer;
+ this.userAgent = userAgent;
}
public void saveTile(InputStream inputStream) throws IOException {
diff --git a/OsmAnd/src/net/osmand/plus/resources/TilesCache.java b/OsmAnd/src/net/osmand/plus/resources/TilesCache.java
index 4548e1e42c..ce8ae27c18 100644
--- a/OsmAnd/src/net/osmand/plus/resources/TilesCache.java
+++ b/OsmAnd/src/net/osmand/plus/resources/TilesCache.java
@@ -144,7 +144,7 @@ public abstract class TilesCache {
}
}
TileLoadDownloadRequest req = new TileLoadDownloadRequest(dirWithTiles, url, toSave,
- tileId, map, x, y, zoom, map.getReferer());
+ tileId, map, x, y, zoom, map.getReferer(), map.getUserAgent());
if (sync) {
return getRequestedTile(req);
} else {
diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/SettingsHelper.java b/OsmAnd/src/net/osmand/plus/settings/backend/SettingsHelper.java
index 35ba432b9f..ed18b4f695 100644
--- a/OsmAnd/src/net/osmand/plus/settings/backend/SettingsHelper.java
+++ b/OsmAnd/src/net/osmand/plus/settings/backend/SettingsHelper.java
@@ -2035,6 +2035,7 @@ public class SettingsHelper {
boolean ellipsoid = object.optBoolean("ellipsoid", false);
boolean invertedY = object.optBoolean("inverted_y", false);
String referer = object.optString("referer");
+ String userAgent = object.optString("userAgent");
boolean timeSupported = object.optBoolean("timesupported", false);
long expire = object.optLong("expire", -1);
boolean inversiveZoom = object.optBoolean("inversiveZoom", false);
@@ -2054,13 +2055,14 @@ public class SettingsHelper {
tileSourceTemplate.setRule(rule);
tileSourceTemplate.setRandoms(randoms);
tileSourceTemplate.setReferer(referer);
+ tileSourceTemplate.setUserAgent(userAgent);
tileSourceTemplate.setEllipticYTile(ellipsoid);
tileSourceTemplate.setInvertedYTile(invertedY);
tileSourceTemplate.setExpirationTimeMillis(timeSupported ? expire : -1);
template = tileSourceTemplate;
} else {
- template = new SQLiteTileSource(app, name, minZoom, maxZoom, url, randoms, ellipsoid, invertedY, referer, timeSupported, expire, inversiveZoom, rule);
+ template = new SQLiteTileSource(app, name, minZoom, maxZoom, url, randoms, ellipsoid, invertedY, referer, userAgent, timeSupported, expire, inversiveZoom, rule);
}
items.add(template);
}
@@ -2087,6 +2089,7 @@ public class SettingsHelper {
jsonObject.put("ellipsoid", template.isEllipticYTile());
jsonObject.put("inverted_y", template.isInvertedYTile());
jsonObject.put("referer", template.getReferer());
+ jsonObject.put("userAgent", template.getUserAgent());
jsonObject.put("timesupported", template.isTimeSupported());
jsonObject.put("expire", template.getExpirationTimeMinutes());
jsonObject.put("inversiveZoom", template.getInversiveZoom());
From 9621534b1852ffae71b8ea15b1ff53643831a751 Mon Sep 17 00:00:00 2001
From: max-klaus
Date: Mon, 17 Aug 2020 21:42:16 +0300
Subject: [PATCH 4/5] Refactor plan route
---
.../MeasurementEditingContext.java | 130 +++++++++++++-----
.../MeasurementToolFragment.java | 88 ++++++------
.../measurementtool/MeasurementToolLayer.java | 8 +-
.../command/AddPointCommand.java | 2 +-
.../command/ApplyGpxApproximationCommand.java | 6 +-
.../command/ChangeRouteModeCommand.java | 8 +-
.../plus/settings/backend/OsmandSettings.java | 1 +
7 files changed, 146 insertions(+), 97 deletions(-)
diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java
index 7e20ffb186..d83ce40f1b 100644
--- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java
+++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java
@@ -17,6 +17,7 @@ import net.osmand.plus.routing.RouteCalculationResult;
import net.osmand.plus.routing.RoutingHelper;
import net.osmand.plus.settings.backend.ApplicationMode;
import net.osmand.router.RouteCalculationProgress;
+import net.osmand.router.RouteImporter;
import net.osmand.router.RoutePlannerFrontEnd.GpxPoint;
import net.osmand.router.RoutePlannerFrontEnd.GpxRouteApproximation;
import net.osmand.router.RouteSegmentResult;
@@ -25,20 +26,20 @@ import net.osmand.util.MapUtils;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
-import static net.osmand.plus.measurementtool.MeasurementEditingContext.CalculationMode.*;
+import static net.osmand.plus.measurementtool.MeasurementEditingContext.CalculationMode.NEXT_SEGMENT;
+import static net.osmand.plus.measurementtool.MeasurementEditingContext.CalculationMode.WHOLE_TRACK;
public class MeasurementEditingContext {
- public enum CalculationMode {
- NEXT_SEGMENT,
- WHOLE_TRACK
- }
+ public final static ApplicationMode DEFAULT_APP_MODE = ApplicationMode.DEFAULT;
private OsmandApplication application;
private final MeasurementCommandManager commandManager = new MeasurementCommandManager();
@@ -54,15 +55,55 @@ public class MeasurementEditingContext {
private WptPt originalPointToMove;
private boolean inAddPointMode;
- private boolean inSnapToRoadMode;
private boolean needUpdateCacheForSnap;
private int calculatedPairs;
private CalculationMode calculationMode = WHOLE_TRACK;
private SnapToRoadProgressListener progressListener;
- private ApplicationMode snapToRoadAppMode;
+ private ApplicationMode appMode = DEFAULT_APP_MODE;
private RouteCalculationProgress calculationProgress;
private final Queue> snapToRoadPairsToCalculate = new ConcurrentLinkedQueue<>();
- private final Map, List> snappedToRoadPoints = new ConcurrentHashMap<>();
+ private final Map, RoadSegmentData> roadSegmentData = new ConcurrentHashMap<>();
+
+ public enum CalculationMode {
+ NEXT_SEGMENT,
+ WHOLE_TRACK
+ }
+
+ public static class RoadSegmentData {
+ private ApplicationMode appMode;
+ private WptPt start;
+ private WptPt end;
+ private List snappedToRoadPoints = new ArrayList<>();
+ private List snappedToRoadSegments = new ArrayList<>();
+
+ public RoadSegmentData(ApplicationMode appMode, WptPt start, WptPt end, List snappedToRoadPoints, List snappedToRoadSegments) {
+ this.appMode = appMode;
+ this.start = start;
+ this.end = end;
+ this.snappedToRoadPoints = snappedToRoadPoints;
+ this.snappedToRoadSegments = snappedToRoadSegments;
+ }
+
+ public ApplicationMode getAppMode() {
+ return appMode;
+ }
+
+ public WptPt getStart() {
+ return start;
+ }
+
+ public WptPt getEnd() {
+ return end;
+ }
+
+ public List getSnappedToRoadPoints() {
+ return Collections.unmodifiableList(snappedToRoadPoints);
+ }
+
+ public List getSnappedToRoadSegments() {
+ return Collections.unmodifiableList(snappedToRoadSegments);
+ }
+ }
public void setApplication(OsmandApplication application) {
this.application = application;
@@ -76,10 +117,6 @@ public class MeasurementEditingContext {
return inAddPointMode;
}
- boolean isInSnapToRoadMode() {
- return inSnapToRoadMode;
- }
-
public boolean isNeedUpdateCacheForSnap() {
return needUpdateCacheForSnap;
}
@@ -109,8 +146,8 @@ public class MeasurementEditingContext {
this.inAddPointMode = inAddPointMode;
}
- public void setInSnapToRoadMode(boolean inSnapToRoadMode) {
- this.inSnapToRoadMode = inSnapToRoadMode;
+ boolean isInSnapToRoadMode() {
+ return appMode != DEFAULT_APP_MODE;
}
NewGpxData getNewGpxData() {
@@ -141,19 +178,23 @@ public class MeasurementEditingContext {
this.progressListener = progressListener;
}
- public ApplicationMode getSnapToRoadAppMode() {
- return snapToRoadAppMode;
+ @NonNull
+ public ApplicationMode getAppMode() {
+ return appMode;
}
- public void setSnapToRoadAppMode(ApplicationMode snapToRoadAppMode) {
- this.snapToRoadAppMode = snapToRoadAppMode;
+ public void setAppMode(@NonNull ApplicationMode appMode) {
+ this.appMode = appMode;
+ }
+
+ public void resetAppMode() {
+ this.appMode = DEFAULT_APP_MODE;
}
public void clearSnappedToRoadPoints() {
- snappedToRoadPoints.clear();
+ roadSegmentData.clear();
}
-
TrkSegment getBeforeTrkSegmentLine() {
if (beforeCacheForSnap != null) {
return beforeCacheForSnap;
@@ -224,7 +265,7 @@ public class MeasurementEditingContext {
public void clearSegments() {
before.points.clear();
after.points.clear();
- if (inSnapToRoadMode) {
+ if (isInSnapToRoadMode()) {
if (beforeCacheForSnap != null && afterCacheForSnap != null) {
beforeCacheForSnap.points.clear();
afterCacheForSnap.points.clear();
@@ -263,7 +304,7 @@ public class MeasurementEditingContext {
for (List points : pointsList) {
for (int i = 0; i < points.size() - 1; i++) {
Pair pair = new Pair<>(points.get(i), points.get(i + 1));
- if (snappedToRoadPoints.get(pair) == null) {
+ if (roadSegmentData.get(pair) == null) {
snapToRoadPairsToCalculate.add(pair);
}
}
@@ -274,11 +315,12 @@ public class MeasurementEditingContext {
if (original.points.size() > 1) {
for (int i = 0; i < original.points.size() - 1; i++) {
Pair pair = new Pair<>(original.points.get(i), original.points.get(i + 1));
- List pts = snappedToRoadPoints.get(pair);
+ RoadSegmentData data = this.roadSegmentData.get(pair);
+ List pts = data != null ? data.getSnappedToRoadPoints() : null;
if (pts != null) {
cache.points.addAll(pts);
} else {
- if (inSnapToRoadMode) {
+ if (isInSnapToRoadMode()) {
scheduleRouteCalculateIfNotEmpty();
}
cache.points.addAll(Arrays.asList(pair.first, pair.second));
@@ -296,6 +338,8 @@ public class MeasurementEditingContext {
}
List points = newGpxData.getTrkSegment().points;
if (isTrackSnappedToRoad()) {
+ RouteImporter routeImporter = new RouteImporter(newGpxData.getGpxFile());
+ List segments = routeImporter.importRoute();
List routePoints = newGpxData.getGpxFile().getRoutePoints();
int prevPointIndex = 0;
for (int i = 0; i < routePoints.size() - 1; i++) {
@@ -309,12 +353,20 @@ public class MeasurementEditingContext {
endIndex = findPointIndex(pair.second, points, startIndex);
}
if (startIndex >= 0 && endIndex >= 0) {
- List cacheSegment = new ArrayList<>();
+ List segmentPoints = new ArrayList<>();
for (int j = startIndex; j < endIndex && j < points.size(); j++) {
- cacheSegment.add(points.get(j));
+ segmentPoints.add(points.get(j));
prevPointIndex = j;
}
- snappedToRoadPoints.put(pair, cacheSegment);
+ Iterator it = segments.iterator();
+ int k = endIndex - startIndex;
+ while (it.hasNext() && k >= 0) {
+ RouteSegmentResult s = it.next();
+ it.remove();
+ k -= Math.abs(s.getEndPointIndex() - s.getStartPointIndex());
+ }
+ ApplicationMode appMode = ApplicationMode.valueOfStringKey(pair.first.getProfileType(), DEFAULT_APP_MODE);
+ roadSegmentData.put(pair, new RoadSegmentData(appMode, pair.first, pair.second, segmentPoints, segments));
}
}
addPoints(routePoints);
@@ -327,7 +379,7 @@ public class MeasurementEditingContext {
if (gpxApproximation == null || Algorithms.isEmpty(gpxApproximation.finalPoints) || Algorithms.isEmpty(gpxApproximation.result)) {
return;
}
- snappedToRoadPoints.clear();
+ roadSegmentData.clear();
List routePoints = new ArrayList<>();
List gpxPoints = gpxApproximation.finalPoints;
for (int i = 0; i < gpxPoints.size() - 1; i++) {
@@ -344,15 +396,17 @@ public class MeasurementEditingContext {
p2.lon = rp2.loc.getLongitude();
routePoints.add(p2);
Pair pair = new Pair<>(p1, p2);
- List cacheSegment = new ArrayList<>();
+ List points = new ArrayList<>();
+ List segments = new ArrayList<>();
for (RouteSegmentResult seg : rp1.routeToTarget) {
+ segments.add(seg);
if (seg.isForwardDirection()) {
for (int ik = seg.getStartPointIndex(); ik <= seg.getEndPointIndex(); ik++) {
LatLon l = seg.getPoint(ik);
WptPt pt = new WptPt();
pt.lat = l.getLatitude();
pt.lon = l.getLongitude();
- cacheSegment.add(pt);
+ points.add(pt);
}
} else {
for (int ik = seg.getEndPointIndex(); ik >= seg.getStartPointIndex(); ik--) {
@@ -360,11 +414,11 @@ public class MeasurementEditingContext {
WptPt pt = new WptPt();
pt.lat = l.getLatitude();
pt.lon = l.getLongitude();
- cacheSegment.add(pt);
+ points.add(pt);
}
}
}
- snappedToRoadPoints.put(pair, cacheSegment);
+ roadSegmentData.put(pair, new RoadSegmentData(appMode, pair.first, pair.second, points, segments));
}
addPoints(routePoints);
}
@@ -386,7 +440,7 @@ public class MeasurementEditingContext {
NewGpxData newGpxData = getNewGpxData();
return newGpxData != null && newGpxData.getTrkSegment() != null
&& !newGpxData.getTrkSegment().points.isEmpty()
- && !newGpxData.getGpxFile().getRoutePoints().isEmpty();
+ && newGpxData.getGpxFile().hasRoute();
}
private void updateCacheForSnapIfNeeded(boolean both) {
@@ -427,7 +481,7 @@ public class MeasurementEditingContext {
currentPointSnapToRoadMode = ApplicationMode.valueOfStringKey(currentPair.first.getProfileType(),
null);
} else {
- currentPointSnapToRoadMode = snapToRoadAppMode;
+ currentPointSnapToRoadMode = appMode;
}
params.end = end;
if (currentPointSnapToRoadMode == null) {
@@ -484,7 +538,7 @@ public class MeasurementEditingContext {
pts.add(pt);
}
calculatedPairs++;
- snappedToRoadPoints.put(currentPair, pts);
+ roadSegmentData.put(currentPair, new RoadSegmentData(route.getAppMode(), currentPair.first, currentPair.second, pts, route.getOriginalRoute()));
int trkptIndex = currentPair.first.getTrkPtIndex();
trkptIndex += pts.size() - 1;
currentPair.second.setTrkPtIndex(trkptIndex);
@@ -563,13 +617,13 @@ public class MeasurementEditingContext {
params.start = start;
params.end = end;
params.intermediates = intermediates;
- if (snapToRoadAppMode == null) {
+ if (appMode == null) {
ApplicationMode straightLine = ApplicationMode.AIRCRAFT;
RoutingHelper.applyApplicationSettings(params, application.getSettings(), straightLine);
params.mode = straightLine;
} else {
- RoutingHelper.applyApplicationSettings(params, application.getSettings(), snapToRoadAppMode);
- params.mode = snapToRoadAppMode;
+ RoutingHelper.applyApplicationSettings(params, application.getSettings(), appMode);
+ params.mode = appMode;
}
params.ctx = application;
params.calculationProgress = calculationProgress = new RouteCalculationProgress();
diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java
index bcb25abe53..91938e89a1 100644
--- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java
+++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java
@@ -15,6 +15,7 @@ import android.text.TextWatcher;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
+import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageButton;
@@ -243,14 +244,14 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
upDownBtn = (ImageView) mainView.findViewById(R.id.up_down_button);
upDownBtn.setImageDrawable(upIcon);
- mainView.findViewById(R.id.cancel_move_point_button).setOnClickListener(new View.OnClickListener() {
+ mainView.findViewById(R.id.cancel_move_point_button).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
cancelMovePointMode();
}
});
- mainView.findViewById(R.id.cancel_point_before_after_button).setOnClickListener(new View.OnClickListener() {
+ mainView.findViewById(R.id.cancel_point_before_after_button).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
cancelAddPointBeforeOrAfterMode();
@@ -258,7 +259,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
});
upDownRow = mainView.findViewById(R.id.up_down_row);
- upDownRow.setOnClickListener(new View.OnClickListener() {
+ upDownRow.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if (!pointsListOpened && editingCtx.getPointsCount() > 0 && editingCtx.getSelectedPointPosition() == -1) {
@@ -269,37 +270,35 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
}
});
- mainView.findViewById(R.id.apply_move_point_button).setOnClickListener(new View.OnClickListener() {
+ mainView.findViewById(R.id.apply_move_point_button).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
applyMovePointMode();
}
});
- mainView.findViewById(R.id.apply_point_before_after_point_button).setOnClickListener(new View.OnClickListener() {
+ mainView.findViewById(R.id.apply_point_before_after_point_button).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
applyAddPointBeforeAfterMode();
}
});
- mainView.findViewById(R.id.add_point_before_after_button).setOnClickListener(new View.OnClickListener() {
+ mainView.findViewById(R.id.add_point_before_after_button).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
addPointBeforeAfter();
}
});
- mainView.findViewById(R.id.options_button).setOnClickListener(new View.OnClickListener() {
+ mainView.findViewById(R.id.options_button).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
OptionsBottomSheetDialogFragment.showInstance(mapActivity.getSupportFragmentManager(),
MeasurementToolFragment.this,
editingCtx.isTrackSnappedToRoad() || editingCtx.isNewData(),
editingCtx.isInSnapToRoadMode(),
- editingCtx.getSnapToRoadAppMode() != null
- ? editingCtx.getSnapToRoadAppMode().getStringKey()
- : null
+ editingCtx.getAppMode().getStringKey()
);
}
});
@@ -309,7 +308,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
Drawable undoDrawable = getActiveIcon(R.drawable.ic_action_undo_dark);
undoBtn.setImageDrawable(AndroidUtils.getDrawableForDirection(mapActivity, undoDrawable));
- undoBtn.setOnClickListener(new View.OnClickListener() {
+ undoBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
editingCtx.getCommandManager().undo();
@@ -321,7 +320,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
Drawable redoDrawable = getActiveIcon(R.drawable.ic_action_redo_dark);
redoBtn.setImageDrawable(AndroidUtils.getDrawableForDirection(mapActivity, redoDrawable));
- redoBtn.setOnClickListener(new View.OnClickListener() {
+ redoBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
editingCtx.getCommandManager().redo();
@@ -331,7 +330,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
}
});
- mainView.findViewById(R.id.add_point_button).setOnClickListener(new View.OnClickListener() {
+ mainView.findViewById(R.id.add_point_button).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
addCenterPoint();
@@ -407,13 +406,13 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
} else {
toolBarController.setTitle(getString(R.string.plan_route));
}
- toolBarController.setOnBackButtonClickListener(new View.OnClickListener() {
+ toolBarController.setOnBackButtonClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
quit(false);
}
});
- toolBarController.setOnSaveViewClickListener(new View.OnClickListener() {
+ toolBarController.setOnSaveViewClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (editingCtx.getPointsCount() > 0) {
@@ -451,7 +450,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
ImageButton snapToRoadBtn = (ImageButton) mapActivity.findViewById(R.id.snap_to_road_image_button);
snapToRoadBtn.setBackgroundResource(nightMode ? R.drawable.btn_circle_night : R.drawable.btn_circle);
- snapToRoadBtn.setOnClickListener(new View.OnClickListener() {
+ snapToRoadBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
startSnapToRoad(false);
@@ -486,12 +485,12 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
updateSnapToRoadControls();
if (newGpxData != null && !gpxPointsAdded) {
List points = newGpxData.getGpxFile().getRoutePoints();
- ApplicationMode snapToRoadAppMode = null;
if (!points.isEmpty()) {
- snapToRoadAppMode = ApplicationMode
- .valueOfStringKey(points.get(points.size() - 1).getProfileType(), null);
+ ApplicationMode snapToRoadAppMode = ApplicationMode.valueOfStringKey(points.get(points.size() - 1).getProfileType(), null);
+ if (snapToRoadAppMode != null) {
+ setSnapToRoadMode(snapToRoadAppMode);
+ }
}
- enableSnapToRoadMode(snapToRoadAppMode);
ActionType actionType = newGpxData.getActionType();
if (actionType == ActionType.ADD_ROUTE_POINTS) {
displayRoutePoints();
@@ -608,7 +607,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
if (editingCtx.isNewData() || editingCtx.hasRoutePoints() || editingCtx.isInSnapToRoadMode()) {
RouteBetweenPointsBottomSheetDialogFragment.showInstance(mapActivity.getSupportFragmentManager(),
this, editingCtx.getCalculationMode(),
- editingCtx.getSnapToRoadAppMode());
+ editingCtx.getAppMode());
} else {
SnapTrackWarningBottomSheet.showInstance(mapActivity.getSupportFragmentManager(), this);
}
@@ -985,19 +984,32 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
};
}
- private void enableSnapToRoadMode(ApplicationMode appMode) {
- editingCtx.setSnapToRoadAppMode(appMode);
- editingCtx.setInSnapToRoadMode(true);
+ private void setSnapToRoadMode(@NonNull ApplicationMode appMode) {
+ editingCtx.setAppMode(appMode);
editingCtx.scheduleRouteCalculateIfNotEmpty();
updateSnapToRoadControls();
}
+ private void resetSnapToRoadMode() {
+ toolBarController.setTopBarSwitchVisible(false);
+ toolBarController.setTitle(previousToolBarTitle);
+ mainIcon.setImageDrawable(getActiveIcon(R.drawable.ic_action_ruler));
+ editingCtx.resetAppMode();
+ editingCtx.cancelSnapToRoad();
+ visibleSnapToRoadIcon(false);
+ MapActivity mapActivity = getMapActivity();
+ if (mapActivity != null) {
+ mainView.findViewById(R.id.snap_to_road_progress_bar).setVisibility(View.GONE);
+ mapActivity.refreshMap();
+ }
+ }
+
private void updateSnapToRoadControls() {
final MapActivity mapActivity = getMapActivity();
- final ApplicationMode appMode = editingCtx.getSnapToRoadAppMode();
+ final ApplicationMode appMode = editingCtx.getAppMode();
if (mapActivity != null) {
Drawable icon;
- if (appMode == null) {
+ if (appMode == MeasurementEditingContext.DEFAULT_APP_MODE) {
icon = getActiveIcon(R.drawable.ic_action_split_interval);
} else {
icon = getIcon(appMode.getIconRes(), appMode.getIconColorInfo().getColor(nightMode));
@@ -1008,20 +1020,6 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
}
}
- private void disableSnapToRoadMode() {
- toolBarController.setTopBarSwitchVisible(false);
- toolBarController.setTitle(previousToolBarTitle);
- mainIcon.setImageDrawable(getActiveIcon(R.drawable.ic_action_ruler));
- editingCtx.setInSnapToRoadMode(false);
- editingCtx.cancelSnapToRoad();
- visibleSnapToRoadIcon(false);
- MapActivity mapActivity = getMapActivity();
- if (mapActivity != null) {
- mainView.findViewById(R.id.snap_to_road_progress_bar).setVisibility(View.GONE);
- mapActivity.refreshMap();
- }
- }
-
private void visibleSnapToRoadIcon(boolean show) {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
@@ -1085,8 +1083,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
MeasurementToolLayer measurementLayer = getMeasurementLayer();
if (measurementLayer != null) {
WptPt newPoint = measurementLayer.getMovedPointToApply();
- ApplicationMode applicationMode = editingCtx.getSnapToRoadAppMode();
- if (applicationMode != null) {
+ ApplicationMode applicationMode = editingCtx.getAppMode();
+ if (applicationMode != MeasurementEditingContext.DEFAULT_APP_MODE) {
newPoint.setProfileType(applicationMode.getStringKey());
}
WptPt oldPoint = editingCtx.getOriginalPointToMove();
@@ -1356,7 +1354,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
final View buttonView = view.findViewById(R.id.button_view);
final SwitchCompat showOnMapToggle = (SwitchCompat) view.findViewById(R.id.toggle_show_on_map);
UiUtilities.setupCompoundButton(showOnMapToggle, nightMode, UiUtilities.CompoundButtonType.GLOBAL);
- buttonView.setOnClickListener(new View.OnClickListener() {
+ buttonView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
showOnMapToggle.setChecked(!showOnMapToggle.isChecked());
@@ -1615,7 +1613,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
snackbar = Snackbar.make(mapActivity.getLayout(),
MessageFormat.format(getString(R.string.gpx_saved_sucessfully), toSave.getName()),
Snackbar.LENGTH_LONG)
- .setAction(R.string.shared_string_rename, new View.OnClickListener() {
+ .setAction(R.string.shared_string_rename, new OnClickListener() {
@Override
public void onClick(View view) {
MapActivity mapActivity = mapActivityRef.get();
@@ -1783,7 +1781,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
hidePointsList();
}
if (editingCtx.isInSnapToRoadMode()) {
- disableSnapToRoadMode();
+ resetSnapToRoadMode();
} else {
visibleSnapToRoadIcon(false);
}
diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java
index 3533da5ea4..2114383db3 100644
--- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java
+++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java
@@ -324,8 +324,8 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
boolean allowed = editingCtx.getPointsCount() == 0 || !editingCtx.getPoints().get(editingCtx.getPointsCount() - 1).equals(pt);
if (allowed) {
- ApplicationMode applicationMode = editingCtx.getSnapToRoadAppMode();
- if (applicationMode != null) {
+ ApplicationMode applicationMode = editingCtx.getAppMode();
+ if (applicationMode != MeasurementEditingContext.DEFAULT_APP_MODE) {
pt.setProfileType(applicationMode.getStringKey());
}
editingCtx.addPoint(pt);
@@ -344,8 +344,8 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
pressedPointLatLon = null;
boolean allowed = editingCtx.getPointsCount() == 0 || !editingCtx.getPoints().get(editingCtx.getPointsCount() - 1).equals(pt);
if (allowed) {
- ApplicationMode applicationMode = editingCtx.getSnapToRoadAppMode();
- if (applicationMode != null) {
+ ApplicationMode applicationMode = editingCtx.getAppMode();
+ if (applicationMode != MeasurementEditingContext.DEFAULT_APP_MODE) {
pt.setProfileType(applicationMode.getStringKey());
}
editingCtx.addPoint(pt);
diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/command/AddPointCommand.java b/OsmAnd/src/net/osmand/plus/measurementtool/command/AddPointCommand.java
index 57bb6bbb0b..9c9c2182e7 100644
--- a/OsmAnd/src/net/osmand/plus/measurementtool/command/AddPointCommand.java
+++ b/OsmAnd/src/net/osmand/plus/measurementtool/command/AddPointCommand.java
@@ -25,7 +25,7 @@ public class AddPointCommand extends MeasurementModeCommand {
point = new WptPt();
point.lat = latLon.getLatitude();
point.lon = latLon.getLongitude();
- point.setProfileType(measurementLayer.getEditingCtx().getSnapToRoadAppMode().getStringKey());
+ point.setProfileType(measurementLayer.getEditingCtx().getAppMode().getStringKey());
}
this.center = center;
position = measurementLayer.getEditingCtx().getPointsCount();
diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/command/ApplyGpxApproximationCommand.java b/OsmAnd/src/net/osmand/plus/measurementtool/command/ApplyGpxApproximationCommand.java
index d05060ed0a..38a17d7fe4 100644
--- a/OsmAnd/src/net/osmand/plus/measurementtool/command/ApplyGpxApproximationCommand.java
+++ b/OsmAnd/src/net/osmand/plus/measurementtool/command/ApplyGpxApproximationCommand.java
@@ -52,9 +52,8 @@ public class ApplyGpxApproximationCommand extends MeasurementModeCommand {
@Override
public void undo() {
- getEditingCtx().setInSnapToRoadMode(false);
+ getEditingCtx().resetAppMode();
getEditingCtx().clearSegments();
- getEditingCtx().setSnapToRoadAppMode(null);
getEditingCtx().addPoints(points);
if (needUpdateCache) {
getEditingCtx().setNeedUpdateCacheForSnap(true);
@@ -69,9 +68,8 @@ public class ApplyGpxApproximationCommand extends MeasurementModeCommand {
}
public void applyApproximation() {
- getEditingCtx().setInSnapToRoadMode(true);
+ getEditingCtx().setAppMode(mode);
getEditingCtx().clearSegments();
- getEditingCtx().setSnapToRoadAppMode(mode);
getEditingCtx().setPoints(approximation);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/command/ChangeRouteModeCommand.java b/OsmAnd/src/net/osmand/plus/measurementtool/command/ChangeRouteModeCommand.java
index 064c3bf103..d69360e585 100644
--- a/OsmAnd/src/net/osmand/plus/measurementtool/command/ChangeRouteModeCommand.java
+++ b/OsmAnd/src/net/osmand/plus/measurementtool/command/ChangeRouteModeCommand.java
@@ -25,7 +25,7 @@ public class ChangeRouteModeCommand extends MeasurementModeCommand {
this.newMode = newMode;
this.newCalculationMode = newCalculationMode;
MeasurementEditingContext editingCtx = getEditingCtx();
- oldMode = editingCtx.getSnapToRoadAppMode();
+ oldMode = editingCtx.getAppMode();
oldCalculationMode = editingCtx.getCalculationMode();
}
@@ -43,12 +43,11 @@ public class ChangeRouteModeCommand extends MeasurementModeCommand {
MeasurementEditingContext editingCtx = getEditingCtx();
editingCtx.getPoints().clear();
editingCtx.addPoints(points);
- editingCtx.setSnapToRoadAppMode(oldMode);
+ editingCtx.setAppMode(oldMode);
if (newCalculationMode == CalculationMode.WHOLE_TRACK) {
editingCtx.clearSnappedToRoadPoints();
}
editingCtx.setCalculationMode(oldCalculationMode);
- editingCtx.setInSnapToRoadMode(true);
editingCtx.setNeedUpdateCacheForSnap(true);
}
@@ -71,9 +70,8 @@ public class ChangeRouteModeCommand extends MeasurementModeCommand {
points.get(pointIdx).removeProfileType();
}
}
- editingCtx.setInSnapToRoadMode(true);
editingCtx.setCalculationMode(newCalculationMode);
- editingCtx.setSnapToRoadAppMode(newMode);
+ editingCtx.setAppMode(newMode);
if (newCalculationMode == CalculationMode.WHOLE_TRACK) {
editingCtx.clearSnappedToRoadPoints();
}
diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java
index 51a0325c45..289e2c62f3 100644
--- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java
+++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java
@@ -1845,6 +1845,7 @@ public class OsmandSettings {
public final CommonPreference ROUTE_SERVICE = new EnumStringPreference<>("route_service", RouteService.OSMAND, RouteService.values()).makeProfile().cache();
{
+ ROUTE_SERVICE.setModeDefaultValue(ApplicationMode.DEFAULT, RouteService.STRAIGHT);
ROUTE_SERVICE.setModeDefaultValue(ApplicationMode.AIRCRAFT, RouteService.STRAIGHT);
}
From c42838463247738da5f23e492ef9105919cb9428 Mon Sep 17 00:00:00 2001
From: Victor Shcherb
Date: Tue, 18 Aug 2020 00:10:57 +0200
Subject: [PATCH 5/5] Fix compilation
---
.../net/osmand/plus/mapsource/EditMapSourceDialogFragment.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OsmAnd/src/net/osmand/plus/mapsource/EditMapSourceDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapsource/EditMapSourceDialogFragment.java
index 0b710f9f25..fcd6f86bb2 100644
--- a/OsmAnd/src/net/osmand/plus/mapsource/EditMapSourceDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapsource/EditMapSourceDialogFragment.java
@@ -392,7 +392,7 @@ public class EditMapSourceDialogFragment extends BaseOsmAndDialogFragment
SQLiteTileSource sqLiteTileSource =
new SQLiteTileSource(app, newName, minZoom,
maxZoom, urlToLoad, "",
- elliptic, false, "", expireTimeMinutes > 0,
+ elliptic, false, "", "", expireTimeMinutes > 0,
expireTimeMinutes * 60 * 1000L, false, ""
);
sqLiteTileSource.createDataBase();