mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-29 17:23:47 +00:00
Compare commits
20 Commits
dark_bg
...
test/2025.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96bf6e1ec1 | ||
|
|
f477d9bb49 | ||
|
|
9ec67097fc | ||
|
|
c0bdbe1bcb | ||
|
|
006951a33c | ||
|
|
bea2148f66 | ||
|
|
9729ab9cab | ||
|
|
d448369c04 | ||
|
|
ee4675b388 | ||
|
|
515cf98cef | ||
|
|
0d01076c0f | ||
|
|
5f0bcc1486 | ||
|
|
1edcb23ab2 | ||
|
|
817b31bc5f | ||
|
|
33e4894a56 | ||
|
|
aa34159ce8 | ||
|
|
1ccea5928f | ||
|
|
ec59698f4a | ||
|
|
0c2763f3ce | ||
|
|
c9a4483f50 |
17
SECURITY.md
Normal file
17
SECURITY.md
Normal file
@@ -0,0 +1,17 @@
|
||||
## Reporting Vulnerabilities
|
||||
You can report a security vulnerability by creating an issue or send mail to security@comaps.app
|
||||
|
||||
## Verifying Fingerprints
|
||||
|
||||
To [verify](https://developer.android.com/studio/command-line/apksigner#usage-verify) the APK, use the following signing certificate fingerprints:
|
||||
```
|
||||
SHA-256: 4894e8e6963627ef660031d8593fe77297f835acb4e23810003e926135023b4c
|
||||
SHA-1: 8b7b5739f917e9f7c681671ced0c9c8562123ade
|
||||
MD5: 9cce0ffea281dc2f0e0a154d6d2e281e
|
||||
```
|
||||
|
||||
To verify CoMaps via [AppVerifier](https://github.com/soupslurpr/AppVerifier), use the following signing certificate fingerprint:
|
||||
```
|
||||
app.comaps
|
||||
48:94:E8:E6:96:36:27:EF:66:00:31:D8:59:3F:E7:72:97:F8:35:AC:B4:E2:38:10:00:3E:92:61:35:02:3B:4C
|
||||
```
|
||||
@@ -351,6 +351,7 @@ dependencies {
|
||||
implementation libs.androidx.recyclerview
|
||||
implementation libs.androidx.work.runtime
|
||||
implementation libs.androidx.lifecycle.process
|
||||
implementation libs.androidx.documentfile
|
||||
implementation libs.android.material
|
||||
// Fix for app/organicmaps/util/FileUploadWorker.java:14: error: cannot access ListenableFuture
|
||||
// https://github.com/organicmaps/organicmaps/issues/6106
|
||||
|
||||
@@ -9,7 +9,8 @@ import static app.organicmaps.leftbutton.LeftButtonsHolder.BUTTON_HELP_CODE;
|
||||
import static app.organicmaps.leftbutton.LeftButtonsHolder.BUTTON_RECORD_TRACK_CODE;
|
||||
import static app.organicmaps.leftbutton.LeftButtonsHolder.BUTTON_SETTINGS_CODE;
|
||||
import static app.organicmaps.sdk.location.LocationState.FOLLOW;
|
||||
import static app.organicmaps.sdk.location.LocationState.FOLLOW_AND_ROTATE;
|
||||
import static app.organicmaps.sdk.location.LocationState.FOLLOW_AND_ROTATE_COMPASS;
|
||||
import static app.organicmaps.sdk.location.LocationState.FOLLOW_AND_ROTATE_ROUTE;
|
||||
import static app.organicmaps.sdk.location.LocationState.LOCATION_TAG;
|
||||
import static app.organicmaps.sdk.util.PowerManagment.POWER_MANAGEMENT_TAG;
|
||||
import static app.organicmaps.sdk.util.Utils.dimen;
|
||||
@@ -1900,7 +1901,8 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
|
||||
locationHelper.restartWithNewMode();
|
||||
|
||||
if ((newMode == FOLLOW || newMode == FOLLOW_AND_ROTATE) && !LocationUtils.checkFineLocationPermission(this))
|
||||
if ((newMode == FOLLOW || newMode == FOLLOW_AND_ROTATE_ROUTE || newMode == FOLLOW_AND_ROTATE_COMPASS)
|
||||
&& !LocationUtils.checkFineLocationPermission(this))
|
||||
{
|
||||
// Try to optimistically request FINE permission for FOLLOW and FOLLOW_AND_ROTATE modes.
|
||||
Logger.i(LOCATION_TAG, "Requesting ACCESS_FINE_LOCATION permission for " + LocationState.nameOf(newMode));
|
||||
|
||||
@@ -183,11 +183,16 @@ public final class UiHelpers
|
||||
drawableRes = R.drawable.ic_follow;
|
||||
tintColor = Colors.LOCATION_TINT;
|
||||
}
|
||||
case LocationState.FOLLOW_AND_ROTATE ->
|
||||
case LocationState.FOLLOW_AND_ROTATE_COMPASS ->
|
||||
{
|
||||
drawableRes = R.drawable.ic_follow_and_rotate;
|
||||
tintColor = Colors.LOCATION_TINT;
|
||||
}
|
||||
case LocationState.FOLLOW_AND_ROTATE_ROUTE ->
|
||||
{
|
||||
drawableRes = R.drawable.ic_follow_route;
|
||||
tintColor = Colors.LOCATION_TINT;
|
||||
}
|
||||
default -> throw new IllegalArgumentException("Invalid button mode: " + locationMode);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,6 +98,11 @@ public class NavigationController implements TrafficManager.TrafficCallback, Nav
|
||||
mSpeedLimit = topFrame.findViewById(R.id.nav_speed_limit);
|
||||
mCurrentSpeed = topFrame.findViewById(R.id.nav_current_speed);
|
||||
|
||||
View mTopbar = topFrame.findViewById(R.id.statutbar);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(mTopbar,(v, windowInsets) -> {
|
||||
UiUtils.setViewNavigationTopInsetsMargin(v, windowInsets);
|
||||
return windowInsets;
|
||||
});
|
||||
// Show a blank view below the navbar to hide the menu content
|
||||
final View navigationBarBackground = mFrame.findViewById(R.id.nav_bottom_sheet_nav_bar);
|
||||
final View nextTurnContainer = mFrame.findViewById(R.id.nav_next_turn_container);
|
||||
|
||||
@@ -6,10 +6,12 @@ import android.view.View;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.XmlRes;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.util.Utils;
|
||||
import app.organicmaps.util.WindowInsetUtils.ScrollableContentInsetsListener;
|
||||
|
||||
@@ -42,6 +44,7 @@ abstract class BaseXmlSettingsFragment extends PreferenceFragmentCompat
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
view.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.bg_cards));
|
||||
RecyclerView recyclerView = getListView();
|
||||
ViewCompat.setOnApplyWindowInsetsListener(recyclerView, new ScrollableContentInsetsListener(recyclerView));
|
||||
}
|
||||
|
||||
@@ -281,6 +281,14 @@ public final class UiUtils
|
||||
view.setPadding(systemInsets.left, systemInsets.top, systemInsets.right, view.getPaddingBottom());
|
||||
}
|
||||
|
||||
public static void setViewNavigationTopInsetsMargin(View view, WindowInsetsCompat windowInsets)
|
||||
{
|
||||
final Insets systemInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
|
||||
lp.topMargin = systemInsets.top;
|
||||
view.setLayoutParams(lp);
|
||||
}
|
||||
|
||||
public static void setupNavigationIcon(@NonNull MaterialToolbar toolbar, @NonNull View.OnClickListener listener)
|
||||
{
|
||||
View customNavigationButton = toolbar.findViewById(R.id.back);
|
||||
|
||||
@@ -49,8 +49,8 @@ public class MyPositionButton
|
||||
int colorAttr = R.attr.iconTint;
|
||||
@DimenRes
|
||||
int sizeDimen = R.dimen.map_button_icon_size;
|
||||
if (mode == LocationState.FOLLOW || mode == LocationState.FOLLOW_AND_ROTATE
|
||||
|| mode == LocationState.PENDING_POSITION)
|
||||
if (mode == LocationState.FOLLOW || mode == LocationState.FOLLOW_AND_ROTATE_ROUTE
|
||||
|| mode == LocationState.FOLLOW_AND_ROTATE_COMPASS || mode == LocationState.PENDING_POSITION)
|
||||
{
|
||||
colorAttr = com.google.android.material.R.attr.colorSecondary;
|
||||
if (mode == LocationState.PENDING_POSITION)
|
||||
@@ -69,7 +69,8 @@ public class MyPositionButton
|
||||
case LocationState.NOT_FOLLOW_NO_POSITION -> R.drawable.ic_location_off;
|
||||
case LocationState.NOT_FOLLOW -> R.drawable.ic_location_crosshair;
|
||||
case LocationState.FOLLOW -> R.drawable.ic_follow;
|
||||
case LocationState.FOLLOW_AND_ROTATE -> R.drawable.ic_follow_and_rotate;
|
||||
case LocationState.FOLLOW_AND_ROTATE_COMPASS -> R.drawable.ic_follow_and_rotate;
|
||||
case LocationState.FOLLOW_AND_ROTATE_ROUTE -> R.drawable.ic_follow_route;
|
||||
default -> throw new IllegalArgumentException("Invalid button mode: " + mode);
|
||||
};
|
||||
image = ResourcesCompat.getDrawable(resources, drawableRes, context.getTheme());
|
||||
|
||||
30
android/app/src/main/res/drawable/ic_follow_route.xml
Normal file
30
android/app/src/main/res/drawable/ic_follow_route.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:strokeColor="@android:color/white"
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M15.15 16.92l-7.04 2.8v0.4l2.63 1.07 0.98 2.67h0.39z"/>
|
||||
<path
|
||||
android:strokeColor="@android:color/white"
|
||||
android:strokeWidth="2"
|
||||
android:strokeLineJoin="miter"
|
||||
android:pathData="m 16.25,15.95 c 2.29,-2.29 1.91,-3.87 -4.06,-3.87"/>
|
||||
<path
|
||||
android:strokeColor="@android:color/white"
|
||||
android:strokeWidth="2"
|
||||
android:strokeLineJoin="miter"
|
||||
android:pathData="M8.98 7.43c-2.97 2.96-2.72 4.66 3.24 4.66"/>
|
||||
<path
|
||||
android:strokeColor="@android:color/white"
|
||||
android:strokeWidth="2"
|
||||
android:strokeLineJoin="miter"
|
||||
android:pathData="M8.89 7.51l8.83-8.79"/>
|
||||
<path
|
||||
android:strokeColor="@android:color/white"
|
||||
android:strokeWidth="2"
|
||||
android:strokeLineJoin="miter"
|
||||
android:pathData="M9.2 22.83c-0.64 0.57-2.9 2.5-3.56 3.13"/>
|
||||
</vector>
|
||||
@@ -5,7 +5,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?appBackground"
|
||||
android:background="?cardBackground"
|
||||
android:clipToPadding="false"
|
||||
android:fadeScrollbars="false"
|
||||
android:fillViewport="true">
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?appBackground"
|
||||
android:background="?cardBackground"
|
||||
android:fadeScrollbars="false"
|
||||
android:fillViewport="true"
|
||||
android:clipToPadding="false">
|
||||
|
||||
@@ -11,13 +11,12 @@
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/statutbar"
|
||||
android:layout_height="15dp"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/street_frame"
|
||||
android:layout_width="500dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/margin_half_plus_eight"
|
||||
android:layout_marginEnd="@dimen/margin_quarter"
|
||||
app:cardCornerRadius="@dimen/margin_half"
|
||||
android:elevation="@dimen/nav_elevation"
|
||||
@@ -52,7 +51,6 @@
|
||||
app:layout_constraintEnd_toStartOf="@+id/street_frame"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/statutbar"
|
||||
android:layout_marginTop="@dimen/margin_half_plus_eight"
|
||||
android:layout_marginStart="@dimen/margin_quarter"
|
||||
android:clickable="true"
|
||||
android:elevation="@dimen/nav_elevation">
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="?appBackground">
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
layout="@layout/toolbar_extended"/>
|
||||
@@ -18,8 +17,7 @@
|
||||
android:id="@+id/fragment_container"
|
||||
style="@style/MwmWidget.FrameLayout.Elevation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?appBackground"/>
|
||||
android:layout_height="match_parent"/>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?appBackground"
|
||||
android:background="?cardBackground"
|
||||
android:clipToPadding="false"
|
||||
android:fadeScrollbars="false"
|
||||
android:fillViewport="true">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?appBackground">
|
||||
android:background="?cardBackground">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?appBackground"
|
||||
android:background="?cardBackground"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?appBackground"
|
||||
android:background="?cardBackground"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="?appBackground">
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
layout="@layout/toolbar_default"/>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?appBackground"
|
||||
android:background="?cardBackground"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?appBackground"
|
||||
android:background="?cardBackground"
|
||||
android:fadeScrollbars="false"
|
||||
android:fillViewport="true"
|
||||
android:clipToPadding="false">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="?appBackground">
|
||||
android:background="?cardBackground">
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/MwmWidget.ToolbarStyle"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="?appBackground">
|
||||
android:background="?cardBackground">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/header"
|
||||
|
||||
@@ -11,13 +11,12 @@
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/statutbar"
|
||||
android:layout_height="25dp"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/street_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/margin_half_plus"
|
||||
android:layout_marginStart="@dimen/nav_street_left"
|
||||
android:layout_marginEnd="@dimen/margin_quarter"
|
||||
app:cardCornerRadius="@dimen/margin_half"
|
||||
@@ -55,7 +54,6 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/statutbar"
|
||||
android:layout_marginStart="@dimen/margin_half"
|
||||
android:layout_marginTop="@dimen/margin_half_plus"
|
||||
android:clickable="true"
|
||||
android:elevation="@dimen/nav_elevation">
|
||||
<LinearLayout
|
||||
|
||||
@@ -9,7 +9,7 @@ android:layout_marginHorizontal="@dimen/margin_base"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
app:strokeWidth="1dp"
|
||||
app:strokeColor="@color/base_accent"
|
||||
app:cardBackgroundColor="?cardBackground">
|
||||
app:cardBackgroundColor="@color/bg_cards">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -150,8 +150,6 @@
|
||||
<item name="colorSurfaceContainer">@color/md_theme_surfaceContainer</item>
|
||||
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh</item>
|
||||
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest</item>
|
||||
|
||||
<item name="appBackground">?android:attr/colorBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTheme" parent="MwmTheme.Base"/>
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
<item>type2_combo</item>
|
||||
<item>nacs</item>
|
||||
<item>chademo</item>
|
||||
<item>type1</item>
|
||||
<item>type2_cable</item>
|
||||
<item>type2</item>
|
||||
<item>type2_cable</item>
|
||||
<item>type1</item>
|
||||
<item>schuko</item>
|
||||
<item>unknown</item>
|
||||
</string-array>
|
||||
|
||||
@@ -64,7 +64,6 @@
|
||||
<color name="bg_cards">@android:color/white</color>
|
||||
<color name="bg_panel">@color/bg_window</color>
|
||||
<color name="bg_primary_dark">#37653F</color> <!-- secondary dark -->
|
||||
<color name="bg_app">@android:color/white</color>
|
||||
|
||||
<color name="bg_dialog_translucent">#BB000000</color>
|
||||
<color name="bg_text_translucent">#99FFFFFF</color>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
<attr name="textDialogTheme" format="reference" />
|
||||
<attr name="windowBackgroundForced" format="reference|color" />
|
||||
<attr name="cardBackground" format="reference" />
|
||||
<attr name="appBackground" format="reference|color" />
|
||||
<attr name="clickableBackground" format="reference" />
|
||||
<attr name="statusBar" format="color" />
|
||||
<attr name="secondary" format="color" />
|
||||
|
||||
@@ -158,8 +158,6 @@
|
||||
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh</item>
|
||||
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest</item>
|
||||
|
||||
<item name="appBackground">@color/bg_app</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="MwmTheme" parent="MwmTheme.Base"/>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
[versions]
|
||||
androidGradlePlugin = "8.11.2"
|
||||
androidGradlePlugin = "8.13.2"
|
||||
androidxCarApp = "1.7.0"
|
||||
|
||||
[libraries]
|
||||
android-tools = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" }
|
||||
triplet-play-publisher = { module = "com.github.triplet.gradle:play-publisher", version = "3.12.1" }
|
||||
triplet-play-publisher = { module = "com.github.triplet.gradle:play-publisher", version = "3.13.0" }
|
||||
huawei-publish = { module = "ru.cian:huawei-publish-gradle-plugin", version = "1.4.2" }
|
||||
android-tools-desugar = { module = "com.android.tools:desugar_jdk_libs", version = "2.1.5" }
|
||||
microg-services-location = { module = "org.microg.gms:play-services-location", version = "0.3.6.244735" }
|
||||
androidx-core = { module = "androidx.core:core", version = "1.17.0" }
|
||||
jetbrains-kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version = "2.2.20" }
|
||||
jetbrains-kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version = "2.2.21" }
|
||||
androidx-annotation = { module = "androidx.annotation:annotation", version = "1.9.1" }
|
||||
androidx-appcompat = { module = "androidx.appcompat:appcompat", version = "1.7.1" }
|
||||
androidx-car-app = { module = "androidx.car.app:app", version.ref = "androidxCarApp" }
|
||||
@@ -21,12 +21,13 @@ androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version
|
||||
androidx-work-runtime = { module = "androidx.work:work-runtime", version = "2.10.5" }
|
||||
androidx-lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version = "2.9.4" }
|
||||
androidx-media = { module = "androidx.media:media", version = "1.7.1" }
|
||||
androidx-documentfile= { module = "androidx.documentfile:documentfile", version ="1.1.0" }
|
||||
android-material = { module = "com.google.android.material:material", version = "1.12.0" }
|
||||
google-guava = { module = "com.google.guava:guava", version = "33.4.8-android" }
|
||||
google-guava = { module = "com.google.guava:guava", version = "33.5.0-android" }
|
||||
appdevnext-androidchart = { module = "com.github.AppDevNext:AndroidChart", version = "3.1.0.31" }
|
||||
androidx-test-junit = { module = "androidx.test.ext:junit", version = "1.3.0" }
|
||||
junit = { module = "junit:junit", version = "4.13.2" }
|
||||
mockito-core = { module = "org.mockito:mockito-core", version = "5.20.0" }
|
||||
mockito-core = { module = "org.mockito:mockito-core", version = "5.21.0" }
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
|
||||
|
||||
@@ -126,6 +126,7 @@ dependencies {
|
||||
implementation libs.androidx.recyclerview
|
||||
implementation libs.androidx.preference
|
||||
implementation libs.android.material
|
||||
implementation libs.androidx.documentfile
|
||||
|
||||
testImplementation libs.junit
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ public final class LocationState
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({PENDING_POSITION, NOT_FOLLOW_NO_POSITION, NOT_FOLLOW, FOLLOW, FOLLOW_AND_ROTATE})
|
||||
@IntDef({PENDING_POSITION, NOT_FOLLOW_NO_POSITION, NOT_FOLLOW, FOLLOW, FOLLOW_AND_ROTATE_COMPASS,
|
||||
FOLLOW_AND_ROTATE_ROUTE})
|
||||
@interface Value
|
||||
{}
|
||||
|
||||
@@ -29,7 +30,8 @@ public final class LocationState
|
||||
public static final int NOT_FOLLOW_NO_POSITION = 1;
|
||||
public static final int NOT_FOLLOW = 2;
|
||||
public static final int FOLLOW = 3;
|
||||
public static final int FOLLOW_AND_ROTATE = 4;
|
||||
public static final int FOLLOW_AND_ROTATE_COMPASS = 4;
|
||||
public static final int FOLLOW_AND_ROTATE_ROUTE = 5;
|
||||
|
||||
// These constants should correspond to values defined in platform/location.hpp
|
||||
// Leave 0-value as no any error.
|
||||
@@ -69,7 +71,8 @@ public final class LocationState
|
||||
case NOT_FOLLOW_NO_POSITION -> "NOT_FOLLOW_NO_POSITION";
|
||||
case NOT_FOLLOW -> "NOT_FOLLOW";
|
||||
case FOLLOW -> "FOLLOW";
|
||||
case FOLLOW_AND_ROTATE -> "FOLLOW_AND_ROTATE";
|
||||
case FOLLOW_AND_ROTATE_COMPASS -> "FOLLOW_AND_ROTATE_COMPASS";
|
||||
case FOLLOW_AND_ROTATE_ROUTE -> "FOLLOW_AND_ROTATE_ROUTE";
|
||||
default -> "Unknown: " + mode;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
<!-- Compared to wilderness_hut its smaller and simpler, without a fireplace. -->
|
||||
<string name="type.amenity.shelter.basic_hut">Bivouac Hut</string>
|
||||
<!-- A traditional 3-walled shelter (one side open), suitable for overnight camping. -->
|
||||
<string name="type.amenity.shelter.lean_to">Lean-to Shelter</string>
|
||||
<string name="type.amenity.shelter.lean_to">Lean-to Sleep Shelter</string>
|
||||
<string name="type.amenity.public_bath">Public Bath</string>
|
||||
<string name="type.amenity.shower">Shower</string>
|
||||
<string name="type.amenity.stripclub">Stripclub</string>
|
||||
@@ -198,7 +198,7 @@
|
||||
<string name="type.amenity.vending_machine.food">Food Dispenser</string>
|
||||
<string name="type.amenity.vending_machine.newspapers">Newspaper Dispenser</string>
|
||||
<string name="type.amenity.vending_machine.parking_tickets">Parking Meter</string>
|
||||
<string name="type.amenity.vending_machine.public_transport_tickets">Ticket Machine</string>
|
||||
<string name="type.amenity.vending_machine.public_transport_tickets">Public Transport Ticket Machine</string>
|
||||
<string name="type.amenity.vending_machine.sweets">Sweets Dispenser</string>
|
||||
<string name="type.amenity.vending_machine.excrement_bags">Excrement Bags Dispenser</string>
|
||||
<string name="type.amenity.parcel_locker">Parcel Locker</string>
|
||||
|
||||
@@ -81,6 +81,9 @@
|
||||
"amenity-townhall": "3Town Hall|townhall|city hall|guildhall|village hall|4municipal hall|civic centre",
|
||||
"tourism-attraction|@category_tourism": "4Attraction|U+1F3A0|U+1F3A1|U+1F3A2|U+1F3AA",
|
||||
"tourism-artwork": "3Artwork|U+1F3A8",
|
||||
"tourism-artwork-sculpture": "Sculpture|Artwork|U+1F3A8",
|
||||
"tourism-artwork-statue": "Statue|Artwork|U+1F3A8",
|
||||
"tourism-artwork-painting": "Painting|Artwork|U+1F3A8",
|
||||
"tourism-viewpoint|@category_tourism": "4Viewpoint|Vista",
|
||||
"tourism-information": "4Tourist Information|4information|U+1F481",
|
||||
"tourism-picnic_site|amenity-bbq|leisure-picnic_table": "3Picnic Site|picnic|Barbecue Grill|Picnic Table|bbq|Barbec",
|
||||
@@ -197,7 +200,7 @@
|
||||
"amenity-school": "3School|U+1F392|U+1F3EB",
|
||||
"amenity-shelter": "4Shelter|refuge",
|
||||
"amenity-shelter-basic_hut": "basic hut|3Bivouac Hut|Bivvy|Bothy|Hut",
|
||||
"amenity-shelter-lean_to": "3Lean-to Shelter|4Shelter|Refuge|lean shelter|shelter",
|
||||
"amenity-shelter-lean_to": "3Lean-to Sleep Shelter|4Shelter|Refuge|lean shelter|Lean-to Shelter",
|
||||
"amenity-stripclub": "Stripclub|strip club",
|
||||
"amenity-telephone": "2Phone|U+260E|U+1F4DE|5Telephone",
|
||||
"@category_toilet": "3Toilet|toilets|4Restroom|potty|WC|water closet",
|
||||
@@ -365,20 +368,21 @@
|
||||
"shop-pet|@shop": "3Pet",
|
||||
"tourism-zoo|@category_tourism|@category_children": "2Zoo",
|
||||
"attraction-animal": "Animal Enclosure",
|
||||
"tourism-information-office|amenity-ranger_station|@category_tourism": "4Tourism office|6Ranger station",
|
||||
"tourism-information-visitor_centre|amenity-ranger_station|@category_tourism": "3Visitor centre|6Ranger station",
|
||||
"tourism-information-office|amenity-ranger_station|@category_tourism": "4Tourist Office|Tourism office|6Ranger station|Information",
|
||||
"tourism-information-visitor_centre|amenity-ranger_station|@category_tourism": "3Visitor centre|6Ranger station|Information",
|
||||
"amenity-community_centre": "4Community centre",
|
||||
"amenity-compressed_air": "6Compressed air",
|
||||
"amenity-courthouse": "4Courthouse",
|
||||
"amenity-vending_machine-cigarettes": "4Cigarette dispenser",
|
||||
"amenity-vending_machine-coffee": "4Coffee dispenser|Coffee",
|
||||
"amenity-vending_machine-condoms": "4Condoms dispenser|Condoms|Condomat",
|
||||
"amenity-vending_machine-drinks": "4Drinks dispenser|4Beverages",
|
||||
"amenity-vending_machine-food|@category_food": "4Food dispenser|Food|Snacks",
|
||||
"amenity-vending_machine": "Vending Machine",
|
||||
"amenity-vending_machine-cigarettes": "4Cigarette dispenser|Vending Machine",
|
||||
"amenity-vending_machine-coffee": "4Coffee dispenser|Coffee|Vending Machine",
|
||||
"amenity-vending_machine-condoms": "4Condoms dispenser|Condoms|Condomat|Vending Machine",
|
||||
"amenity-vending_machine-drinks": "4Drinks dispenser|4Beverages|Vending Machine",
|
||||
"amenity-vending_machine-food|@category_food": "4Food dispenser|Food|Snacks|Vending Machine",
|
||||
"amenity-vending_machine-parking_tickets|@category_parking": "4Parking tickets|3Pay and Display|Parkomat|Parking Meter",
|
||||
"amenity-vending_machine-public_transport_tickets|@category_transport": "6Ticket machine|Transport Tickets|Tickets|4Fare machine|Bus tickets|Train tickets|Ticketing",
|
||||
"amenity-vending_machine-public_transport_tickets|@category_transport": "4Public Transport Ticket Machine|6Ticket machine|Transport Tickets|Tickets|4Fare machine|Bus tickets|Train tickets|Ticketing|Vending Machine",
|
||||
"amenity-vending_machine-newspapers": "4Newspaper Dispenser|Newspapers",
|
||||
"amenity-vending_machine-sweets": "4Sweets Dispenser|Sweets|4Candies|Lollies",
|
||||
"amenity-vending_machine-sweets": "4Sweets Dispenser|Sweets|4Candies|Lollies|Vending Machine",
|
||||
"amenity-vending_machine-excrement_bags": "5Excrement Bags Dispenser|4Poop Bags|3Dog Poop Bags|Animal Waste",
|
||||
"amenity-parcel_locker|@category_post": "4Parcel Locker|4Parcel Pickup",
|
||||
"shop-outpost": "4Pickup Point|4Parcel Pickup",
|
||||
@@ -398,6 +402,7 @@
|
||||
"tourism-chalet|@category_hotel": "5Holiday Cottage|5vacation home|4Chalet",
|
||||
"tourism-information-board": "Information Board",
|
||||
"tourism-information-map": "Tourist map|map|4Information",
|
||||
"tourism-information-guidepost": "Guidepost",
|
||||
"aerialway-station": "Aerialway Station|5Cable car station",
|
||||
"aeroway-helipad": "4Helipad",
|
||||
"barrier-border_control": "4Border Control",
|
||||
@@ -499,6 +504,7 @@
|
||||
"leisure-track": "Track",
|
||||
"leisure-bandstand": "5Bandstand",
|
||||
"power-plant": "Power Plant",
|
||||
"power-generator-wind": "Wind Generator",
|
||||
"shop-auction|@category_secondhand": "4Auction|Auctioneer|Auction House",
|
||||
"shop-collector|@category_shopping|@category_secondhand": "Collectables|Collector",
|
||||
"man_made-cairn": "4Cairn",
|
||||
|
||||
4610
data/countries.txt
4610
data/countries.txt
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,10 @@
|
||||
{
|
||||
"World": {
|
||||
"languages": ["int_name", "en", "default"]
|
||||
},
|
||||
"WorldCoasts": {
|
||||
"languages": ["int_name", "en", "default"]
|
||||
},
|
||||
"Abkhazia": {
|
||||
"languages": ["ab", "ru"]
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
-->
|
||||
<!-- TODO: grouping like in <type id="shop-bag" group="shop"> is not currently used,
|
||||
see https://github.com/organicmaps/organicmaps/pull/7678#issuecomment-2017488467
|
||||
-->
|
||||
-->
|
||||
<editor>
|
||||
<!-- TODO: disabling is not implemented, remove? see a todo in Editor::GetEditableProperties() -->
|
||||
<disable everywhere="no">
|
||||
@@ -122,10 +122,10 @@
|
||||
</value>
|
||||
</field>
|
||||
<!-- Uncomment this and other ele fields when the code supports it. -->
|
||||
<!-- <field name="ele">-->
|
||||
<!-- <tag k="ele" />-->
|
||||
<!-- <value type="number" />-->
|
||||
<!-- </field>-->
|
||||
<!-- <field name="ele"> -->
|
||||
<!-- <tag k="ele" /> -->
|
||||
<!-- <value type="number" /> -->
|
||||
<!-- </field> -->
|
||||
<!-- Skipping FMD_TURN_LANES. -->
|
||||
<field name="email">
|
||||
<tag k="email" />
|
||||
@@ -135,9 +135,9 @@
|
||||
<tag k="addr:postcode" />
|
||||
</field>
|
||||
<!-- Uncomment this and other wiki fields when the code supports it. -->
|
||||
<!-- <field name="wikipedia" editable="no">-->
|
||||
<!-- <tag k="wikipedia" />-->
|
||||
<!-- </field>-->
|
||||
<!-- <field name="wikipedia" editable="no"> -->
|
||||
<!-- <tag k="wikipedia" /> -->
|
||||
<!-- </field> -->
|
||||
<!-- Skipping FMD_MAXSPEED. -->
|
||||
<field name="flats">
|
||||
<tag k="addr:flats" />
|
||||
@@ -175,10 +175,10 @@
|
||||
</field>
|
||||
<!-- Field groups. -->
|
||||
<field_group name="charge_sockets">
|
||||
<field_ref name="socket_type1_count" />
|
||||
<field_ref name="socket_type1_output" />
|
||||
<field_ref name="socket_type2_count" />
|
||||
<field_ref name="socket_type2_output" />
|
||||
<field_ref name="socket_type1_count" />
|
||||
<field_ref name="socket_type1_output" />
|
||||
<field_ref name="socket_type2_count" />
|
||||
<field_ref name="socket_type2_output" />
|
||||
</field_group>
|
||||
<field_group name="address">
|
||||
<field_ref name="street" />
|
||||
@@ -236,11 +236,11 @@
|
||||
<types>
|
||||
<type id="aeroway-aerodrome" editable="no">
|
||||
<include group="poi" />
|
||||
<!-- <include field="ele" />-->
|
||||
<!-- <include field="ele" /> -->
|
||||
</type>
|
||||
<type id="aeroway-airport" editable="no">
|
||||
<include group="poi" />
|
||||
<!-- <include field="ele" />-->
|
||||
<!-- <include field="ele" /> -->
|
||||
</type>
|
||||
<type id="amenity-atm" group="banking" priority="low">
|
||||
<include field="opening_hours" />
|
||||
@@ -512,7 +512,7 @@
|
||||
<include group="poi_internet" />
|
||||
</type>
|
||||
<type id="amenity-charging_station">
|
||||
<include group="charge_sockets" />
|
||||
<include group="charge_sockets" />
|
||||
<include field="opening_hours" />
|
||||
<include field="operator" />
|
||||
</type>
|
||||
@@ -625,23 +625,23 @@
|
||||
</type>
|
||||
<type id="historic-archaeological_site" group="historic">
|
||||
<include group="poi" />
|
||||
<!-- <include field="wikipedia" />-->
|
||||
<!-- <include field="wikipedia" /> -->
|
||||
</type>
|
||||
<type id="historic-castle" group="historic">
|
||||
<include group="poi" />
|
||||
<!-- <include field="wikipedia" />-->
|
||||
<!-- <include field="wikipedia" /> -->
|
||||
</type>
|
||||
<type id="historic-memorial" group="historic">
|
||||
<include field="name" />
|
||||
<!-- <include field="wikipedia" />-->
|
||||
<!-- <include field="wikipedia" /> -->
|
||||
</type>
|
||||
<type id="historic-monument" group="historic">
|
||||
<include field="name" />
|
||||
<!-- <include field="wikipedia" />-->
|
||||
<!-- <include field="wikipedia" /> -->
|
||||
</type>
|
||||
<type id="historic-ruins" group="historic">
|
||||
<include field="name" />
|
||||
<!-- <include field="wikipedia" />-->
|
||||
<!-- <include field="wikipedia" /> -->
|
||||
</type>
|
||||
<type id="historic-aircraft" group="historic">
|
||||
<include field="name" />
|
||||
@@ -689,7 +689,7 @@
|
||||
<!-- Not addable as mapping as a node is uncommon, also ambiguous with amenity-grave_yard -->
|
||||
<type id="landuse-cemetery" can_add="no">
|
||||
<include group="poi" />
|
||||
<!-- <include field="wikipedia" />-->
|
||||
<!-- <include field="wikipedia" /> -->
|
||||
</type>
|
||||
<!-- Not addable as mapping as a node is uncommon -->
|
||||
<type id="leisure-garden" can_add="no">
|
||||
@@ -710,7 +710,7 @@
|
||||
<!-- Not addable as mapping as a node is uncommon -->
|
||||
<type id="leisure-stadium" can_add="no">
|
||||
<include group="poi_internet" />
|
||||
<!-- <include field="wikipedia" />-->
|
||||
<!-- <include field="wikipedia" /> -->
|
||||
</type>
|
||||
<!-- Not addable as mapping as a node is uncommon -->
|
||||
<type id="leisure-swimming_pool" can_add="no">
|
||||
@@ -719,7 +719,7 @@
|
||||
</type>
|
||||
<type id="natural-cave_entrance" group="historic">
|
||||
<include field="name" />
|
||||
<!-- <include field="wikipedia" />-->
|
||||
<!-- <include field="wikipedia" /> -->
|
||||
</type>
|
||||
<type id="natural-geyser">
|
||||
<include field="name" />
|
||||
@@ -729,8 +729,8 @@
|
||||
</type>
|
||||
<type id="natural-peak">
|
||||
<include field="name" />
|
||||
<!-- <include field="wikipedia" />-->
|
||||
<!-- <include field="ele" />-->
|
||||
<!-- <include field="wikipedia" /> -->
|
||||
<!-- <include field="ele" /> -->
|
||||
</type>
|
||||
<type id="natural-spring">
|
||||
<include field="name" />
|
||||
@@ -738,10 +738,9 @@
|
||||
<type id="waterway-waterfall">
|
||||
<include field="name" />
|
||||
<include field="height" />
|
||||
<!-- <include field="wikipedia" />-->
|
||||
<!-- <include field="wikipedia" /> -->
|
||||
</type>
|
||||
<!-- Too generic to be added -->
|
||||
<type id="office" can_add="no">
|
||||
<type id="office" group="office">
|
||||
<include group="poi_internet" />
|
||||
</type>
|
||||
<type id="office-company" group="office">
|
||||
@@ -771,7 +770,7 @@
|
||||
<!-- Not addable because ambiguous with landuse=farmyard -->
|
||||
<type id="place-farm" can_add="no">
|
||||
<include group="poi_internet" />
|
||||
<!-- <include field="wikipedia" />-->
|
||||
<!-- <include field="wikipedia" /> -->
|
||||
</type>
|
||||
|
||||
<!-- Do not allow to edit settlements.
|
||||
@@ -838,6 +837,12 @@
|
||||
<type id="shop-bathroom_furnishing" group="shop">
|
||||
<include group="poi_internet" />
|
||||
</type>
|
||||
<type id="shop-beauty-nails">
|
||||
<include group="poi_internet" />
|
||||
</type>
|
||||
<type id="shop-beauty-day_spa">
|
||||
<include group="poi_internet" />
|
||||
</type>
|
||||
<type id="shop-beauty">
|
||||
<include group="poi_internet" />
|
||||
</type>
|
||||
@@ -1098,7 +1103,7 @@
|
||||
</type>
|
||||
<type id="tourism-alpine_hut" group="accomodation">
|
||||
<include group="poi_internet" />
|
||||
<!-- <include field="ele" />-->
|
||||
<!-- <include field="ele" /> -->
|
||||
<include field="opening_hours" />
|
||||
<include field="website" />
|
||||
</type>
|
||||
@@ -1108,13 +1113,22 @@
|
||||
<type id="tourism-aquarium">
|
||||
<include group="poi_internet" />
|
||||
</type>
|
||||
<type id="tourism-artwork-sculpture">
|
||||
<include field="name" />
|
||||
</type>
|
||||
<type id="tourism-artwork-statue">
|
||||
<include field="name" />
|
||||
</type>
|
||||
<type id="tourism-artwork-painting">
|
||||
<include field="name" />
|
||||
</type>
|
||||
<type id="tourism-artwork">
|
||||
<include field="name" />
|
||||
</type>
|
||||
<!-- Not addable because OSM category is too broad and due to vandalism problems -->
|
||||
<type id="tourism-attraction" can_add="no">
|
||||
<include group="poi_internet" />
|
||||
<!-- <include field="wikipedia" />-->
|
||||
<!-- <include field="wikipedia" /> -->
|
||||
</type>
|
||||
<type id="attraction-animal">
|
||||
<include field="name" />
|
||||
@@ -1178,6 +1192,12 @@
|
||||
<type id="amenity-compressed_air" />
|
||||
<type id="amenity-bbq" />
|
||||
<type id="leisure-slipway" />
|
||||
<type id="amenity-shelter-basic_hut">
|
||||
<include field="name" />
|
||||
</type>
|
||||
<type id="amenity-shelter-lean_to">
|
||||
<include field="name" />
|
||||
</type>
|
||||
<type id="amenity-shelter">
|
||||
<include field="name" />
|
||||
</type>
|
||||
@@ -1375,6 +1395,9 @@
|
||||
<type id="leisure-indoor_play">
|
||||
<include group="poi_internet" />
|
||||
</type>
|
||||
<type id="leisure-fitness_centre-sport-yoga">
|
||||
<include group="poi_internet" />
|
||||
</type>
|
||||
<type id="leisure-fitness_centre">
|
||||
<include group="poi_internet" />
|
||||
</type>
|
||||
@@ -1399,7 +1422,7 @@
|
||||
<type id="man_made-petroleum_well">
|
||||
<include field="name" />
|
||||
<include field="operator" />
|
||||
<!-- <include field="ele" />-->
|
||||
<!-- <include field="ele" /> -->
|
||||
</type>
|
||||
<type id="man_made-water_well">
|
||||
<include field="name" />
|
||||
@@ -1426,10 +1449,14 @@
|
||||
<type id="man_made-lighthouse">
|
||||
<include field="name" />
|
||||
</type>
|
||||
<type id="man_made-mast-communication" />
|
||||
<type id="man_made-mast" />
|
||||
<type id="man_made-survey_point">
|
||||
<include field="name" />
|
||||
</type>
|
||||
<type id="power-generator-wind">
|
||||
<include field="operator" />
|
||||
</type>
|
||||
<type id="man_made-windmill">
|
||||
<include field="name" />
|
||||
</type>
|
||||
@@ -1557,9 +1584,6 @@
|
||||
<type id="building-address" can_add="yes">
|
||||
<include group="address" />
|
||||
</type>
|
||||
<!-- Uncomment this after a map style is added
|
||||
<type id="man_made-surveillance">
|
||||
</type-->
|
||||
<type id="tourism-theme_park">
|
||||
<include group="poi_internet" />
|
||||
</type>
|
||||
|
||||
@@ -101,7 +101,7 @@ natural|wetland;33;
|
||||
deprecated:highway|track|grade3:04.4024;[highway=track][tracktype=grade3];x;name;int_name;34;highway|track
|
||||
# ~1M usages.
|
||||
power|minor_line;[power=minor_line][!location];;;;35;
|
||||
amenity|school;[amenity=school],[education=school];;name;int_name;36;
|
||||
amenity|school;[amenity=school][education=school],[amenity=school],[education=school];;;;36;
|
||||
# Dedicated/segregated cycleways (e.g. segregated paths are converted into cycleways + footways, see osm2type.cpp).
|
||||
highway|cycleway;37;
|
||||
# ~16M usages.
|
||||
@@ -202,7 +202,7 @@ landuse|commercial;111;
|
||||
moved:railway|station:05.2024;112;railway|station
|
||||
deprecated:highway|path|hiking:04.2024;[highway=path][route=hiking],[highway=path][sac_scale=hiking];x;name;int_name;113;highway|path
|
||||
# ~200k usages.
|
||||
amenity|hospital;114;
|
||||
amenity|hospital;[amenity=hospital][healthcare=hospital],[amenity=hospital],[healthcare=hospital];;;;114;
|
||||
# TODO: merge with "intermittent".
|
||||
waterway|stream|ephemeral;[waterway=stream][intermittent=ephemeral];;name;int_name;115;
|
||||
highway|trunk|bridge;[highway=trunk][bridge?];;name;int_name;116;
|
||||
@@ -210,7 +210,7 @@ highway|trunk|bridge;[highway=trunk][bridge?];;name;int_name;116;
|
||||
amenity|post_office;117;
|
||||
# ~230k usages.
|
||||
landuse|quarry;118;
|
||||
amenity|pharmacy;119;
|
||||
amenity|pharmacy;[amenity=pharmacy][healthcare=pharmacy],[amenity=pharmacy],[healthcare=pharmacy];;;;119;
|
||||
man_made|pier;120;
|
||||
# ~220k usages.
|
||||
highway|motorway_junction;121;
|
||||
@@ -276,7 +276,7 @@ deprecated:natural|wood|coniferous:01.2020;[natural=wood][wood=coniferous],[natu
|
||||
landuse|recreation_ground;173;
|
||||
landuse|village_green;174;
|
||||
amenity|drinking_water;175;
|
||||
amenity|university;[amenity=university],[education=university];;name;int_name;176;
|
||||
amenity|university;[amenity=university][education=university],[amenity=university],[education=university];;;;176;
|
||||
highway|secondary_link;177;
|
||||
power|substation;178;
|
||||
railway|tram_stop;179;
|
||||
@@ -309,7 +309,7 @@ power|portal;204;
|
||||
# Marsh 500K usages, wet_meadow 160K
|
||||
natural|wetland|marsh;[natural=wetland][wetland=marsh],[natural=wetland][wetland=wet_meadow],[natural=wetland][wetland=dambo];;;;205;
|
||||
leisure|stadium;206;
|
||||
amenity|doctors;207;
|
||||
amenity|doctors;[amenity=doctors][healthcare=doctor],[amenity=doctors],[healthcare=doctor];;;;207;
|
||||
railway|disused;208;
|
||||
aeroway|runway;209;
|
||||
railway|halt;210;
|
||||
@@ -327,7 +327,7 @@ sport|swimming;220;
|
||||
leisure|track;221;
|
||||
sport|skateboard;222;
|
||||
barrier|retaining_wall;223;
|
||||
amenity|college;[amenity=college],[education=college];;name;int_name;224;
|
||||
amenity|college;[amenity=college][education=college],[amenity=college],[education=college];;;;224;
|
||||
sport|baseball;225;
|
||||
highway|service|area;[highway=service][area?];;name;int_name;226;
|
||||
highway|residential|area;[highway=residential][area?];;name;int_name;227;
|
||||
@@ -625,9 +625,9 @@ toilets|yes;502;
|
||||
highway|trunk_link|tunnel;[highway=trunk_link][tunnel?];;name;int_name;503;
|
||||
drinking_water|yes;[drinking_water=yes],[drinking_water=treated],[drinking_water:refill=yes];;;;504;
|
||||
drinking_water|no;505;
|
||||
amenity|sailing_school;[amenity=sailing_school],[education=sailing_school];;name;int_name;506;
|
||||
amenity|flight_school;[amenity=flight_school],[education=flight_school];;name;int_name;507;
|
||||
amenity|prep_school;[amenity=prep_school],[education=prep_school];;name;int_name;508;
|
||||
amenity|sailing_school;[amenity=sailing_school][education=sailing_school],[amenity=sailing_school],[education=sailing_school];;;;506;
|
||||
amenity|flight_school;[amenity=flight_school][education=flight_school],[amenity=flight_school],[education=flight_school];;;;507;
|
||||
amenity|prep_school;[amenity=prep_school][education=prep_school],[amenity=prep_school],[education=prep_school];;;;508;
|
||||
amenity|car_pooling;509;
|
||||
social_facility|soup_kitchen;510;
|
||||
social_facility|food_bank;511;
|
||||
@@ -1160,8 +1160,8 @@ railway|subway_entrance|madrid;[railway=subway_entrance][city=madrid];;name;int_
|
||||
railway|subway_entrance|roma;[railway=subway_entrance][city=roma];;name;int_name;1033;
|
||||
railway|subway_entrance|spb;[railway=subway_entrance][city=spb];;name;int_name;1034;
|
||||
aerialway|drag_lift;1035;
|
||||
amenity|dentist;1036;
|
||||
amenity|clinic;1037;
|
||||
amenity|dentist;[amenity=dentist][healthcare=dentist],[amenity=dentist],[healthcare=dentist];;;;1036;
|
||||
amenity|clinic;[amenity=clinic][healthcare=clinic],[amenity=clinic],[healthcare=clinic];;;;1037;
|
||||
barrier|entrance;1038;
|
||||
barrier|border_control;1039;
|
||||
shop|laundry;1040;
|
||||
@@ -1257,8 +1257,8 @@ amenity|vending_machine|food;[amenity=vending_machine][vending=food];;name;int_n
|
||||
amenity|vending_machine|newspapers;[amenity=vending_machine][vending=newspapers];;name;int_name;1130;
|
||||
amenity|vending_machine|sweets;[amenity=vending_machine][vending=sweets];;name;int_name;1131;
|
||||
leisure|dance;[leisure=dance],[amenity=dancing_school];;;;1132;
|
||||
amenity|music_school;[amenity=music_school],[education=music_school];;name;int_name;1133;
|
||||
amenity|language_school;[amenity=language_school],[education=language_school];;name;int_name;1134;
|
||||
amenity|music_school;[amenity=music_school][education=music_school],[amenity=music_school],[education=music_school];;;;1133;
|
||||
amenity|language_school;[amenity=language_school][education=language_school],[amenity=language_school],[education=language_school];;;;1134;
|
||||
historic|city_gate;1135;
|
||||
sport|padel;1136;
|
||||
sport|futsal;1137;
|
||||
@@ -1285,7 +1285,7 @@ shop|charity;1157;
|
||||
hwtag|toll;1158;
|
||||
amenity|arts_centre;1159;
|
||||
amenity|biergarten;1160;
|
||||
amenity|driving_school;[amenity=driving_school],[education=driving_school];;name;int_name;1161;
|
||||
amenity|driving_school;[amenity=driving_school][education=driving_school],[amenity=driving_school],[education=driving_school];;;;1161;
|
||||
amenity|food_court;1162;
|
||||
amenity|ice_cream;1163;
|
||||
amenity|internet_cafe;1164;
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 7 and column 16.
|
108
data/sound-strings/ta.json/localize.json
Normal file
108
data/sound-strings/ta.json/localize.json
Normal file
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"make_a_slight_right_turn":"லேசாக வலதுபுறம் திரும்புங்கள்.",
|
||||
"make_a_slight_right_turn_street":"NULL",
|
||||
"make_a_slight_right_turn_street_verb":"NULL",
|
||||
"make_a_right_turn":"வலதுபுறமாக திரும்புங்கள்.",
|
||||
"make_a_right_turn_street":"NULL",
|
||||
"make_a_sharp_right_turn":"கூர்மையாக வலதுபுறம் திரும்புங்கள்.",
|
||||
"make_a_sharp_right_turn_street":"NULL",
|
||||
"enter_the_roundabout":"ரவுண்டபௌட்டை நுழையுங்கள்.",
|
||||
"enter_the_roundabout_street":"NULL",
|
||||
"enter_the_roundabout_street_verb":"NULL",
|
||||
"leave_the_roundabout":"ரவுண்டபௌட்டை வெளியேறுங்கள்.",
|
||||
"leave_the_roundabout_street":"NULL",
|
||||
"leave_the_roundabout_street_verb":"NULL",
|
||||
"make_a_slight_left_turn":"லேசாக இடதுபுறம் திரும்புங்கள்.",
|
||||
"make_a_slight_left_turn_street":"NULL",
|
||||
"make_a_slight_left_turn_street_verb":"NULL",
|
||||
"make_a_left_turn":"இடதுபுறமாக திரும்புங்கள்.",
|
||||
"make_a_left_turn_street":"NULL",
|
||||
"make_a_sharp_left_turn":"கூர்மையாக இடதுபுறம் திரும்புங்கள்.",
|
||||
"make_a_sharp_left_turn_street":"NULL",
|
||||
"make_a_u_turn":"U-வழியில் திரும்புங்கள்.",
|
||||
"make_a_u_turn_street":"NULL",
|
||||
"make_a_u_turn_street_verb":"NULL",
|
||||
"go_straight":"நேரா போங்க.",
|
||||
"exit":"வெளியேறுங்கள்.",
|
||||
"onto":"நோக்கி",
|
||||
"take_exit_number":"வெளியேறும் வழி எடுங்கள்",
|
||||
"take_exit_number_street_verb":"NULL",
|
||||
"route_recalculating":"வழி மறுபடி கணிக்கிறது",
|
||||
"destination":"நீங்கள் வருவீர்கள்.",
|
||||
"you_have_reached_the_destination":"நீங்கள் வந்துவிட்டீர்கள்..",
|
||||
"in_50_meters":"ஐம்பது மீட்டரில்",
|
||||
"in_100_meters":"நூறு மீட்டரில்",
|
||||
"in_200_meters":"இருநூறு மீட்டரில்",
|
||||
"in_250_meters":"இருநூற்று ஐம்பது மீட்டரில்",
|
||||
"in_300_meters":"முன்னூறு மீட்டரில்",
|
||||
"in_400_meters":"நானூறு மீட்டரில்",
|
||||
"in_500_meters":"ஐநூறு மீட்டரில்",
|
||||
"in_600_meters":"அறுநூறு மீட்டரில்",
|
||||
"in_700_meters":"எழுநூறு மீட்டரில்",
|
||||
"in_750_meters":"எழுநூறு ஐம்பது மீட்டரில்",
|
||||
"in_800_meters":"எண்ணூறு மீட்டரில்",
|
||||
"in_900_meters":"தொள்ளாயிரம் மீட்டரில்",
|
||||
"in_1_kilometer":"ஒரு கிலோமீட்டரில்",
|
||||
"in_1_5_kilometers":"ஒன்றரை கிலோமீட்டரில்",
|
||||
"in_2_kilometers":"இரண்டு கிலோமீட்டரில்",
|
||||
"in_2_5_kilometers":"இரண்டரை கிலோமீட்டரில்",
|
||||
"in_3_kilometers":"மூன்று கிலோமீட்டரில்",
|
||||
"then":"அடுத்தது",
|
||||
"dist_direction_onto_street":"%1$s %4$s %3$s %5$s %2$s",
|
||||
"take_the_1_exit":"ஒன்றாம் வெளியேறும் வழி எடுங்கள்.",
|
||||
"take_the_1_exit_street":"NULL",
|
||||
"take_the_1_exit_street_verb":"NULL",
|
||||
"take_the_2_exit":"இரண்டாம் வெளியேறும் வழி எடுங்கள்.",
|
||||
"take_the_2_exit_street":"NULL",
|
||||
"take_the_2_exit_street_verb":"NULL",
|
||||
"take_the_3_exit":"மூன்றாம் வெளியேறும் வழி எடுங்கள்.",
|
||||
"take_the_3_exit_street":"NULL",
|
||||
"take_the_3_exit_street_verb":"NULL",
|
||||
"take_the_4_exit":"நான்காவது வெளியேறும் வழி எடுங்கள்.",
|
||||
"take_the_4_exit_street":"NULL",
|
||||
"take_the_4_exit_street_verb":"NULL",
|
||||
"take_the_5_exit":"ஐந்தாவது வெளியேறும் வழி எடுங்கள்.",
|
||||
"take_the_5_exit_street":"NULL",
|
||||
"take_the_5_exit_street_verb":"NULL",
|
||||
"take_the_6_exit":"ஆறாவது வெளியேறும் வழி எடுங்கள்.",
|
||||
"take_the_6_exit_street":"NULL",
|
||||
"take_the_6_exit_street_verb":"NULL",
|
||||
"take_the_7_exit":"ஏழாவது வெளியேறும் வழி எடுங்கள்.",
|
||||
"take_the_7_exit_street":"NULL",
|
||||
"take_the_7_exit_street_verb":"NULL",
|
||||
"take_the_8_exit":"எட்டாவது வெளியேறும் வழி எடுங்கள்.",
|
||||
"take_the_8_exit_street":"NULL",
|
||||
"take_the_8_exit_street_verb":"NULL",
|
||||
"take_the_9_exit":"ஒன்பதாவது வெளியேறும் வழி எடுங்கள்.",
|
||||
"take_the_9_exit_street":"NULL",
|
||||
"take_the_9_exit_street_verb":"NULL",
|
||||
"take_the_10_exit":"பத்தாவது வெளியேறும் வழி எடுங்கள்.",
|
||||
"take_the_10_exit_street":"NULL",
|
||||
"take_the_10_exit_street_verb":"NULL",
|
||||
"take_the_11_exit":"பதினொன்றாவது வெளியேறும் வழி எடுங்கள்.",
|
||||
"take_the_11_exit_street":"NULL",
|
||||
"take_the_11_exit_street_verb":"NULL",
|
||||
"in_50_feet":"ஐம்பது அடியில்",
|
||||
"in_100_feet":"நூறு அடியில்",
|
||||
"in_200_feet":"இருநூறு அடியில்",
|
||||
"in_300_feet":"முன்னூறு அடியில்",
|
||||
"in_400_feet":"நானூறு அடியில்",
|
||||
"in_500_feet":"ஐநூறு அடியில்",
|
||||
"in_600_feet":"அறுநூறு அடியில்",
|
||||
"in_700_feet":"எழுநூறு அடியில்",
|
||||
"in_800_feet":"எண்ணூறு அடியில்",
|
||||
"in_900_feet":"தொள்ளாயிரம் அடியில்",
|
||||
"in_1000_feet":"ஆயிரம் அடியில்",
|
||||
"in_1500_feet":"ஆயிரம் ஐநூறு அடியில்",
|
||||
"in_2000_feet":"இரண்டு ஆயிரம் அடியில்",
|
||||
"in_2500_feet":"இரண்டு ஆயிரம் ஐநூறு அடியில்",
|
||||
"in_3000_feet":"மூன்று ஆயிரம் அடியில்",
|
||||
"in_3500_feet":"மூன்று ஆயிரம் ஐநூறு அடியில்",
|
||||
"in_4000_feet":"நான்கு ஆயிரம் அடியில்",
|
||||
"in_4500_feet":"நான்கு ஆயிரம் ஐநூறு அடியில்",
|
||||
"in_5000_feet":"ஐந்து ஆயிரம் அடியில்",
|
||||
"in_1_mile":"ஒன்று மைலில்",
|
||||
"in_1_5_miles":"ஒன்றரை மைலில்",
|
||||
"in_2_miles":"இரண்டு மைலில்",
|
||||
"unknown_camera":"கேமரா முன்னால் இருக்கிறது"
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"data_format": 1,
|
||||
"data_url": "https://codeberg.org/comaps/comaps/raw/branch/main/data/taginfo.json",
|
||||
"data_updated": "20251120T121118Z",
|
||||
"data_updated": "20251228T203737Z",
|
||||
"project": {
|
||||
"name": "CoMaps",
|
||||
"description": "CoMaps is a community-focused privacy navigation iOS & Android app for travelers - drivers, hikers, and cyclists.",
|
||||
@@ -176,7 +176,7 @@
|
||||
"description": "amenity=car_pooling",
|
||||
"key": "amenity",
|
||||
"value": "car_pooling",
|
||||
"icon_url": "https://codeberg.org/comaps/comaps/raw/branch/main/data/styles/default/light/symbols/parking-pooling-m.svg"
|
||||
"icon_url": "https://codeberg.org/comaps/comaps/raw/branch/main/data/styles/default/light/symbols/parking_pooling-m.svg"
|
||||
},
|
||||
{
|
||||
"description": "amenity=car_rental",
|
||||
@@ -431,6 +431,12 @@
|
||||
"value": "hunting_stand",
|
||||
"icon_url": "https://codeberg.org/comaps/comaps/raw/branch/main/data/styles/default/light/symbols/hunting-tower-m.svg"
|
||||
},
|
||||
{
|
||||
"description": "amenity=hydrant",
|
||||
"key": "amenity",
|
||||
"value": "hydrant",
|
||||
"icon_url": "https://codeberg.org/comaps/comaps/raw/branch/main/data/styles/default/light/symbols/hydrant-m.svg"
|
||||
},
|
||||
{
|
||||
"description": "amenity=ice_cream",
|
||||
"key": "amenity",
|
||||
|
||||
@@ -239,7 +239,7 @@ final class CarPlayService: NSObject {
|
||||
MapTemplateBuilder.configureBaseUI(mapTemplate: mapTemplate)
|
||||
if currentPositionMode == .pendingPosition {
|
||||
mapTemplate.leadingNavigationBarButtons = []
|
||||
} else if currentPositionMode == .follow || currentPositionMode == .followAndRotate {
|
||||
} else if currentPositionMode == .follow || currentPositionMode == .followAndRotateCompass || currentPositionMode == .followAndRotateRoute {
|
||||
MapTemplateBuilder.setupDestinationButton(mapTemplate: mapTemplate)
|
||||
} else {
|
||||
MapTemplateBuilder.setupRecenterButton(mapTemplate: mapTemplate)
|
||||
@@ -623,22 +623,32 @@ extension CarPlayService: CarPlayRouterListener {
|
||||
extension CarPlayService: LocationModeListener {
|
||||
func processMyPositionStateModeEvent(_ mode: MWMMyPositionMode) {
|
||||
currentPositionMode = mode
|
||||
guard let rootMapTemplate = rootMapTemplate,
|
||||
let info = rootMapTemplate.userInfo as? MapInfo,
|
||||
info.type == CPConstants.TemplateType.main else {
|
||||
|
||||
// make sure we have a rootMapTemplate
|
||||
guard let rootMapTemplate = rootMapTemplate else {
|
||||
return
|
||||
}
|
||||
|
||||
// exit if we're navigating
|
||||
guard let info = rootMapTemplate.userInfo as? MapInfo,
|
||||
info.type == CPConstants.TemplateType.main else {
|
||||
MapTemplateBuilder.updateMyPositionModeButton(mapTemplate: rootMapTemplate, newMode: mode)
|
||||
return
|
||||
}
|
||||
switch mode {
|
||||
case .follow, .followAndRotate:
|
||||
case .follow, .followAndRotateCompass, .followAndRotateRoute:
|
||||
if !rootMapTemplate.isPanningInterfaceVisible {
|
||||
MapTemplateBuilder.setupDestinationButton(mapTemplate: rootMapTemplate)
|
||||
MapTemplateBuilder.updateMyPositionModeButton(mapTemplate: rootMapTemplate, newMode: mode)
|
||||
}
|
||||
case .notFollow:
|
||||
if !rootMapTemplate.isPanningInterfaceVisible {
|
||||
MapTemplateBuilder.setupRecenterButton(mapTemplate: rootMapTemplate)
|
||||
MapTemplateBuilder.updateMyPositionModeButton(mapTemplate: rootMapTemplate, newMode: mode)
|
||||
}
|
||||
case .pendingPosition, .notFollowNoPosition:
|
||||
rootMapTemplate.leadingNavigationBarButtons = []
|
||||
MapTemplateBuilder.updateMyPositionModeButton(mapTemplate: rootMapTemplate, newMode: mode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ final class MapTemplateBuilder {
|
||||
case startPanning
|
||||
case zoomIn
|
||||
case zoomOut
|
||||
case myPositionMode
|
||||
}
|
||||
enum BarButtonType {
|
||||
case dismissPaning
|
||||
@@ -28,7 +29,7 @@ final class MapTemplateBuilder {
|
||||
configureBaseUI(mapTemplate: mapTemplate)
|
||||
if positionMode == .pendingPosition {
|
||||
mapTemplate.leadingNavigationBarButtons = []
|
||||
} else if positionMode == .follow || positionMode == .followAndRotate {
|
||||
} else if positionMode == .follow || positionMode == .followAndRotateCompass || positionMode == .followAndRotateRoute {
|
||||
setupDestinationButton(mapTemplate: mapTemplate)
|
||||
} else {
|
||||
setupRecenterButton(mapTemplate: mapTemplate)
|
||||
@@ -69,7 +70,10 @@ final class MapTemplateBuilder {
|
||||
let zoomOutButton = buildMapButton(type: .zoomOut) { _ in
|
||||
FrameworkHelper.zoomMap(.out)
|
||||
}
|
||||
mapTemplate.mapButtons = [panningButton, zoomInButton, zoomOutButton]
|
||||
let myPositionModeButton = buildMapButton(type: .myPositionMode) { _ in
|
||||
FrameworkHelper.switchMyPositionMode()
|
||||
}
|
||||
mapTemplate.mapButtons = [myPositionModeButton, panningButton, zoomInButton, zoomOutButton]
|
||||
|
||||
let settingsButton = buildBarButton(type: .settings) { _ in
|
||||
let gridTemplate = SettingsTemplateBuilder.buildGridTemplate()
|
||||
@@ -99,7 +103,10 @@ final class MapTemplateBuilder {
|
||||
let panningButton = buildMapButton(type: .startPanning) { _ in
|
||||
mapTemplate.showPanningInterface(animated: true)
|
||||
}
|
||||
mapTemplate.mapButtons = [panningButton]
|
||||
let myPositionModeButton = buildMapButton(type: .myPositionMode) { _ in
|
||||
FrameworkHelper.switchMyPositionMode()
|
||||
}
|
||||
mapTemplate.mapButtons = [myPositionModeButton, panningButton]
|
||||
setupMuteAndRedirectButtons(template: mapTemplate)
|
||||
let endButton = buildBarButton(type: .endRoute) { _ in
|
||||
CarPlayService.shared.cancelCurrentTrip()
|
||||
@@ -117,6 +124,28 @@ final class MapTemplateBuilder {
|
||||
mapTemplate.leadingNavigationBarButtons = [destinationButton]
|
||||
}
|
||||
|
||||
class func updateMyPositionModeButton(mapTemplate: CPMapTemplate, newMode: MWMMyPositionMode) {
|
||||
let button = CPMapButton(handler: { _ in
|
||||
FrameworkHelper.switchMyPositionMode()
|
||||
})
|
||||
|
||||
switch newMode {
|
||||
case .pendingPosition:
|
||||
button.image = UIImage(systemName: "location.fill")
|
||||
case .notFollowNoPosition:
|
||||
button.image = UIImage(systemName: "location")
|
||||
case .notFollow:
|
||||
button.image = UIImage(systemName: "location")
|
||||
case .follow:
|
||||
button.image = UIImage(systemName: "location.fill")
|
||||
case .followAndRotate:
|
||||
button.image = UIImage(systemName: "location.north.line.fill")
|
||||
}
|
||||
if mapTemplate.mapButtons.count > 0 {
|
||||
mapTemplate.mapButtons[0] = button
|
||||
}
|
||||
}
|
||||
|
||||
class func setupRecenterButton(mapTemplate: CPMapTemplate) {
|
||||
let recenterButton = buildBarButton(type: .recenter) { _ in
|
||||
FrameworkHelper.switchMyPositionMode()
|
||||
@@ -166,6 +195,8 @@ final class MapTemplateBuilder {
|
||||
button.image = UIImage(systemName: "plus")
|
||||
case .zoomOut:
|
||||
button.image = UIImage(systemName: "minus")
|
||||
case .myPositionMode:
|
||||
button.image = UIImage(systemName: "location")
|
||||
}
|
||||
// Remove code below once Apple has fixed its issue with the button background
|
||||
if #unavailable(iOS 26) {
|
||||
@@ -176,6 +207,8 @@ final class MapTemplateBuilder {
|
||||
button.focusedImage = UIImage(systemName: "plus.circle.fill")
|
||||
case .zoomOut:
|
||||
button.focusedImage = UIImage(systemName: "minus.circle.fill")
|
||||
case .myPositionMode:
|
||||
button.image = UIImage(systemName: "location.fill")
|
||||
}
|
||||
}
|
||||
return button
|
||||
|
||||
@@ -91,7 +91,8 @@ NSString * const kUDDidShowLongTapToShowSideButtonsToast = @"kUDDidShowLongTapTo
|
||||
case MWMMyPositionModeNotFollow:
|
||||
case MWMMyPositionModeNotFollowNoPosition: [locBtn setStyleNameAndApply: @"ButtonGetPosition"]; break;
|
||||
case MWMMyPositionModeFollow: [locBtn setStyleNameAndApply: @"ButtonFollow"]; break;
|
||||
case MWMMyPositionModeFollowAndRotate: [locBtn setStyleNameAndApply: @"ButtonFollowAndRotate"]; break;
|
||||
case MWMMyPositionModeFollowAndRotateCompass: [locBtn setStyleNameAndApply: @"ButtonFollowAndRotateCompass"]; break;
|
||||
case MWMMyPositionModeFollowAndRotateRoute: [locBtn setStyleNameAndApply: @"ButtonFollowAndRotateRoute"]; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -632,7 +632,8 @@ NSString *const kAboutSegue = @"Map2About";
|
||||
case MWMMyPositionModeNotFollow:
|
||||
break;
|
||||
case MWMMyPositionModeFollow:
|
||||
case MWMMyPositionModeFollowAndRotate:
|
||||
case MWMMyPositionModeFollowAndRotateCompass:
|
||||
case MWMMyPositionModeFollowAndRotateRoute:
|
||||
self.disableStandbyOnLocationStateMode = YES;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,8 @@ static inline MWMMyPositionMode mwmMyPositionMode(location::EMyPositionMode mode
|
||||
case location::EMyPositionMode::NotFollowNoPosition: return MWMMyPositionModeNotFollowNoPosition;
|
||||
case location::EMyPositionMode::NotFollow: return MWMMyPositionModeNotFollow;
|
||||
case location::EMyPositionMode::Follow: return MWMMyPositionModeFollow;
|
||||
case location::EMyPositionMode::FollowAndRotate: return MWMMyPositionModeFollowAndRotate;
|
||||
case location::EMyPositionMode::FollowAndRotateCompass: return MWMMyPositionModeFollowAndRotateCompass;
|
||||
case location::EMyPositionMode::FollowAndRotateRoute: return MWMMyPositionModeFollowAndRotateRoute;
|
||||
}
|
||||
}
|
||||
} // namespace location_helpers
|
||||
|
||||
@@ -50,7 +50,8 @@ std::string DebugPrint(MWMMyPositionMode mode) {
|
||||
case MWMMyPositionModeNotFollowNoPosition: return "MWMMyPositionModeNotFollowNoPosition";
|
||||
case MWMMyPositionModeNotFollow: return "MWMMyPositionModeNotFollow";
|
||||
case MWMMyPositionModeFollow: return "MWMMyPositionModeFollow";
|
||||
case MWMMyPositionModeFollowAndRotate: return "MWMMyPositionModeFollowAndRotate";
|
||||
case MWMMyPositionModeFollowAndRotateCompass: return "MWMMyPositionModeFollowAndRotateCompass";
|
||||
case MWMMyPositionModeFollowAndRotateRoute: return "MWMMyPositionModeFollowAndRotateRoute";
|
||||
}
|
||||
CHECK(false, ("Unsupported value", static_cast<int>(mode)));
|
||||
}
|
||||
@@ -367,7 +368,8 @@ void setShowLocationAlert(BOOL needShow) {
|
||||
case MWMMyPositionModeNotFollowNoPosition:
|
||||
case MWMMyPositionModeNotFollow: manager.geoMode = GeoMode::NotInPosition; break;
|
||||
case MWMMyPositionModeFollow: manager.geoMode = GeoMode::InPosition; break;
|
||||
case MWMMyPositionModeFollowAndRotate: manager.geoMode = GeoMode::FollowAndRotate; break;
|
||||
case MWMMyPositionModeFollowAndRotateCompass:
|
||||
case MWMMyPositionModeFollowAndRotateRoute: manager.geoMode = GeoMode::FollowAndRotate; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ NSUInteger constexpr kMaxPredictionCount = 20;
|
||||
|
||||
- (void)setMyPositionMode:(MWMMyPositionMode)mode
|
||||
{
|
||||
self.isLastPositionModeValid = (mode == MWMMyPositionModeFollowAndRotate);
|
||||
self.isLastPositionModeValid = (mode == MWMMyPositionModeFollowAndRotateCompass);
|
||||
[self restart];
|
||||
}
|
||||
|
||||
|
||||
@@ -3,5 +3,6 @@ typedef NS_CLOSED_ENUM(NSUInteger, MWMMyPositionMode) {
|
||||
MWMMyPositionModeNotFollowNoPosition,
|
||||
MWMMyPositionModeNotFollow,
|
||||
MWMMyPositionModeFollow,
|
||||
MWMMyPositionModeFollowAndRotate
|
||||
MWMMyPositionModeFollowAndRotateCompass,
|
||||
MWMMyPositionModeFollowAndRotateRoute
|
||||
};
|
||||
|
||||
@@ -41,13 +41,14 @@ final class ThemeManager: NSObject {
|
||||
}
|
||||
}(actualTheme)
|
||||
|
||||
if Settings.mapAppearance == .light {
|
||||
let isCarPlayActive = CarPlayService.shared.isCarplayActivated
|
||||
if !isCarPlayActive, Settings.mapAppearance == .light {
|
||||
if actualTheme == .vehicleDay || actualTheme == .vehicleNight {
|
||||
FrameworkHelper.setTheme(.vehicleDay)
|
||||
} else {
|
||||
FrameworkHelper.setTheme(.day)
|
||||
}
|
||||
} else if Settings.mapAppearance == .dark {
|
||||
} else if !isCarPlayActive, Settings.mapAppearance == .dark {
|
||||
if actualTheme == .vehicleDay || actualTheme == .vehicleNight {
|
||||
FrameworkHelper.setTheme(.vehicleNight)
|
||||
} else {
|
||||
|
||||
@@ -7,7 +7,8 @@ enum MapStyleSheet: String, CaseIterable {
|
||||
case mapButtonPending = "ButtonPending"
|
||||
case mapButtonGetPosition = "ButtonGetPosition"
|
||||
case mapButtonFollow = "ButtonFollow"
|
||||
case mapButtonFollowAndRotate = "ButtonFollowAndRotate"
|
||||
case mapButtonFollowAndRotateCompass = "ButtonFollowAndRotateCompass"
|
||||
case mapButtonFollowAndRotateRoute = "ButtonFollowAndRotateRoute"
|
||||
case mapButtonMapBookmarks = "ButtonMapBookmarks"
|
||||
case mapPromoDiscoveryButton = "PromoDiscroveryButton"
|
||||
case mapButtonBookmarksBack = "ButtonBookmarksBack"
|
||||
@@ -67,10 +68,14 @@ extension MapStyleSheet: IStyleSheet {
|
||||
return .add { s in
|
||||
s.mwmImage = "btn_follow"
|
||||
}
|
||||
case .mapButtonFollowAndRotate:
|
||||
case .mapButtonFollowAndRotateCompass:
|
||||
return .add { s in
|
||||
s.mwmImage = "btn_follow_and_rotate"
|
||||
}
|
||||
case .mapButtonFollowAndRotateRoute:
|
||||
return .add { s in
|
||||
s.mwmImage = "btn_follow_route"
|
||||
}
|
||||
case .mapButtonMapBookmarks:
|
||||
return .add { s in
|
||||
s.mwmImage = "ic_routing_bookmark"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_dark.imageset/Contents.json
vendored
Normal file
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_dark.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "btn_follow_route_dark.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
iphone/Maps/Images.xcassets/Location/btn_follow_route_dark.imageset/btn_follow_route_dark.png
vendored
Normal file
BIN
iphone/Maps/Images.xcassets/Location/btn_follow_route_dark.imageset/btn_follow_route_dark.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_dark.imageset/Contents.json
vendored
Normal file
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_dark.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "btn_follow_route_highlighted_dark.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_light.imageset/Contents.json
vendored
Normal file
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_light.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "btn_follow_route_highlighted_light.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_light.imageset/Contents.json
vendored
Normal file
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_light.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "btn_follow_route_light.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
iphone/Maps/Images.xcassets/Location/btn_follow_route_light.imageset/btn_follow_route_light.png
vendored
Normal file
BIN
iphone/Maps/Images.xcassets/Location/btn_follow_route_light.imageset/btn_follow_route_light.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -189,7 +189,7 @@
|
||||
"type.amenity.shelter.basic_hut" = "Bivouac Hut";
|
||||
|
||||
/* A traditional 3-walled shelter (one side open), suitable for overnight camping. */
|
||||
"type.amenity.shelter.lean_to" = "Lean-to Shelter";
|
||||
"type.amenity.shelter.lean_to" = "Lean-to Sleep Shelter";
|
||||
"type.amenity.public_bath" = "Public Bath";
|
||||
"type.amenity.shower" = "Shower";
|
||||
"type.amenity.stripclub" = "Stripclub";
|
||||
@@ -208,7 +208,7 @@
|
||||
"type.amenity.vending_machine.food" = "Food Dispenser";
|
||||
"type.amenity.vending_machine.newspapers" = "Newspaper Dispenser";
|
||||
"type.amenity.vending_machine.parking_tickets" = "Parking Meter";
|
||||
"type.amenity.vending_machine.public_transport_tickets" = "Ticket Machine";
|
||||
"type.amenity.vending_machine.public_transport_tickets" = "Public Transport Ticket Machine";
|
||||
"type.amenity.vending_machine.sweets" = "Sweets Dispenser";
|
||||
"type.amenity.vending_machine.excrement_bags" = "Excrement Bags Dispenser";
|
||||
"type.amenity.parcel_locker" = "Parcel Locker";
|
||||
|
||||
@@ -186,7 +186,7 @@ import AVFoundation
|
||||
return mapAppearance
|
||||
}
|
||||
|
||||
return .auto
|
||||
return .light
|
||||
}
|
||||
set {
|
||||
UserDefaults.standard.set(newValue.rawValue, forKey: userDefaultsKeyMapAppearance)
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "drape/support_manager.hpp"
|
||||
|
||||
#include "platform/settings.hpp"
|
||||
#include "routing/base/followed_polyline.hpp"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
@@ -40,7 +41,7 @@ DrapeEngine::DrapeEngine(Params && params)
|
||||
|
||||
using namespace location;
|
||||
EMyPositionMode mode = PendingPosition;
|
||||
if (settings::Get(kLocationStateMode, mode) && mode == FollowAndRotate)
|
||||
if (settings::Get(kLocationStateMode, mode) && mode == FollowAndRotateCompass)
|
||||
{
|
||||
// If the screen rect setting in follow and rotate mode is missing or invalid, it could cause
|
||||
// invalid animations, so the follow and rotate mode should be discarded.
|
||||
@@ -441,13 +442,12 @@ void DrapeEngine::SetCompassInfo(location::CompassInfo const & info)
|
||||
MessagePriority::Normal);
|
||||
}
|
||||
|
||||
void DrapeEngine::SetGpsInfo(location::GpsInfo const & info, bool isNavigable, double distToNextTurn, double speedLimit,
|
||||
void DrapeEngine::SetGpsInfo(location::GpsInfo const & info, df::NavigationContext const & navigationContext,
|
||||
location::RouteMatchingInfo const & routeInfo)
|
||||
{
|
||||
m_threadCommutator->PostMessage(
|
||||
ThreadsCommutator::RenderThread,
|
||||
make_unique_dp<GpsInfoMessage>(info, isNavigable, distToNextTurn, speedLimit, routeInfo),
|
||||
MessagePriority::Normal);
|
||||
m_threadCommutator->PostMessage(ThreadsCommutator::RenderThread,
|
||||
make_unique_dp<GpsInfoMessage>(info, navigationContext, routeInfo),
|
||||
MessagePriority::Normal);
|
||||
}
|
||||
|
||||
void DrapeEngine::SwitchMyPositionNextMode()
|
||||
@@ -474,12 +474,13 @@ void DrapeEngine::StopLocationFollow()
|
||||
MessagePriority::Normal);
|
||||
}
|
||||
|
||||
void DrapeEngine::FollowRoute(int preferredZoomLevel, int preferredZoomLevel3d, bool enableAutoZoom, bool isArrowGlued)
|
||||
void DrapeEngine::FollowRoute(int preferredZoomLevel, int preferredZoomLevel3d, bool enableAutoZoom, bool isArrowGlued,
|
||||
bool allowRouteRotation)
|
||||
{
|
||||
m_threadCommutator->PostMessage(
|
||||
ThreadsCommutator::RenderThread,
|
||||
make_unique_dp<FollowRouteMessage>(preferredZoomLevel, preferredZoomLevel3d, enableAutoZoom, isArrowGlued),
|
||||
MessagePriority::Normal);
|
||||
m_threadCommutator->PostMessage(ThreadsCommutator::RenderThread,
|
||||
make_unique_dp<FollowRouteMessage>(preferredZoomLevel, preferredZoomLevel3d,
|
||||
enableAutoZoom, isArrowGlued, allowRouteRotation),
|
||||
MessagePriority::Normal);
|
||||
}
|
||||
|
||||
void DrapeEngine::SetModelViewListener(ModelViewChangedHandler && fn)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "drape_frontend/my_position_controller.hpp"
|
||||
#include "routing/base/followed_polyline.hpp"
|
||||
#include "traffic/traffic_info.hpp"
|
||||
|
||||
#include "drape_frontend/backend_renderer.hpp"
|
||||
@@ -154,7 +156,7 @@ public:
|
||||
void UpdateMapStyle();
|
||||
|
||||
void SetCompassInfo(location::CompassInfo const & info);
|
||||
void SetGpsInfo(location::GpsInfo const & info, bool isNavigable, double distToNextTurn, double speedLimit,
|
||||
void SetGpsInfo(location::GpsInfo const & info, df::NavigationContext const & navigationContext,
|
||||
location::RouteMatchingInfo const & routeInfo);
|
||||
void SwitchMyPositionNextMode();
|
||||
void LoseLocation();
|
||||
@@ -171,7 +173,8 @@ public:
|
||||
|
||||
dp::DrapeID AddSubroute(SubrouteConstPtr subroute);
|
||||
void RemoveSubroute(dp::DrapeID subrouteId, bool deactivateFollowing);
|
||||
void FollowRoute(int preferredZoomLevel, int preferredZoomLevel3d, bool enableAutoZoom, bool isArrowGlued);
|
||||
void FollowRoute(int preferredZoomLevel, int preferredZoomLevel3d, bool enableAutoZoom, bool isArrowGlued,
|
||||
bool allowRouteRotation);
|
||||
void DeactivateRouteFollowing();
|
||||
void SetSubrouteVisibility(dp::DrapeID subrouteId, bool isVisible);
|
||||
dp::DrapeID AddRoutePreviewSegment(m2::PointD const & startPt, m2::PointD const & finishPt);
|
||||
|
||||
@@ -438,8 +438,8 @@ void FrontendRenderer::AcceptMessage(ref_ptr<Message> message)
|
||||
break;
|
||||
#endif
|
||||
ref_ptr<GpsInfoMessage> msg = message;
|
||||
m_myPositionController->OnLocationUpdate(msg->GetInfo(), msg->IsNavigable(), msg->GetDistanceToNextTurn(),
|
||||
msg->GetSpeedLimit(), m_userEventStream.GetCurrentScreen());
|
||||
m_myPositionController->OnLocationUpdate(msg->GetInfo(), msg->GetNavigationContext(),
|
||||
m_userEventStream.GetCurrentScreen());
|
||||
|
||||
location::RouteMatchingInfo const & info = msg->GetRouteInfo();
|
||||
if (info.HasDistanceFromBegin())
|
||||
@@ -512,7 +512,8 @@ void FrontendRenderer::AcceptMessage(ref_ptr<Message> message)
|
||||
if (m_pendingFollowRoute != nullptr)
|
||||
{
|
||||
FollowRoute(m_pendingFollowRoute->m_preferredZoomLevel, m_pendingFollowRoute->m_preferredZoomLevelIn3d,
|
||||
m_pendingFollowRoute->m_enableAutoZoom, m_pendingFollowRoute->m_isArrowGlued);
|
||||
m_pendingFollowRoute->m_enableAutoZoom, m_pendingFollowRoute->m_isArrowGlued,
|
||||
m_pendingFollowRoute->m_allowRouteRotation);
|
||||
m_pendingFollowRoute.reset();
|
||||
}
|
||||
break;
|
||||
@@ -584,13 +585,14 @@ void FrontendRenderer::AcceptMessage(ref_ptr<Message> message)
|
||||
// receive FollowRoute message before FlushSubroute message, so we need to postpone its processing.
|
||||
if (m_routeRenderer->GetSubroutes().empty())
|
||||
{
|
||||
m_pendingFollowRoute = std::make_unique<FollowRouteData>(
|
||||
msg->GetPreferredZoomLevel(), msg->GetPreferredZoomLevelIn3d(), msg->EnableAutoZoom(), msg->IsArrowGlued());
|
||||
m_pendingFollowRoute =
|
||||
std::make_unique<FollowRouteData>(msg->GetPreferredZoomLevel(), msg->GetPreferredZoomLevelIn3d(),
|
||||
msg->EnableAutoZoom(), msg->IsArrowGlued(), msg->AllowRouteRotation());
|
||||
}
|
||||
else
|
||||
{
|
||||
FollowRoute(msg->GetPreferredZoomLevel(), msg->GetPreferredZoomLevelIn3d(), msg->EnableAutoZoom(),
|
||||
msg->IsArrowGlued());
|
||||
msg->IsArrowGlued(), msg->AllowRouteRotation());
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1057,10 +1059,11 @@ void FrontendRenderer::UpdateContextDependentResources()
|
||||
}
|
||||
|
||||
void FrontendRenderer::FollowRoute(int preferredZoomLevel, int preferredZoomLevelIn3d, bool enableAutoZoom,
|
||||
bool isArrowGlued)
|
||||
bool isArrowGlued, bool allowRouteRotation)
|
||||
{
|
||||
m_myPositionController->ActivateRouting(
|
||||
!m_enablePerspectiveInNavigation ? preferredZoomLevel : preferredZoomLevelIn3d, enableAutoZoom, isArrowGlued);
|
||||
!m_enablePerspectiveInNavigation ? preferredZoomLevel : preferredZoomLevelIn3d, enableAutoZoom, isArrowGlued,
|
||||
allowRouteRotation);
|
||||
|
||||
if (m_enablePerspectiveInNavigation)
|
||||
AddUserEvent(make_unique_dp<SetAutoPerspectiveEvent>(true /* isAutoPerspective */));
|
||||
|
||||
@@ -261,7 +261,8 @@ private:
|
||||
using TRenderGroupRemovePredicate = std::function<bool(drape_ptr<RenderGroup> const &)>;
|
||||
void RemoveRenderGroupsLater(TRenderGroupRemovePredicate const & predicate);
|
||||
|
||||
void FollowRoute(int preferredZoomLevel, int preferredZoomLevelIn3d, bool enableAutoZoom, bool isArrowGlued);
|
||||
void FollowRoute(int preferredZoomLevel, int preferredZoomLevelIn3d, bool enableAutoZoom, bool isArrowGlued,
|
||||
bool allowRouteRotation);
|
||||
|
||||
bool CheckRouteRecaching(ref_ptr<BaseSubrouteData> subrouteData);
|
||||
|
||||
@@ -372,17 +373,20 @@ private:
|
||||
|
||||
struct FollowRouteData
|
||||
{
|
||||
FollowRouteData(int preferredZoomLevel, int preferredZoomLevelIn3d, bool enableAutoZoom, bool isArrowGlued)
|
||||
FollowRouteData(int preferredZoomLevel, int preferredZoomLevelIn3d, bool enableAutoZoom, bool isArrowGlued,
|
||||
bool allowRouteRotation)
|
||||
: m_preferredZoomLevel(preferredZoomLevel)
|
||||
, m_preferredZoomLevelIn3d(preferredZoomLevelIn3d)
|
||||
, m_enableAutoZoom(enableAutoZoom)
|
||||
, m_isArrowGlued(isArrowGlued)
|
||||
, m_allowRouteRotation(allowRouteRotation)
|
||||
{}
|
||||
|
||||
int m_preferredZoomLevel;
|
||||
int m_preferredZoomLevelIn3d;
|
||||
bool m_enableAutoZoom;
|
||||
bool m_isArrowGlued;
|
||||
bool m_allowRouteRotation;
|
||||
};
|
||||
|
||||
std::unique_ptr<FollowRouteData> m_pendingFollowRoute;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "drape_frontend/gui/skin.hpp"
|
||||
#include "drape_frontend/message.hpp"
|
||||
#include "drape_frontend/my_position.hpp"
|
||||
#include "drape_frontend/my_position_controller.hpp"
|
||||
#include "drape_frontend/overlay_batcher.hpp"
|
||||
#include "drape_frontend/postprocess_renderer.hpp"
|
||||
#include "drape_frontend/render_node.hpp"
|
||||
@@ -29,6 +30,7 @@
|
||||
|
||||
#include "geometry/rect2d.hpp"
|
||||
#include "geometry/triangle2d.hpp"
|
||||
#include "routing/base/followed_polyline.hpp"
|
||||
|
||||
#include <condition_variable>
|
||||
#include <functional>
|
||||
@@ -475,28 +477,22 @@ private:
|
||||
class GpsInfoMessage : public Message
|
||||
{
|
||||
public:
|
||||
GpsInfoMessage(location::GpsInfo const & info, bool isNavigable, double distToNextTurn, double speedLimit,
|
||||
GpsInfoMessage(location::GpsInfo const & info, df::NavigationContext const & navigationContext,
|
||||
location::RouteMatchingInfo const & routeInfo)
|
||||
: m_info(info)
|
||||
, m_isNavigable(isNavigable)
|
||||
, m_distToNextTurn(distToNextTurn)
|
||||
, m_speedLimit(speedLimit)
|
||||
, m_navigationContext(navigationContext)
|
||||
, m_routeInfo(routeInfo)
|
||||
{}
|
||||
|
||||
Type GetType() const override { return Type::GpsInfo; }
|
||||
|
||||
location::GpsInfo const & GetInfo() const { return m_info; }
|
||||
bool IsNavigable() const { return m_isNavigable; }
|
||||
double const & GetSpeedLimit() const { return m_speedLimit; }
|
||||
double const & GetDistanceToNextTurn() const { return m_distToNextTurn; }
|
||||
df::NavigationContext const & GetNavigationContext() const { return m_navigationContext; }
|
||||
location::RouteMatchingInfo const & GetRouteInfo() const { return m_routeInfo; }
|
||||
|
||||
private:
|
||||
location::GpsInfo const m_info;
|
||||
bool const m_isNavigable;
|
||||
double const m_distToNextTurn;
|
||||
double const m_speedLimit;
|
||||
df::NavigationContext const m_navigationContext;
|
||||
location::RouteMatchingInfo const m_routeInfo;
|
||||
};
|
||||
|
||||
@@ -740,11 +736,13 @@ public:
|
||||
class FollowRouteMessage : public Message
|
||||
{
|
||||
public:
|
||||
FollowRouteMessage(int preferredZoomLevel, int preferredZoomLevelIn3d, bool enableAutoZoom, bool isArrowGlued)
|
||||
FollowRouteMessage(int preferredZoomLevel, int preferredZoomLevelIn3d, bool enableAutoZoom, bool isArrowGlued,
|
||||
bool allowRouteRotation)
|
||||
: m_preferredZoomLevel(preferredZoomLevel)
|
||||
, m_preferredZoomLevelIn3d(preferredZoomLevelIn3d)
|
||||
, m_enableAutoZoom(enableAutoZoom)
|
||||
, m_isArrowGlued(isArrowGlued)
|
||||
, m_allowRouteRotation(allowRouteRotation)
|
||||
{}
|
||||
|
||||
Type GetType() const override { return Type::FollowRoute; }
|
||||
@@ -753,12 +751,14 @@ public:
|
||||
int GetPreferredZoomLevelIn3d() const { return m_preferredZoomLevelIn3d; }
|
||||
bool EnableAutoZoom() const { return m_enableAutoZoom; }
|
||||
bool IsArrowGlued() const { return m_isArrowGlued; }
|
||||
bool AllowRouteRotation() const { return m_allowRouteRotation; }
|
||||
|
||||
private:
|
||||
int const m_preferredZoomLevel;
|
||||
int const m_preferredZoomLevelIn3d;
|
||||
bool const m_enableAutoZoom;
|
||||
bool const m_isArrowGlued;
|
||||
bool const m_allowRouteRotation;
|
||||
};
|
||||
|
||||
class SwitchMapStyleMessage : public BaseBlockingMessage
|
||||
|
||||
@@ -9,9 +9,11 @@
|
||||
|
||||
#include "geometry/mercator.hpp"
|
||||
|
||||
#include "platform/location.hpp"
|
||||
#include "platform/measurement_utils.hpp"
|
||||
|
||||
#include "base/math.hpp"
|
||||
#include "routing/base/followed_polyline.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
@@ -31,6 +33,9 @@ double constexpr kMaxTimeInBackgroundSec = 60.0 * 60 * 30; // 30 hours before s
|
||||
double constexpr kMaxNotFollowRoutingTimeSec = 20.0;
|
||||
double constexpr kMaxUpdateLocationInvervalSec = 30.0;
|
||||
double constexpr kMaxBlockAutoZoomTimeSec = 10.0;
|
||||
double constexpr kDefaultSpeedLimitKmpH = 50.0;
|
||||
double constexpr kLookaheadTimeSpeedRatio = 0.3;
|
||||
double constexpr kMaxLookaheadTimeSec = 25.0;
|
||||
|
||||
int constexpr kZoomThreshold = 10;
|
||||
int constexpr kMaxScaleZoomLevel = 16;
|
||||
@@ -66,7 +71,6 @@ double CalculateZoomByMaxSpeed(double speedMpS, bool isPerspectiveAllowed)
|
||||
|
||||
std::array<TSpeedScale, 2> const & scales = isPerspectiveAllowed ? scales3d : scales2d;
|
||||
|
||||
double constexpr kDefaultSpeedLimitKmpH = 50.0;
|
||||
double const speedKmpH = speedMpS > 0 ? measurement_utils::MpsToKmph(speedMpS) : kDefaultSpeedLimitKmpH;
|
||||
|
||||
size_t i = 0;
|
||||
@@ -143,7 +147,7 @@ void ResetNotification(uint64_t & notifyId)
|
||||
|
||||
bool IsModeChangeViewport(location::EMyPositionMode mode)
|
||||
{
|
||||
return mode == location::Follow || mode == location::FollowAndRotate;
|
||||
return mode == location::Follow || mode == location::FollowAndRotateCompass || mode == location::FollowAndRotateRoute;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -157,9 +161,11 @@ MyPositionController::MyPositionController(Params && params, ref_ptr<DrapeNotifi
|
||||
, m_errorRadius(0.0)
|
||||
, m_horizontalAccuracy(0.0)
|
||||
, m_position(m2::PointD::Zero())
|
||||
, m_drawDirection(0.0)
|
||||
, m_direction(0.0)
|
||||
, m_routeDirection(0.0)
|
||||
, m_arrowDirection(0.0)
|
||||
, m_oldPosition(m2::PointD::Zero())
|
||||
, m_oldDrawDirection(0.0)
|
||||
, m_oldArrowDirection(0.0)
|
||||
, m_enablePerspectiveInRouting(false)
|
||||
, m_enableAutoZoomInRouting(params.m_isAutozoomEnabled)
|
||||
, m_autoScale2d(GetScreenScale(kDefaultAutoZoom))
|
||||
@@ -171,7 +177,8 @@ MyPositionController::MyPositionController(Params && params, ref_ptr<DrapeNotifi
|
||||
, m_isDirtyAutoZoom(false)
|
||||
, m_isPendingAnimation(false)
|
||||
, m_isPositionAssigned(false)
|
||||
, m_isDirectionAssigned(false)
|
||||
, m_isArrowDirectionAssigned(false)
|
||||
, m_isRouteDirectionAssigned(false)
|
||||
, m_isCompassAvailable(false)
|
||||
, m_positionIsObsolete(false)
|
||||
, m_needBlockAutoZoom(false)
|
||||
@@ -290,7 +297,7 @@ void MyPositionController::ScaleEnded()
|
||||
|
||||
void MyPositionController::Rotated()
|
||||
{
|
||||
if (m_mode == location::FollowAndRotate)
|
||||
if (m_mode == location::FollowAndRotateCompass)
|
||||
m_wasRotationInScaling = true;
|
||||
}
|
||||
|
||||
@@ -398,25 +405,32 @@ void MyPositionController::NextMode(ScreenBase const & screen)
|
||||
// In routing not-follow -> follow-and-rotate, otherwise not-follow -> follow.
|
||||
if (m_mode == location::NotFollow)
|
||||
{
|
||||
ChangeMode(m_isInRouting ? location::FollowAndRotate : location::Follow);
|
||||
ChangeMode(m_isInRouting ? location::FollowAndRotateCompass : location::Follow);
|
||||
UpdateViewport(preferredZoomLevel);
|
||||
return;
|
||||
}
|
||||
|
||||
// From follow mode we transit to follow-and-rotate if compass is available or
|
||||
// routing is enabled.
|
||||
// From follow mode we transit to follow-and-rotate-compass, if in routing
|
||||
if (m_mode == location::Follow)
|
||||
{
|
||||
if (IsRotationAvailable() || m_isInRouting)
|
||||
if (IsArrowRotationAvailable() || m_isInRouting)
|
||||
{
|
||||
ChangeMode(location::FollowAndRotate);
|
||||
ChangeMode(location::FollowAndRotateCompass);
|
||||
UpdateViewport(preferredZoomLevel);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// From follow-and-rotate mode we can transit to follow mode.
|
||||
if (m_mode == location::FollowAndRotate)
|
||||
// From -rotate-compass mode we transit to -rotate-route mode, if allowed
|
||||
if (m_mode == location::FollowAndRotateCompass && IsRouteRotationAvailable() && m_allowRouteRotationInRouting)
|
||||
{
|
||||
ChangeMode(location::FollowAndRotateRoute);
|
||||
UpdateViewport(preferredZoomLevel);
|
||||
return;
|
||||
}
|
||||
|
||||
// From -rotate-route mode, or from -rotate-compass if -rotate-route is not allowed, we return to follow mode
|
||||
if (m_mode == location::FollowAndRotateRoute || m_mode == location::FollowAndRotateCompass)
|
||||
{
|
||||
if (m_isInRouting && screen.isPerspective())
|
||||
preferredZoomLevel = static_cast<int>(GetZoomLevel(ScreenBase::GetStartPerspectiveScale() * 1.1));
|
||||
@@ -425,8 +439,8 @@ void MyPositionController::NextMode(ScreenBase const & screen)
|
||||
}
|
||||
}
|
||||
|
||||
void MyPositionController::OnLocationUpdate(location::GpsInfo const & info, bool isNavigable, double distanceToNextTurn,
|
||||
double speedLimit, ScreenBase const & screen)
|
||||
void MyPositionController::OnLocationUpdate(location::GpsInfo const & info,
|
||||
df::NavigationContext const & navigationContext, ScreenBase const & screen)
|
||||
{
|
||||
m2::PointD const oldPos = GetDrawablePosition();
|
||||
double const oldAzimut = GetDrawableAzimut();
|
||||
@@ -438,33 +452,62 @@ void MyPositionController::OnLocationUpdate(location::GpsInfo const & info, bool
|
||||
m_errorRadius = rect.SizeX() * 0.5;
|
||||
m_horizontalAccuracy = info.m_horizontalAccuracy;
|
||||
|
||||
if (distanceToNextTurn >= 0.0 || speedLimit >= 0.0)
|
||||
if (navigationContext.m_distanceToNextTurn >= 0.0 || navigationContext.m_speedLimit >= 0.0)
|
||||
{
|
||||
double const mercatorPerMeter = m_errorRadius / info.m_horizontalAccuracy;
|
||||
m_autoScale2d =
|
||||
mercatorPerMeter * CalculateAutoZoom(speedLimit, distanceToNextTurn, false /* isPerspectiveAllowed */);
|
||||
mercatorPerMeter * CalculateAutoZoom(navigationContext.m_speedLimit, navigationContext.m_distanceToNextTurn,
|
||||
false /* isPerspectiveAllowed */);
|
||||
m_autoScale3d =
|
||||
mercatorPerMeter * CalculateAutoZoom(speedLimit, distanceToNextTurn, true /* isPerspectiveAllowed */);
|
||||
mercatorPerMeter * CalculateAutoZoom(navigationContext.m_speedLimit, navigationContext.m_distanceToNextTurn,
|
||||
true /* isPerspectiveAllowed */);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_autoScale2d = m_autoScale3d = kUnknownAutoZoom;
|
||||
}
|
||||
|
||||
// Sets direction based on GPS if:
|
||||
// Sets arrow direction based on GPS if:
|
||||
// 1. Compass is not available.
|
||||
// 2. Direction must be glued to the route during routing (route-corrected angle is set only in
|
||||
// OnLocationUpdate(): in OnCompassUpdate() the angle always has the original value.
|
||||
// 3. Device is moving faster then pedestrian.
|
||||
bool const isMovingFast = info.HasSpeed() && info.m_speed > kMinSpeedThresholdMps;
|
||||
bool const glueArrowInRouting = isNavigable && m_isArrowGluedInRouting;
|
||||
bool const glueArrowInRouting = navigationContext.m_isNavigable && m_isArrowGluedInRouting;
|
||||
|
||||
// Calculate the route direction by looking ahead a distance in the route
|
||||
// depending on the current speed
|
||||
if (glueArrowInRouting && navigationContext.m_followedPolyline != nullptr)
|
||||
{
|
||||
double const speed =
|
||||
(navigationContext.m_speedLimit > 0 ? measurement_utils::MpsToKmph(navigationContext.m_speedLimit)
|
||||
: kDefaultSpeedLimitKmpH);
|
||||
double const lookaheadTimeSec = std::min(speed * kLookaheadTimeSpeedRatio, kMaxLookaheadTimeSec);
|
||||
double const lookaheadDistance = std::min(speed * lookaheadTimeSec, navigationContext.m_distanceToNextTurn);
|
||||
|
||||
auto const & iter = navigationContext.m_followedPolyline->GetCurrentIter();
|
||||
m2::PointD const point = navigationContext.m_followedPolyline->GetLookaheadPoint(lookaheadDistance);
|
||||
|
||||
auto angle = math::RadToDeg(ang::AngleTo(iter.m_pt, point));
|
||||
if (std::isnan(angle) || std::isinf(angle))
|
||||
{
|
||||
// fallback in case the current route becomes invalid for any reason
|
||||
SetRouteDirection(info.m_bearing);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetRouteDirection(math::DegToRad(location::AngleToBearing(angle)));
|
||||
}
|
||||
}
|
||||
|
||||
if ((!m_isCompassAvailable || glueArrowInRouting || isMovingFast) && info.HasBearing())
|
||||
{
|
||||
SetDirection(math::DegToRad(info.m_bearing));
|
||||
SetArrowDirection(math::DegToRad(info.m_bearing));
|
||||
m_lastGPSBearingTimer.Reset();
|
||||
}
|
||||
|
||||
m_direction = m_mode == location::FollowAndRotateRoute ? m_routeDirection : m_arrowDirection;
|
||||
|
||||
if (m_isPositionAssigned && (!AlmostCurrentPosition(oldPos) || !AlmostCurrentAzimut(oldAzimut)))
|
||||
{
|
||||
CreateAnim(oldPos, oldAzimut, screen);
|
||||
@@ -487,9 +530,9 @@ void MyPositionController::OnLocationUpdate(location::GpsInfo const & info, bool
|
||||
{
|
||||
ChangeModelView(m_position, kDoNotChangeZoom);
|
||||
}
|
||||
else if (m_mode == location::FollowAndRotate)
|
||||
else if (m_mode == location::FollowAndRotateCompass || m_mode == location::FollowAndRotateRoute)
|
||||
{
|
||||
ChangeModelView(m_position, m_drawDirection,
|
||||
ChangeModelView(m_position, m_direction,
|
||||
m_isInRouting ? GetRoutingRotationPixelCenter() : m_visiblePixelRect.Center(),
|
||||
kDoNotChangeZoom);
|
||||
}
|
||||
@@ -499,7 +542,7 @@ void MyPositionController::OnLocationUpdate(location::GpsInfo const & info, bool
|
||||
{
|
||||
if (m_isInRouting)
|
||||
{
|
||||
ChangeMode(location::FollowAndRotate);
|
||||
ChangeMode(location::FollowAndRotateCompass);
|
||||
UpdateViewport(kMaxScaleZoomLevel);
|
||||
}
|
||||
else
|
||||
@@ -525,7 +568,7 @@ void MyPositionController::OnLocationUpdate(location::GpsInfo const & info, bool
|
||||
{
|
||||
if (m_isInRouting)
|
||||
{
|
||||
ChangeMode(location::FollowAndRotate);
|
||||
ChangeMode(location::FollowAndRotateCompass);
|
||||
UpdateViewport(kMaxScaleZoomLevel);
|
||||
}
|
||||
else
|
||||
@@ -552,7 +595,8 @@ void MyPositionController::LoseLocation()
|
||||
{
|
||||
if (m_mode == location::NotFollowNoPosition)
|
||||
return;
|
||||
else if (m_mode == location::Follow || m_mode == location::FollowAndRotate)
|
||||
else if (m_mode == location::Follow || m_mode == location::FollowAndRotateCompass ||
|
||||
m_mode == location::FollowAndRotateRoute)
|
||||
ChangeMode(location::PendingPosition);
|
||||
else
|
||||
ChangeMode(location::NotFollowNoPosition);
|
||||
@@ -570,10 +614,11 @@ void MyPositionController::OnCompassUpdate(location::CompassInfo const & info, S
|
||||
if ((IsInRouting() && m_isArrowGluedInRouting) || existsFreshGpsBearing)
|
||||
return;
|
||||
|
||||
SetDirection(info.m_bearing);
|
||||
SetArrowDirection(info.m_bearing);
|
||||
|
||||
if (m_isPositionAssigned && !AlmostCurrentAzimut(oldAzimut) && m_mode == location::FollowAndRotate)
|
||||
if (m_isPositionAssigned && !AlmostCurrentAzimut(oldAzimut) && m_mode == location::FollowAndRotateCompass)
|
||||
{
|
||||
m_direction = info.m_bearing;
|
||||
CreateAnim(GetDrawablePosition(), oldAzimut, screen);
|
||||
m_isDirtyViewport = true;
|
||||
}
|
||||
@@ -582,10 +627,10 @@ void MyPositionController::OnCompassUpdate(location::CompassInfo const & info, S
|
||||
bool MyPositionController::UpdateViewportWithAutoZoom()
|
||||
{
|
||||
double const autoScale = m_enablePerspectiveInRouting ? m_autoScale3d : m_autoScale2d;
|
||||
if (autoScale > 0.0 && m_mode == location::FollowAndRotate && m_isInRouting && m_enableAutoZoomInRouting &&
|
||||
!m_needBlockAutoZoom)
|
||||
if (autoScale > 0.0 && (m_mode == location::FollowAndRotateCompass || m_mode == location::FollowAndRotateRoute) &&
|
||||
m_isInRouting && m_enableAutoZoomInRouting && !m_needBlockAutoZoom)
|
||||
{
|
||||
ChangeModelView(autoScale, m_position, m_drawDirection, GetRoutingRotationPixelCenter());
|
||||
ChangeModelView(autoScale, m_position, m_direction, GetRoutingRotationPixelCenter());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -617,7 +662,7 @@ void MyPositionController::Render(ref_ptr<dp::GraphicsContext> context, ref_ptr<
|
||||
m_shape->SetPositionObsolete(m_positionIsObsolete);
|
||||
m_shape->SetPosition(m2::PointF(GetDrawablePosition()));
|
||||
m_shape->SetAzimuth(static_cast<float>(GetDrawableAzimut()));
|
||||
m_shape->SetIsValidAzimuth(IsRotationAvailable());
|
||||
m_shape->SetIsValidAzimuth(IsArrowRotationAvailable());
|
||||
m_shape->SetAccuracy(static_cast<float>(m_errorRadius));
|
||||
m_shape->SetRoutingMode(IsInRouting());
|
||||
|
||||
@@ -631,7 +676,7 @@ void MyPositionController::Render(ref_ptr<dp::GraphicsContext> context, ref_ptr<
|
||||
|
||||
bool MyPositionController::IsRouteFollowingActive() const
|
||||
{
|
||||
return IsInRouting() && m_mode == location::FollowAndRotate;
|
||||
return IsInRouting() && m_mode == location::FollowAndRotateCompass;
|
||||
}
|
||||
|
||||
bool MyPositionController::AlmostCurrentPosition(m2::PointD const & pos) const
|
||||
@@ -643,18 +688,25 @@ bool MyPositionController::AlmostCurrentPosition(m2::PointD const & pos) const
|
||||
bool MyPositionController::AlmostCurrentAzimut(double azimut) const
|
||||
{
|
||||
double constexpr kDirectionEqualityDelta = 1e-3;
|
||||
return AlmostEqualAbs(azimut, m_drawDirection, kDirectionEqualityDelta);
|
||||
return AlmostEqualAbs(azimut, m_direction, kDirectionEqualityDelta);
|
||||
}
|
||||
|
||||
void MyPositionController::SetDirection(double bearing)
|
||||
void MyPositionController::SetRouteDirection(double bearing)
|
||||
{
|
||||
m_drawDirection = bearing;
|
||||
m_isDirectionAssigned = true;
|
||||
m_routeDirection = bearing;
|
||||
m_isRouteDirectionAssigned = true;
|
||||
}
|
||||
|
||||
void MyPositionController::SetArrowDirection(double bearing)
|
||||
{
|
||||
m_arrowDirection = bearing;
|
||||
m_isArrowDirectionAssigned = true;
|
||||
}
|
||||
|
||||
void MyPositionController::ChangeMode(location::EMyPositionMode newMode)
|
||||
{
|
||||
if (m_isInRouting && (m_mode != newMode) && (newMode == location::FollowAndRotate))
|
||||
if (m_isInRouting && (m_mode != newMode) &&
|
||||
(newMode == location::FollowAndRotateCompass || newMode == location::FollowAndRotateRoute))
|
||||
ResetBlockAutoZoomTimer();
|
||||
|
||||
m_mode = newMode;
|
||||
@@ -675,7 +727,8 @@ bool MyPositionController::IsWaitingForLocation() const
|
||||
|
||||
void MyPositionController::StopLocationFollow()
|
||||
{
|
||||
if (m_mode == location::Follow || m_mode == location::FollowAndRotate)
|
||||
if (m_mode == location::Follow || m_mode == location::FollowAndRotateCompass ||
|
||||
m_mode == location::FollowAndRotateRoute)
|
||||
ChangeMode(location::NotFollow);
|
||||
m_desiredInitMode = location::NotFollow;
|
||||
|
||||
@@ -690,7 +743,7 @@ void MyPositionController::OnEnterForeground(double backgroundTime)
|
||||
// When location was active during previous session the app will try to follow the user.
|
||||
if (m_mode == location::NotFollow)
|
||||
{
|
||||
ChangeMode(m_isInRouting ? location::FollowAndRotate : location::Follow);
|
||||
ChangeMode(m_isInRouting ? location::FollowAndRotateCompass : location::Follow);
|
||||
UpdateViewport(kDoNotChangeZoom);
|
||||
}
|
||||
|
||||
@@ -706,7 +759,7 @@ void MyPositionController::OnEnterBackground() {}
|
||||
|
||||
void MyPositionController::OnCompassTapped()
|
||||
{
|
||||
if (m_mode == location::FollowAndRotate)
|
||||
if (m_mode == location::FollowAndRotateCompass)
|
||||
{
|
||||
ChangeMode(location::Follow);
|
||||
ChangeModelView(m_position, 0.0, m_visiblePixelRect.Center(), kDoNotChangeZoom);
|
||||
@@ -763,9 +816,9 @@ void MyPositionController::UpdateViewport(int zoomLevel)
|
||||
{
|
||||
ChangeModelView(m_position, zoomLevel);
|
||||
}
|
||||
else if (m_mode == location::FollowAndRotate)
|
||||
else if (m_mode == location::FollowAndRotateCompass || m_mode == location::FollowAndRotateRoute)
|
||||
{
|
||||
ChangeModelView(m_position, m_drawDirection,
|
||||
ChangeModelView(m_position, m_direction,
|
||||
m_isInRouting ? GetRoutingRotationPixelCenter() : m_visiblePixelRect.Center(), zoomLevel);
|
||||
}
|
||||
}
|
||||
@@ -775,7 +828,7 @@ m2::PointD MyPositionController::GetRotationPixelCenter() const
|
||||
if (m_mode == location::Follow)
|
||||
return m_visiblePixelRect.Center();
|
||||
|
||||
if (m_mode == location::FollowAndRotate)
|
||||
if (m_mode == location::FollowAndRotateCompass || m_mode == location::FollowAndRotateRoute)
|
||||
return m_isInRouting ? GetRoutingRotationPixelCenter() : m_visiblePixelRect.Center();
|
||||
|
||||
return m2::PointD::Zero();
|
||||
@@ -817,15 +870,15 @@ double MyPositionController::GetDrawableAzimut()
|
||||
}
|
||||
|
||||
if (m_isPendingAnimation)
|
||||
return m_oldDrawDirection;
|
||||
return m_oldArrowDirection;
|
||||
|
||||
return m_drawDirection;
|
||||
return m_arrowDirection;
|
||||
}
|
||||
|
||||
void MyPositionController::CreateAnim(m2::PointD const & oldPos, double oldAzimut, ScreenBase const & screen)
|
||||
{
|
||||
double const moveDuration = PositionInterpolator::GetMoveDuration(oldPos, m_position, screen);
|
||||
double const rotateDuration = AngleInterpolator::GetRotateDuration(oldAzimut, m_drawDirection);
|
||||
double const rotateDuration = AngleInterpolator::GetRotateDuration(oldAzimut, m_arrowDirection);
|
||||
if (df::IsAnimationAllowed(std::max(moveDuration, rotateDuration), screen))
|
||||
{
|
||||
if (IsModeChangeViewport())
|
||||
@@ -834,7 +887,7 @@ void MyPositionController::CreateAnim(m2::PointD const & oldPos, double oldAzimu
|
||||
{
|
||||
drape_ptr<Animation> anim = make_unique_dp<ArrowAnimation>(
|
||||
GetDrawablePosition(), m_position, syncAnim == nullptr ? moveDuration : syncAnim->GetDuration(),
|
||||
GetDrawableAzimut(), m_drawDirection);
|
||||
GetDrawableAzimut(), m_arrowDirection);
|
||||
if (syncAnim != nullptr)
|
||||
{
|
||||
anim->SetMaxDuration(syncAnim->GetMaxDuration());
|
||||
@@ -843,13 +896,13 @@ void MyPositionController::CreateAnim(m2::PointD const & oldPos, double oldAzimu
|
||||
return anim;
|
||||
};
|
||||
m_oldPosition = oldPos;
|
||||
m_oldDrawDirection = oldAzimut;
|
||||
m_oldArrowDirection = oldAzimut;
|
||||
m_isPendingAnimation = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
AnimationSystem::Instance().CombineAnimation(
|
||||
make_unique_dp<ArrowAnimation>(oldPos, m_position, moveDuration, oldAzimut, m_drawDirection));
|
||||
make_unique_dp<ArrowAnimation>(oldPos, m_position, moveDuration, oldAzimut, m_arrowDirection));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -868,16 +921,18 @@ void MyPositionController::EnableAutoZoomInRouting(bool enableAutoZoom)
|
||||
}
|
||||
}
|
||||
|
||||
void MyPositionController::ActivateRouting(int zoomLevel, bool enableAutoZoom, bool isArrowGlued)
|
||||
void MyPositionController::ActivateRouting(int zoomLevel, bool enableAutoZoom, bool isArrowGlued,
|
||||
bool allowRouteRotation)
|
||||
{
|
||||
if (!m_isInRouting)
|
||||
{
|
||||
m_isInRouting = true;
|
||||
m_isArrowGluedInRouting = isArrowGlued;
|
||||
m_enableAutoZoomInRouting = enableAutoZoom;
|
||||
m_allowRouteRotationInRouting = allowRouteRotation;
|
||||
|
||||
ChangeMode(location::FollowAndRotate);
|
||||
ChangeModelView(m_position, m_isDirectionAssigned ? m_drawDirection : 0.0, GetRoutingRotationPixelCenter(),
|
||||
ChangeMode(location::FollowAndRotateCompass);
|
||||
ChangeModelView(m_position, m_isRouteDirectionAssigned ? m_routeDirection : 0.0, GetRoutingRotationPixelCenter(),
|
||||
zoomLevel, [this](ref_ptr<Animation> anim) { UpdateViewport(kDoNotChangeZoom); });
|
||||
ResetRoutingNotFollowTimer();
|
||||
}
|
||||
@@ -889,8 +944,10 @@ void MyPositionController::DeactivateRouting()
|
||||
{
|
||||
m_isInRouting = false;
|
||||
m_isArrowGluedInRouting = false;
|
||||
m_allowRouteRotationInRouting = false;
|
||||
|
||||
m_isDirectionAssigned = m_isCompassAvailable && m_isDirectionAssigned;
|
||||
m_isArrowDirectionAssigned = m_isCompassAvailable && m_isArrowDirectionAssigned;
|
||||
m_isRouteDirectionAssigned = false;
|
||||
|
||||
ChangeMode(location::Follow);
|
||||
ChangeModelView(m_position, 0.0, m_visiblePixelRect.Center(), kDoNotChangeZoom);
|
||||
@@ -919,7 +976,7 @@ void MyPositionController::CheckNotFollowRouting()
|
||||
CHECK_ON_TIMEOUT(m_routingNotFollowNotifyId, kMaxNotFollowRoutingTimeSec, CheckNotFollowRouting);
|
||||
if (m_routingNotFollowTimer.ElapsedSeconds() >= kMaxNotFollowRoutingTimeSec)
|
||||
{
|
||||
ChangeMode(location::FollowAndRotate);
|
||||
ChangeMode(location::FollowAndRotateCompass);
|
||||
UpdateViewport(kDoNotChangeZoom);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "drape/pointers.hpp"
|
||||
|
||||
#include "routing/base/followed_polyline.hpp"
|
||||
#include "shaders/program_manager.hpp"
|
||||
|
||||
#include "platform/location.hpp"
|
||||
@@ -24,6 +25,24 @@ using TAnimationCreator = std::function<drape_ptr<Animation>(ref_ptr<Animation>)
|
||||
|
||||
class DrapeNotifier;
|
||||
|
||||
struct NavigationContext
|
||||
{
|
||||
bool m_isNavigable = false;
|
||||
double m_distanceToNextTurn = 0.0;
|
||||
double m_speedLimit = 0.0;
|
||||
routing::FollowedPolyline const * m_followedPolyline = nullptr;
|
||||
|
||||
NavigationContext() = default;
|
||||
|
||||
NavigationContext(bool navigable, double distanceToTurn, double speedLimit,
|
||||
routing::FollowedPolyline const & followedPolyline)
|
||||
: m_isNavigable(navigable)
|
||||
, m_distanceToNextTurn(distanceToTurn)
|
||||
, m_speedLimit(speedLimit)
|
||||
, m_followedPolyline(&followedPolyline)
|
||||
{}
|
||||
};
|
||||
|
||||
class MyPositionController
|
||||
{
|
||||
public:
|
||||
@@ -102,7 +121,7 @@ public:
|
||||
drape_ptr<MyPosition> && shape, Arrow3d::PreloadedData && preloadedData);
|
||||
void ResetRenderShape();
|
||||
|
||||
void ActivateRouting(int zoomLevel, bool enableAutoZoom, bool isArrowGlued);
|
||||
void ActivateRouting(int zoomLevel, bool enableAutoZoom, bool isArrowGlued, bool allowRouteRotation);
|
||||
void DeactivateRouting();
|
||||
|
||||
void EnablePerspectiveInRouting(bool enablePerspective);
|
||||
@@ -117,14 +136,15 @@ public:
|
||||
void OnEnterBackground();
|
||||
|
||||
void OnCompassTapped();
|
||||
void OnLocationUpdate(location::GpsInfo const & info, bool isNavigable, double distanceToNextTurn, double speedLimit,
|
||||
void OnLocationUpdate(location::GpsInfo const & info, df::NavigationContext const & navigationContext,
|
||||
ScreenBase const & screen);
|
||||
void OnCompassUpdate(location::CompassInfo const & info, ScreenBase const & screen);
|
||||
|
||||
void Render(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng, ScreenBase const & screen,
|
||||
int zoomLevel, FrameValues const & frameValues);
|
||||
|
||||
bool IsRotationAvailable() const { return m_isDirectionAssigned; }
|
||||
bool IsArrowRotationAvailable() const { return m_isArrowDirectionAssigned; }
|
||||
bool IsRouteRotationAvailable() const { return m_isRouteDirectionAssigned; }
|
||||
bool IsInRouting() const { return m_isInRouting; }
|
||||
bool IsRouteFollowingActive() const;
|
||||
bool IsModeChangeViewport() const;
|
||||
@@ -135,7 +155,8 @@ public:
|
||||
|
||||
private:
|
||||
void ChangeMode(location::EMyPositionMode newMode);
|
||||
void SetDirection(double bearing);
|
||||
void SetRouteDirection(double bearing);
|
||||
void SetArrowDirection(double bearing);
|
||||
|
||||
void ChangeModelView(m2::PointD const & center, int zoomLevel);
|
||||
void ChangeModelView(double azimuth);
|
||||
@@ -178,12 +199,15 @@ private:
|
||||
double m_errorRadius; // error radius in mercator.
|
||||
double m_horizontalAccuracy;
|
||||
m2::PointD m_position; // position in mercator.
|
||||
double m_drawDirection;
|
||||
double m_direction;
|
||||
double m_routeDirection;
|
||||
double m_arrowDirection;
|
||||
m2::PointD m_oldPosition; // position in mercator.
|
||||
double m_oldDrawDirection;
|
||||
double m_oldArrowDirection;
|
||||
|
||||
bool m_enablePerspectiveInRouting;
|
||||
bool m_enableAutoZoomInRouting;
|
||||
bool m_allowRouteRotationInRouting;
|
||||
double m_autoScale2d;
|
||||
double m_autoScale3d;
|
||||
|
||||
@@ -205,7 +229,8 @@ private:
|
||||
TAnimationCreator m_animCreator;
|
||||
|
||||
bool m_isPositionAssigned;
|
||||
bool m_isDirectionAssigned;
|
||||
bool m_isArrowDirectionAssigned;
|
||||
bool m_isRouteDirectionAssigned;
|
||||
bool m_isCompassAvailable;
|
||||
|
||||
bool m_positionIsObsolete;
|
||||
|
||||
@@ -31,8 +31,8 @@ namespace df
|
||||
{
|
||||
namespace
|
||||
{
|
||||
uint64_t constexpr kDoubleTapPauseMs = 250;
|
||||
uint64_t constexpr kLongTouchMs = 500;
|
||||
uint64_t constexpr kDoubleTapPauseMs = 200;
|
||||
uint64_t constexpr kLongTouchMs = 700;
|
||||
uint64_t constexpr kKineticDelayMs = 500;
|
||||
|
||||
float constexpr kForceTapThreshold = 0.75;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "ge0/url_generator.hpp"
|
||||
|
||||
#include "platform/location.hpp"
|
||||
#include "routing/route.hpp"
|
||||
#include "routing/speed_camera_prohibition.hpp"
|
||||
|
||||
@@ -1453,7 +1454,7 @@ void Framework::CreateDrapeEngine(ref_ptr<dp::GraphicsContextFactory> contextFac
|
||||
GetPlatform().RunTask(Platform::Thread::Gui, [this, mode, routingActive]()
|
||||
{
|
||||
// Deactivate selection (and hide place page) if we return to routing in F&R mode.
|
||||
if (routingActive && mode == location::FollowAndRotate)
|
||||
if (routingActive && (mode == location::FollowAndRotateCompass || mode == location::FollowAndRotateRoute))
|
||||
DeactivateMapSelection();
|
||||
|
||||
if (m_myPositionListener != nullptr)
|
||||
@@ -3208,6 +3209,7 @@ void Framework::ReadFeatures(function<void(FeatureType &)> const & reader, vecto
|
||||
void Framework::OnRouteFollow(routing::RouterType type)
|
||||
{
|
||||
bool const isPedestrianRoute = type == RouterType::Pedestrian;
|
||||
bool const allowRouteRotation = type == RouterType::Vehicle;
|
||||
bool const enableAutoZoom = isPedestrianRoute ? false : LoadAutoZoom();
|
||||
int const scale = isPedestrianRoute ? scales::GetPedestrianNavigationScale() : scales::GetNavigationScale();
|
||||
int scale3d = isPedestrianRoute ? scales::GetPedestrianNavigation3dScale() : scales::GetNavigation3dScale();
|
||||
@@ -3223,7 +3225,7 @@ void Framework::OnRouteFollow(routing::RouterType type)
|
||||
// TODO. We need to sync two enums VehicleType and RouterType to be able to pass
|
||||
// GetRoutingSettings(type).m_matchRoute to the FollowRoute() instead of |isPedestrianRoute|.
|
||||
// |isArrowGlued| parameter fully corresponds to |m_matchRoute| in RoutingSettings.
|
||||
m_drapeEngine->FollowRoute(scale, scale3d, enableAutoZoom, !isPedestrianRoute /* isArrowGlued */);
|
||||
m_drapeEngine->FollowRoute(scale, scale3d, enableAutoZoom, !isPedestrianRoute /* isArrowGlued */, allowRouteRotation);
|
||||
}
|
||||
|
||||
// RoutingManager::Delegate
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
#include "routing_manager.hpp"
|
||||
|
||||
#include "drape_frontend/my_position_controller.hpp"
|
||||
#include "geometry/angles.hpp"
|
||||
#include "map/chart_generator.hpp"
|
||||
#include "map/routing_mark.hpp"
|
||||
|
||||
#include "routing/absent_regions_finder.hpp"
|
||||
#include "routing/base/followed_polyline.hpp"
|
||||
#include "routing/checkpoint_predictor.hpp"
|
||||
#include "routing/index_router.hpp"
|
||||
#include "routing/route.hpp"
|
||||
@@ -1170,9 +1173,9 @@ void RoutingManager::SetDrapeEngine(ref_ptr<df::DrapeEngine> engine, bool is3dAl
|
||||
if (m_gpsInfoCache != nullptr)
|
||||
{
|
||||
auto routeMatchingInfo = GetRouteMatchingInfo(*m_gpsInfoCache);
|
||||
m_drapeEngine.SafeCall(&df::DrapeEngine::SetGpsInfo, *m_gpsInfoCache, m_routingSession.IsNavigable(),
|
||||
m_routingSession.GetDistanceToNextTurn(), m_routingSession.GetCurrentSpeedLimit(),
|
||||
routeMatchingInfo);
|
||||
df::NavigationContext navigationContext(m_routingSession.IsNavigable(), m_routingSession.GetDistanceToNextTurn(),
|
||||
m_routingSession.GetCurrentSpeedLimit(), GetRoutePolyline());
|
||||
m_drapeEngine.SafeCall(&df::DrapeEngine::SetGpsInfo, *m_gpsInfoCache, navigationContext, routeMatchingInfo);
|
||||
m_gpsInfoCache.reset();
|
||||
}
|
||||
|
||||
@@ -1516,9 +1519,9 @@ void RoutingManager::OnExtrapolatedLocationUpdate(location::GpsInfo const & info
|
||||
m_gpsInfoCache = make_unique<location::GpsInfo>(gpsInfo);
|
||||
|
||||
auto routeMatchingInfo = GetRouteMatchingInfo(gpsInfo);
|
||||
m_drapeEngine.SafeCall(&df::DrapeEngine::SetGpsInfo, gpsInfo, m_routingSession.IsNavigable(),
|
||||
m_routingSession.GetDistanceToNextTurn(), m_routingSession.GetCurrentSpeedLimit(),
|
||||
routeMatchingInfo);
|
||||
df::NavigationContext navigationContext(m_routingSession.IsNavigable(), m_routingSession.GetDistanceToNextTurn(),
|
||||
m_routingSession.GetCurrentSpeedLimit(), GetRoutePolyline());
|
||||
m_drapeEngine.SafeCall(&df::DrapeEngine::SetGpsInfo, gpsInfo, navigationContext, routeMatchingInfo);
|
||||
}
|
||||
|
||||
void RoutingManager::DeleteSavedRoutePoints()
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace routing::turns::sound
|
||||
* - All other variants default to `zh-Hans` (Simplified Chinese).
|
||||
*
|
||||
*/
|
||||
std::array<std::pair<std::string_view, std::string_view>, 42> constexpr kLanguageList = {{
|
||||
std::array<std::pair<std::string_view, std::string_view>, 43> constexpr kLanguageList = {{
|
||||
{"en", "English"},
|
||||
{"id", "Bahasa Indonesia"},
|
||||
{"ca", "Català"},
|
||||
@@ -82,5 +82,6 @@ std::array<std::pair<std::string_view, std::string_view>, 42> constexpr kLanguag
|
||||
#endif
|
||||
{"ja", "日本語"},
|
||||
{"ko", "한국어"},
|
||||
{"ta", "தமிழ்"},
|
||||
}};
|
||||
} // namespace routing::turns::sound
|
||||
|
||||
@@ -139,7 +139,8 @@ enum EMyPositionMode
|
||||
NotFollowNoPosition,
|
||||
NotFollow,
|
||||
Follow,
|
||||
FollowAndRotate
|
||||
FollowAndRotateCompass,
|
||||
FollowAndRotateRoute
|
||||
};
|
||||
|
||||
using TMyPositionModeChanged = std::function<void(location::EMyPositionMode, bool)>;
|
||||
|
||||
@@ -308,7 +308,8 @@ string ToString<location::EMyPositionMode>(location::EMyPositionMode const & v)
|
||||
case location::NotFollow: return "NotFollow";
|
||||
case location::NotFollowNoPosition: return "NotFollowNoPosition";
|
||||
case location::Follow: return "Follow";
|
||||
case location::FollowAndRotate: return "FollowAndRotate";
|
||||
case location::FollowAndRotateCompass: return "FollowAndRotateCompass";
|
||||
case location::FollowAndRotateRoute: return "FollowAndRotateRoute";
|
||||
default: return "Pending";
|
||||
}
|
||||
}
|
||||
@@ -324,8 +325,10 @@ bool FromString<location::EMyPositionMode>(string const & s, location::EMyPositi
|
||||
v = location::NotFollowNoPosition;
|
||||
else if (s == "Follow")
|
||||
v = location::Follow;
|
||||
else if (s == "FollowAndRotate")
|
||||
v = location::FollowAndRotate;
|
||||
else if (s == "FollowAndRotateCompass")
|
||||
v = location::FollowAndRotateCompass;
|
||||
else if (s == "FollowAndRotateRoute")
|
||||
v = location::FollowAndRotateRoute;
|
||||
else
|
||||
return false;
|
||||
|
||||
|
||||
@@ -237,4 +237,34 @@ Iter FollowedPolyline::GetClosestMatchingProjectionInInterval(m2::RectD const &
|
||||
|
||||
return nearestIter;
|
||||
}
|
||||
|
||||
m2::PointD FollowedPolyline::GetLookaheadPoint(double lookaheadDistanceM) const
|
||||
{
|
||||
if (!IsValid())
|
||||
return m2::PointD();
|
||||
|
||||
size_t segmentIdx = m_current.m_ind;
|
||||
m2::PointD prev = m_current.m_pt;
|
||||
|
||||
size_t const maxSegmentIdx = m_poly.GetSize() - 1;
|
||||
double remaining = lookaheadDistanceM;
|
||||
|
||||
while (segmentIdx < maxSegmentIdx)
|
||||
{
|
||||
m2::PointD const & next = m_poly.GetPoint(segmentIdx + 1);
|
||||
double segLen = mercator::DistanceOnEarth(prev, next);
|
||||
|
||||
if (remaining <= segLen)
|
||||
{
|
||||
double t = remaining / segLen;
|
||||
return prev + (next - prev) * t;
|
||||
}
|
||||
|
||||
remaining -= segLen;
|
||||
prev = next;
|
||||
segmentIdx += 1;
|
||||
}
|
||||
|
||||
return m_poly.GetPoint(segmentIdx);
|
||||
}
|
||||
} // namespace routing
|
||||
|
||||
@@ -125,6 +125,9 @@ public:
|
||||
|
||||
bool IsFakeSegment(size_t index) const;
|
||||
|
||||
/// \brief Obtain a point |lookaheadDistanceM| meters along the current route
|
||||
m2::PointD GetLookaheadPoint(double lookaheadDistanceM) const;
|
||||
|
||||
private:
|
||||
/// \returns iterator to the best projection of center of |posRect| to the |m_poly|.
|
||||
/// If there's a good projection of center of |posRect| to two closest segments of |m_poly|
|
||||
|
||||
Reference in New Issue
Block a user