Compare commits

..

28 Commits

Author SHA1 Message Date
zyphlar
3c4ce1349c Clarify NOTICE
Being a fork of an Apache project with a NOTICE file that continues to merge in upstream changes, we need to clarify modifications. Based on https://infra.apache.org/licensing-howto.html#example-notice

Signed-off-by: zyphlar <zyphlar@noreply.codeberg.org>
2025-05-28 08:51:17 +02:00
kavikhalique
2e37416a43 fixes unable to cancel download bug
Signed-off-by: kavikhalique <kavikhalique3@gmail.com>
2025-05-28 12:00:04 +07:00
Konstantin Pastbin
a81bd5cd46 [android] Remove FOREGROUND_SERVICE_SPECIAL_USE from AndroidManifest.xml
Its no longer used after https://github.com/organicmaps/organicmaps/pull/10053
But the declaration was left (by mistake?).

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-28 11:59:30 +07:00
Mihail Mitrofanov
2a2eb9dfc9 [android] Fix FeatureId check in MapObject
This commit fix the way `FeatureId` is checked in `MapObject.equals()`.

Instead of checking if `mFeatureId` and `other.getFeatureId()` are not `FeatureId.EMPTY`, it now uses a new `isRealId()` method in `FeatureId` to determine if the IDs are valid for comparison.

The `isRealId()` method checks if the `mMwmName` is not empty, `mMwmVersion` is greater than 0, and `mFeatureIndex` is greater than 0. This provides a more robust check for valid feature IDs.

Signed-off-by: Mihail Mitrofanov <mitrofanov@bitrix.ru>
2025-05-27 12:53:07 +02:00
Konstantin Pastbin
964065a7b6 [android] Update microG location dependency
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-26 15:15:49 +02:00
Konstantin Pastbin
0edd732846 Re-register oauth2 app in OSM
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-26 19:58:05 +07:00
Konstantin Pastbin
3032eb6dfe [editor] Auth to OSM via a browser always
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-26 19:33:25 +07:00
Konstantin Pastbin
c4ca4c907b [planet] Update map data to 250515
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-26 14:30:51 +02:00
Konstantin Pastbin
a8349ffa85 [api] Replace om:// scheme with cm://
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-26 17:33:53 +07:00
Konstantin Pastbin
ca1776ee9f Replace omaps.app links with comaps.app
Co-authored-by: zyphlar <zyphlar@noreply.codeberg.org>
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-26 17:33:53 +07:00
Konstantin Pastbin
536c11079d [ios] Update AppStore metadata and descriptions
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-26 09:05:09 +02:00
Konstantin Pastbin
315ad5fa41 [android] Update F-Droid description
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-26 09:05:09 +02:00
Konstantin Pastbin
3a6257346f [android] Add Google Play metadata and description
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-26 09:05:09 +02:00
Konstantin Pastbin
7f0b97e6f8 [android] Remove Google Play metadata from .gitignore
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-26 09:05:09 +02:00
David Gekeler
16c89c1007 Add skip generate_symbols option
Signed-off-by: David Gekeler <git@davidgekeler.eu>
2025-05-25 15:58:48 +02:00
David Gekeler
b669aea415 Update step name, skip map download for android
Signed-off-by: David Gekeler <git@davidgekeler.eu>
2025-05-25 15:46:15 +02:00
David Gekeler
f22abdf64d [CI] Remove obsolete install commands
Signed-off-by: David Gekeler <git@davidgekeler.eu>
2025-05-25 15:46:15 +02:00
David Gekeler
9a3a7c3968 [docs] add missing packages to install instructions
Signed-off-by: David Gekeler <git@davidgekeler.eu>
2025-05-25 15:46:15 +02:00
David Gekeler
871860d53a Add command line option to skip map download; switch to wget
Signed-off-by: David Gekeler <git@davidgekeler.eu>
2025-05-25 15:46:15 +02:00
David Gekeler
f2d87979d1 [docs] Remove obsolete commands from INSTALL.md
Signed-off-by: David Gekeler <git@davidgekeler.eu>
2025-05-25 15:46:15 +02:00
David Gekeler
1199ca3113 Automatic World/WorldCoasts download and symbol generation
Signed-off-by: David Gekeler <git@davidgekeler.eu>
2025-05-25 15:46:15 +02:00
Konstantin Pastbin
094221cb1c [ios] Remove translated AppStore descriptions
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-25 12:30:14 +02:00
Konstantin Pastbin
5d0a43cbe9 [android] Add metadata directories for all languages
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-25 12:30:14 +02:00
Konstantin Pastbin
44eca9ab5e [android] Streamline Google Play metadata handling
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-25 12:30:14 +02:00
Konstantin Pastbin
7df2188212 [ios] Update AppStore upload script
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-25 12:30:14 +02:00
Konstantin Pastbin
3952f34d7f [strings] Add sport-diving
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-25 12:29:33 +02:00
IdeallyGrey
499052fc27 [docs] Switched OM's Weblate links to CoMaps' links 2025-05-24 20:11:58 +02:00
Konstantin Pastbin
1af371bf07 Reset release notes to avoid them being translated
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-05-24 17:18:08 +07:00
442 changed files with 2643 additions and 5563 deletions

View File

@@ -12,19 +12,12 @@ jobs:
environment: production
steps:
- name: Checkout sources
# TODO: use shallow (and sparse?) checkout
uses: actions/checkout@v4
- name: Parallel submodules checkout
shell: bash
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Checkout screenshots
uses: actions/checkout@v4
with:
repository: ${{ secrets.SCREENSHOTS_REPO }}
ssh-key: ${{ secrets.SCREENSHOTS_SSH_KEY }}
ref: main
path: screenshots
# - name: Parallel submodules checkout
# shell: bash
# run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Restore release keys
shell: bash
@@ -37,6 +30,6 @@ jobs:
- name: Upload
shell: bash
run: ./gradlew prepareGoogleReleaseListing publishGoogleReleaseListing
run: ./gradlew publishGoogleReleaseListing
working-directory: android
timeout-minutes: 5

View File

@@ -22,9 +22,9 @@ jobs:
shell: bash
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Configure repository
- name: Init boost, generate textures
shell: bash
run: ./configure.sh
run: ./configure.sh --skip-map-download
- name: Lint
shell: bash
@@ -76,13 +76,9 @@ jobs:
shell: bash
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Configure repository
- name: Init boost, generate textures
shell: bash
run: ./configure.sh
- name: Generate symbols
shell: bash
run: ./tools/unix/generate_symbols.sh
run: ./configure.sh --skip-map-download
- name: Configure ccache
uses: hendrikmuhs/ccache-action@v1.2

View File

@@ -38,20 +38,10 @@ jobs:
shell: bash
run: git submodule update --depth 1 --init --recursive --jobs=$(($(sysctl -n hw.logicalcpu) * 20))
- name: Configure repository
- name: Init boost, download World map, generate textures
shell: bash
run: ./configure.sh
- name: Download MWM files
shell: bash
run: |
wget https://cdn.comaps.app/maps/latest/World.mwm -P ./data/
wget https://cdn.comaps.app/maps/latest/WorldCoasts.mwm -P ./data/
- name: Generate symbols
shell: bash
run: ./tools/unix/generate_symbols.sh
- name: Configure XCode cache
uses: irgaly/xcode-cache@v1
with:

6
.gitignore vendored
View File

@@ -187,9 +187,3 @@ tools/unix/maps/settings.sh
# VS Code
.vscode
.cache
# AppStore metadata
screenshots/
android/src/google/play/listings/
keywords/
iphone/metadata/**/keywords.txt

10
NOTICE
View File

@@ -1,7 +1,15 @@
Copyright 2020 My.com B.V. (Mail.Ru Group)
Copyright 2025 Organic Maps Contributors
Copyright 2021-2025 Organic Maps Contributors
This project is a parallel fork of Organic Maps and includes heavily modified code from the
above sources licensed under the Apache License 2.0. Modifications began on April 2, 2025 by
various CoMaps Contributors, and merges from upstream have continued since. Please refer to
file modification dates or the Git functions for log, blame, diff and show in the CoMaps and
Organic Maps Git repositories to establish ownership, copyright, and licensing.
Copyright 2025 CoMaps Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

View File

@@ -19,5 +19,4 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
optipng
WORKDIR /root/comaps
RUN ./configure.sh
RUN ./tools/unix/generate_symbols.sh
CMD ./gradlew -Parm64 assembleFdroidDebug

View File

@@ -24,6 +24,3 @@
/src/main/res/drawable-mdpi/uk_northern_ireland.png
/src/main/res/drawable-mdpi/uk_scotland.png
/src/main/res/drawable-mdpi/uk_wales.png
# ignore autogenerated metadata (see prepareGoogleReleaseListing in build.gradle)
/src/google/play/listings

View File

@@ -372,32 +372,6 @@ android.applicationVariants.all { variant ->
variant.resValue 'string', 'app_id', variant.applicationId
}
task prepareGoogleReleaseListing {
// Prepares Google Play metainfo from F-Droid metainfo.
final sourceFlavor = 'fdroid'
final targetFlavor = 'google'
doLast {
final sourceDir = new File("${projectDir}/src/$sourceFlavor/play/listings")
final targetDir = new File("${projectDir}/src/$targetFlavor/play/listings")
final sourceFiles = fileTree(dir: sourceDir,
include: '**/*.txt', exclude: "**/*-${targetFlavor}.txt")
sourceFiles.each { File sourceFile ->
final locale = sourceFile.parentFile.getName()
final targetLocaleDir = new File(targetDir, locale)
if (!targetLocaleDir.isDirectory())
targetLocaleDir.mkdirs()
final targetFile = new File(targetLocaleDir, sourceFile.getName())
// Override Google-specific values by using ${name}-google.txt files.
final overrideFile = new File(sourceFile.getPath().replace('.txt', "-${targetFlavor}.txt"))
targetFile.text = overrideFile.exists() ? overrideFile.text : sourceFile.text
}
copy {
from "${projectDir}/../../screenshots/android"
into targetDir
}
}
}
play {
enabled.set(false)
track.set('production')

View File

@@ -1,5 +1,11 @@
A community-led free & open source maps app based on OpenStreetMap data and reinforced with commitment to transparency, privacy and being not-for-profit. CoMaps is a fork/spin-off of Organic Maps, which in turn is a fork of Maps.ME.
Read on about reasons for the project and its direction at <b><i>codeberg.org/comaps</i></b>.
Join the community there and help make the best maps app
• Use the app and spread the word about it
• Give feedback and report issues
• Update map data in the app or on the OpenStreetMap website
‣ <b>Offline-focused</b>: Plan and navigate your trip abroad without the need for cellular service, search waypoints while on a distant hike, etc. All app functions are designed to work offline.
‣ <b>Respecting Privacy</b>: The app is designed with privacy in mind - does not identify people, does not track, and does not collect personal information. Ads-free.
‣ <b>Simple and Polished</b>: essential easy to use features that just work.
@@ -22,7 +28,7 @@ A community-led free & open source maps app based on OpenStreetMap data and rein
<li>Export and import bookmarks and tracks in KML, KMZ, GPX formats</li>
<li>A dark mode to use during the night</li>
<li>Improve map data for everyone using a basic built-in editor</li>
<li>Android Auto and CarPlay support</li>
</ul>
<i>Freedom Is Here - Discover your journey, navigate the world with privacy and community at the forefront!</i>
<b>Freedom Is Here</b>
Discover your journey, navigate the world with privacy and community at the forefront!

View File

@@ -1,8 +1 @@
• New OpenStreetMap data as of February 27
• Ability to manually arrange intermediate route points
• Share a single selected track from the list
• Improved routing for bicycles
• Display a system notification when downloading maps and don't interrupt background downloads
• Added a Track Recording indicator on the main screen
…more details at omaps.org/news

View File

@@ -0,0 +1,38 @@
A community-led free & open source maps app based on OpenStreetMap data and reinforced with commitment to transparency, privacy and being not-for-profit.
Join the community and help make the best maps app
• Use the app and spread the word about it
• Give feedback and report issues
• Update map data in the app or on the OpenStreetMap website
<i>Your feedback and 5-star reviews are the best support for us!</i>
‣ <b>Simple and Polished</b>: essential easy to use features that just work.
‣ <b>Offline-focused</b>: Plan and navigate your trip abroad without the need for cellular service, search waypoints while on a distant hike, etc. All app functions are designed to work offline.
‣ <b>Respecting Privacy</b>: The app is designed with privacy in mind - does not identify people, does not track, and does not collect personal information. Ads-free.
‣ <b>Saves Your Battery and Space</b>: Doesnt drain your battery like other navigation apps. Compact maps save precious space on your phone.
‣ <b>Free and Built by the Community</b>: People like you helped build the app by adding places to OpenStreetMap, testing and giving feedback on features and contributing their development skills and money.
‣ <b>Open and Transparent Decision-making and Financials, Not-for-profit and Fully Open Source.</b>
<b>Main Features</b>:
<ul>
<li>Downloadable detailed maps with places which are not available with Google Maps</li>
<li>Outdoor mode with highlighted hiking trails, campsites, water sources, peaks, contour lines, etc</li>
<li>Walking paths and cycleways</li>
<li>Points of interest like restaurants, gas stations, hotels, shops, sightseeings and many more</li>
<li>Search by name or an address or by point of interest category</li>
<li>Navigation with voice announcements for walking, cycling, or driving</li>
<li>Bookmark your favorite places with a single tap</li>
<li>Offline Wikipedia articles</li>
<li>Subway transit layer and directions</li>
<li>Track recording</li>
<li>Export and import bookmarks and tracks in KML, KMZ, GPX formats</li>
<li>A dark mode to use during the night</li>
<li>Improve map data for everyone using a basic built-in editor</li>
<li>Android Auto support</li>
</ul>
Please report app issues, suggest ideas and join our community at <b><i>comaps.app</i></b> website.
<b>Freedom Is Here</b>
Discover your journey, navigate the world with privacy and community at the forefront!

View File

@@ -0,0 +1 @@
../../../../fdroid/play/listings/en-US/graphics/

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@
Easy map navigation - Discover more of your journey - Powered by the community

View File

@@ -0,0 +1 @@
CoMaps - Navigate with Privacy

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@
../../../../fdroid/play/listings/fr-FR/graphics/

View File

@@ -0,0 +1 @@
../../../../fdroid/play/listings/tr-TR/graphics/

View File

@@ -38,7 +38,6 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"/>
<!--
Android 13 (API level 33) and higher supports a runtime permission for sending non-exempt (including Foreground
Services (FGS)) notifications from an app.
@@ -98,7 +97,7 @@
<data android:scheme="geo"/>
<data android:scheme="ge0"/>
<data android:scheme="om"/>
<data android:scheme="cm"/>
</intent-filter>
<intent-filter>

View File

@@ -93,6 +93,12 @@ public class FeatureId implements Parcelable
return mFeatureIndex;
}
public boolean isRealId() {
return !TextUtils.isEmpty(mMwmName) &&
mMwmVersion >= 0 &&
mFeatureIndex > 0;
}
@Override
public boolean equals(Object o)
{

View File

@@ -178,7 +178,7 @@ public class MapObject implements PlacePageData
if (getClass() != other.getClass())
return false;
if (mFeatureId != FeatureId.EMPTY && other.getFeatureId() != FeatureId.EMPTY)
if (mFeatureId.isRealId() && other.getFeatureId().isRealId())
return mFeatureId.equals(other.getFeatureId());
return Double.doubleToLongBits(mLon) == Double.doubleToLongBits(other.mLon) &&

View File

@@ -7,6 +7,7 @@ import com.google.android.material.floatingactionbutton.FloatingActionButton;
import app.organicmaps.R;
import app.organicmaps.util.StringUtils;
import app.organicmaps.util.UiUtils;
import static app.organicmaps.downloader.CountryItem.*;
class BottomPanel
@@ -39,6 +40,7 @@ class BottomPanel
@Override
public void onClick(View v)
{
MapManager.nativeCancel(mFragment.getCurrentRoot());
mFragment.getAdapter().refreshData();
}
};

View File

@@ -58,20 +58,20 @@ public class OsmLoginFragment extends BaseMwmToolbarFragment
mProgress = view.findViewById(R.id.osm_login_progress);
final String dataVersion = DateUtils.getShortDateFormatter().format(Framework.getDataVersion());
if (BuildConfig.FLAVOR.equals("google"))
{
// TODO(@pastk): remove unused flow with users entering credentials into app's form
// Hide login and password inputs and Forgot password button
UiUtils.hide(view.findViewById(R.id.osm_username_container),
view.findViewById(R.id.osm_password_container),
mLostPasswordButton);
mLoginButton.setOnClickListener((v) -> loginWithBrowser());
}
/* login via in-app form
else
{
mLoginButton.setOnClickListener((v) -> login());
mLostPasswordButton.setOnClickListener((v) -> Utils.openUrl(requireActivity(), Constants.Url.OSM_RECOVER_PASSWORD));
}
*/
String code = readOAuth2CodeFromArguments();
if (code != null && !code.isEmpty())
@@ -150,7 +150,7 @@ public class OsmLoginFragment extends BaseMwmToolbarFragment
requireActivity().finish();
}
// This method is called by MwmActivity & UrlProcessor when "om://oauth2/osm/callback?code=XXX" is handled
// This method is called by MwmActivity & UrlProcessor when "cm://oauth2/osm/callback?code=XXX" is handled
private void continueOAuth2Flow(String oauth2code)
{
if (!isAdded())

View File

@@ -12,7 +12,7 @@ public final class Constants
public static class Url
{
public static final String SHORT_SHARE_PREFIX = "om://";
public static final String SHORT_SHARE_PREFIX = "cm://";
public static final String HTTP_SHARE_PREFIX = "https://comaps.app/";
public static final String MAILTO_SCHEME = "mailto:";

View File

@@ -1268,6 +1268,7 @@
<string name="type.sport.multi">Various Sports</string>
<!-- Used to tag a scuba diving site. -->
<string name="type.sport.scuba_diving">Scuba Diving Site</string>
<string name="type.sport.diving">Diving</string>
<string name="type.sport.shooting">Shooting</string>
<string name="type.sport.skateboard">Skateboarding</string>
<string name="type.sport.skiing">Skiing</string>

View File

@@ -8,7 +8,7 @@ google-services = { module = "com.google.gms:google-services", version = "4.4.2"
triplet-play-publisher = { module = "com.github.triplet.gradle:play-publisher", version = "3.10.1" }
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.4" }
microg-services-location = { module = "org.microg.gms:play-services-location", version = "0.3.6.244735" }
microg-services-location = { module = "org.microg.gms:play-services-location", version = "0.3.7.250932" }
androidx-core = { module = "androidx.core:core", version = "1.15.0" }
jetbrains-kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version = "2.1.10" }
androidx-annotation = { module = "androidx.annotation:annotation", version = "1.9.1" }

View File

@@ -115,8 +115,8 @@ UNIT_TEST(Url_Valid)
.KV("ll", "10.3,12.3223")
.KV("n", "Hello World");
TestUrl("om:M&M//path?q=q&w=w")
.Scheme("om")
TestUrl("cm:M&M//path?q=q&w=w")
.Scheme("cm")
.Host("M&M")
.Path("path")
.KV("q", "q")
@@ -127,7 +127,7 @@ UNIT_TEST(Url_Valid)
.Host("www.sandwichparlour.com.au")
.Path("");
TestUrl("om:/&test").Scheme("om").Host("&test").Path("");
TestUrl("cm:/&test").Scheme("cm").Host("&test").Path("");
}
UNIT_TEST(Url_Fragment)

View File

@@ -11,7 +11,7 @@ namespace url
{
// Url in format: 'scheme://host/path?key1=value1&key2&key3=&key4=value4'
// host - any string ('omaps.app' or 'search'), without any valid domain check
// host - any string ('comaps.app' or 'search'), without any valid domain check
class Url
{
public:

View File

@@ -3,8 +3,33 @@
# Please run this script to configure the repository after cloning it.
#
SKIP_MAP_DOWNLOAD=false
SKIP_GENERATE_SYMBOLS=false
############################# PROCESS OPTIONS ################################
TEMP=$(getopt -o ms --long skip-map-download,skip-generate-symbols \
-n 'configure' -- "$@")
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$TEMP"
while true; do
case "$1" in
-m | --skip-map-download ) SKIP_MAP_DOWNLOAD=true; shift ;;
-s | --skip-generate-symbols ) SKIP_GENERATE_SYMBOLS=true; shift ;;
* ) break ;;
esac
done
# Shift the processed options away
shift $((OPTIND-1))
set -euo pipefail
###############################################################################
echo "Configuring the repository for development."
if [ ! -d 3party/boost/tools ]; then
@@ -14,4 +39,20 @@ pushd 3party/boost/
./bootstrap.sh
./b2 headers
popd
if [ "$SKIP_MAP_DOWNLOAD" = false ]; then
echo "Downloading world map..."
wget -N https://cdn.comaps.app/maps/latest/World.mwm -P ./data/
wget -N https://cdn.comaps.app/maps/latest/WorldCoasts.mwm -P ./data/
else
echo "Skipping world map download..."
fi
if [ "$SKIP_GENERATE_SYMBOLS" = false ]; then
echo "Generating symbols..."
bash ./tools/unix/generate_symbols.sh
else
echo "Skipping generate symbols..."
fi
echo "The repository is configured for development."

File diff suppressed because it is too large Load Diff

View File

@@ -4,119 +4,119 @@
<Style id="placemark-red">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-red.png</href>
<href>https://comaps.app/placemarks/placemark-red.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-blue">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-blue.png</href>
<href>https://comaps.app/placemarks/placemark-blue.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-purple">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-purple.png</href>
<href>https://comaps.app/placemarks/placemark-purple.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-yellow">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-yellow.png</href>
<href>https://comaps.app/placemarks/placemark-yellow.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-pink">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-pink.png</href>
<href>https://comaps.app/placemarks/placemark-pink.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-brown">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-brown.png</href>
<href>https://comaps.app/placemarks/placemark-brown.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-green">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-green.png</href>
<href>https://comaps.app/placemarks/placemark-green.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-orange">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-orange.png</href>
<href>https://comaps.app/placemarks/placemark-orange.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-deeppurple">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-deeppurple.png</href>
<href>https://comaps.app/placemarks/placemark-deeppurple.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-lightblue">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-lightblue.png</href>
<href>https://comaps.app/placemarks/placemark-lightblue.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-cyan">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-cyan.png</href>
<href>https://comaps.app/placemarks/placemark-cyan.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-teal">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-teal.png</href>
<href>https://comaps.app/placemarks/placemark-teal.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-lime">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-lime.png</href>
<href>https://comaps.app/placemarks/placemark-lime.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-deeporange">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-deeporange.png</href>
<href>https://comaps.app/placemarks/placemark-deeporange.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-gray">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-gray.png</href>
<href>https://comaps.app/placemarks/placemark-gray.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-bluegray">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-bluegray.png</href>
<href>https://comaps.app/placemarks/placemark-bluegray.png</href>
</Icon>
</IconStyle>
</Style>
<name>Test category</name>
<description>Test description</description>
<visibility>1</visibility>
<ExtendedData xmlns:mwm="https://omaps.app">
<ExtendedData xmlns:mwm="https://comaps.app">
<mwm:serverId>AAAA-BBBB-CCCC-DDDD</mwm:serverId>
<mwm:name>
<mwm:lang code="ru">Тестовая категория</mwm:lang>
@@ -237,7 +237,7 @@
<TimeStamp><when>1970-01-01T00:13:20Z</when></TimeStamp>
<styleUrl>#placemark-blue</styleUrl>
<Point><coordinates>45.9242,49.326859</coordinates></Point>
<ExtendedData xmlns:mwm="https://omaps.app">
<ExtendedData xmlns:mwm="https://comaps.app">
<mwm:name>
<mwm:lang code="ru">Тестовая метка</mwm:lang>
<mwm:lang code="default">Test bookmark</mwm:lang>
@@ -278,7 +278,7 @@
</LineStyle></Style>
<TimeStamp><when>1970-01-01T00:15:00Z</when></TimeStamp>
<LineString><coordinates>45.9242,49.326859,1 45.2244,48.941288,2 45.1964,49.401948,3</coordinates></LineString>
<ExtendedData xmlns:mwm="https://omaps.app">
<ExtendedData xmlns:mwm="https://comaps.app">
<mwm:name>
<mwm:lang code="ru">Тестовый трек</mwm:lang>
<mwm:lang code="default">Test track</mwm:lang>

View File

@@ -4,119 +4,119 @@
<Style id="placemark-red">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-red.png</href>
<href>https://comaps.app/placemarks/placemark-red.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-blue">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-blue.png</href>
<href>https://comaps.app/placemarks/placemark-blue.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-purple">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-purple.png</href>
<href>https://comaps.app/placemarks/placemark-purple.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-yellow">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-yellow.png</href>
<href>https://comaps.app/placemarks/placemark-yellow.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-pink">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-pink.png</href>
<href>https://comaps.app/placemarks/placemark-pink.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-brown">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-brown.png</href>
<href>https://comaps.app/placemarks/placemark-brown.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-green">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-green.png</href>
<href>https://comaps.app/placemarks/placemark-green.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-orange">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-orange.png</href>
<href>https://comaps.app/placemarks/placemark-orange.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-deeppurple">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-deeppurple.png</href>
<href>https://comaps.app/placemarks/placemark-deeppurple.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-lightblue">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-lightblue.png</href>
<href>https://comaps.app/placemarks/placemark-lightblue.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-cyan">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-cyan.png</href>
<href>https://comaps.app/placemarks/placemark-cyan.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-teal">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-teal.png</href>
<href>https://comaps.app/placemarks/placemark-teal.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-lime">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-lime.png</href>
<href>https://comaps.app/placemarks/placemark-lime.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-deeporange">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-deeporange.png</href>
<href>https://comaps.app/placemarks/placemark-deeporange.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-gray">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-gray.png</href>
<href>https://comaps.app/placemarks/placemark-gray.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-bluegray">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-bluegray.png</href>
<href>https://comaps.app/placemarks/placemark-bluegray.png</href>
</Icon>
</IconStyle>
</Style>
<name>Test category</name>
<description>Test description</description>
<visibility>1</visibility>
<ExtendedData xmlns:mwm="https://omaps.app">
<ExtendedData xmlns:mwm="https://comaps.app">
<mwm:serverId>AAAA-BBBB-CCCC-DDDD</mwm:serverId>
<mwm:name>
<mwm:lang code="ru">Тестовая категория</mwm:lang>
@@ -237,7 +237,7 @@
<TimeStamp><when>1970-01-01T00:13:20Z</when></TimeStamp>
<styleUrl>#placemark-blue</styleUrl>
<Point><coordinates>45.9242,49.326859</coordinates></Point>
<ExtendedData xmlns:mwm="https://omaps.app">
<ExtendedData xmlns:mwm="https://comaps.app">
<mwm:name>
<mwm:lang code="ru">Тестовая метка</mwm:lang>
<mwm:lang code="default">Test bookmark</mwm:lang>
@@ -294,7 +294,7 @@
<gx:coord>45.2244 48.941288 2</gx:coord>
</gx:Track>
</gx:MultiTrack>
<ExtendedData xmlns:mwm="https://omaps.app">
<ExtendedData xmlns:mwm="https://comaps.app">
<mwm:name>
<mwm:lang code="ru">Тестовый трек</mwm:lang>
<mwm:lang code="default">Test track</mwm:lang>

View File

@@ -4,119 +4,119 @@
<Style id="placemark-red">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-red.png</href>
<href>https://comaps.app/placemarks/placemark-red.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-blue">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-blue.png</href>
<href>https://comaps.app/placemarks/placemark-blue.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-purple">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-purple.png</href>
<href>https://comaps.app/placemarks/placemark-purple.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-yellow">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-yellow.png</href>
<href>https://comaps.app/placemarks/placemark-yellow.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-pink">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-pink.png</href>
<href>https://comaps.app/placemarks/placemark-pink.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-brown">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-brown.png</href>
<href>https://comaps.app/placemarks/placemark-brown.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-green">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-green.png</href>
<href>https://comaps.app/placemarks/placemark-green.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-orange">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-orange.png</href>
<href>https://comaps.app/placemarks/placemark-orange.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-deeppurple">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-deeppurple.png</href>
<href>https://comaps.app/placemarks/placemark-deeppurple.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-lightblue">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-lightblue.png</href>
<href>https://comaps.app/placemarks/placemark-lightblue.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-cyan">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-cyan.png</href>
<href>https://comaps.app/placemarks/placemark-cyan.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-teal">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-teal.png</href>
<href>https://comaps.app/placemarks/placemark-teal.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-lime">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-lime.png</href>
<href>https://comaps.app/placemarks/placemark-lime.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-deeporange">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-deeporange.png</href>
<href>https://comaps.app/placemarks/placemark-deeporange.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-gray">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-gray.png</href>
<href>https://comaps.app/placemarks/placemark-gray.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="placemark-bluegray">
<IconStyle>
<Icon>
<href>https://omaps.app/placemarks/placemark-bluegray.png</href>
<href>https://comaps.app/placemarks/placemark-bluegray.png</href>
</Icon>
</IconStyle>
</Style>
<name>Test category</name>
<description>Test description</description>
<visibility>1</visibility>
<ExtendedData xmlns:mwm="https://omaps.app">
<ExtendedData xmlns:mwm="https://comaps.app">
<mwm:serverId>AAAA-BBBB-CCCC-DDDD</mwm:serverId>
<mwm:name>
<mwm:lang code="ru">Тестовая категория</mwm:lang>
@@ -237,7 +237,7 @@
<TimeStamp><when>1970-01-01T00:13:20Z</when></TimeStamp>
<styleUrl>#placemark-blue</styleUrl>
<Point><coordinates>45.9242,49.326859</coordinates></Point>
<ExtendedData xmlns:mwm="https://omaps.app">
<ExtendedData xmlns:mwm="https://comaps.app">
<mwm:name>
<mwm:lang code="ru">Тестовая метка</mwm:lang>
<mwm:lang code="default">Test bookmark</mwm:lang>
@@ -311,7 +311,7 @@
<when>1970-01-01T00:00:02Z</when>
</gx:Track>
</gx:MultiTrack>
<ExtendedData xmlns:mwm="https://omaps.app">
<ExtendedData xmlns:mwm="https://comaps.app">
<mwm:name>
<mwm:lang code="ru">Тестовый трек</mwm:lang>
<mwm:lang code="default">Test track</mwm:lang>

View File

@@ -41,6 +41,11 @@ Go into the cloned repository:
cd comaps
```
Install required packages (Ubuntu/Debian):
```bash
sudo apt install build-essential cmake qt6-base-dev qt6-svg-dev qt6-positioning-dev libicu-dev libfreetype-dev libharfbuzz-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev optipng
```
Configure the repository (make sure you have a working C++ build environment):
(if you plan to publish the app privately in stores check [special options](#special-cases-options))
@@ -63,18 +68,6 @@ For _Windows 10_: You should be able to build the project by following either o
```bash
"C:\Program Files\Git\bin\bash.exe" configure.sh # execute the script by using Developer Command Prompt
```
### Generate symbols
Download the latest [World.mwm](https://cdn-us-1.comaps.app/maps/250511/World.mwm) and [WorldCoast.mwm](https://cdn-us-1.comaps.app/maps/250511/WorldCoasts.mwm) files and put them into the `<repo_root>/data/` dir.
Install required packages (Ubuntu/Debian):
```bash
sudo apt install qt6-base-dev qt6-declarative-dev libqt6svg6-dev optipng
```
Run the skins/textures generation script:
```bash
bash ./tools/unix/generate_symbols.sh
```
Now the repository is prepared to build a CoMaps app!

View File

@@ -20,7 +20,7 @@ The project consists of multiple components, each with its own translation files
| Search keywords (cuisines) | Search keywords for cuisine types | [data/categories_cuisines.txt][categories_cuisines_git] |
| AppStore Descriptions | AppStore descriptions | [iphone/metadata][appstore_git] ([en][appstore_git_en]) |
| Android Stores Descriptions | Google, F-Droid, Huawei store descriptions | [android/app/src/fdroid/play][googleplay_git] ([en][googleplay_git_en]) |
| [Website][website_weblate] | Website content | [organicmaps/website][website_git] ([see details][website_guide]) |
| [Website][website_weblate] | Website content | [comaps/website][website_git] ([see details][website_guide]) |
Components without links haven't been integrated into Weblate and must be translated directly via [Codeberg Pull Requests](CONTRIBUTING.md).
@@ -28,7 +28,7 @@ Components without links haven't been integrated into Weblate and must be transl
### Workflow
Translations are managed through [Weblate][weblate]. Direct submissions to this repository are not recommended but possible in specific cases (like batch-changes). Please prefer using the Weblate for translations whenever possible. Weblate periodically creates pull requests, which [@organicmaps/mergers][mergers] review and merge as usual.
Translations are managed through [Weblate][weblate]. Direct submissions to this repository are not recommended but possible in specific cases (like batch-changes). Please prefer using the Weblate for translations whenever possible. Weblate periodically creates pull requests, which [@comaps/mergers][mergers] review and merge as usual.
### Cross-Component Synchronization
@@ -86,31 +86,31 @@ The recommended approach for resolving conflicts is as follows:
6. Reset Weblate to sync changes from GitHub:
_Manage → Repository Maintenance → Reset (button)_.
[weblate]: https://hosted.weblate.org/projects/organicmaps/
[weblate]: https://translate.codeberg.org/projects/comaps/
[contribute]: https://docs.weblate.org/en/latest/workflows.html
[android_weblate]: https://hosted.weblate.org/projects/organicmaps/android/
[android_weblate]: https://translate.codeberg.org/projects/comaps/android/
[android_git]: https://codeberg.org/comaps/comaps/src/branch/main/android/app/src/main/res
[android_git_en]: https://codeberg.org/comaps/comaps/src/branch/main/android/app/src/main/res/values/strings.xml
[android_typestrings_weblate]: https://hosted.weblate.org/projects/organicmaps/android-typestrings/
[android_typestrings_weblate]: https://translate.codeberg.org/projects/comaps/android-typestrings/
[android_typestrings_git_en]: https://codeberg.org/comaps/comaps/src/branch/main/android/app/src/main/res/values/types_strings.xml
[countries_weblate]: https://hosted.weblate.org/projects/organicmaps/countries/
[countries_weblate]: https://translate.codeberg.org/projects/comaps/countries/
[countries_git]: https://codeberg.org/comaps/comaps/src/branch/main/data/countries-strings
[countries_git_en]: https://codeberg.org/comaps/comaps/src/branch/main/data/countries-strings/en.json/localize.json
[ios_weblate]: https://hosted.weblate.org/projects/organicmaps/ios/
[ios_weblate]: https://translate.codeberg.org/projects/comaps/ios/
[ios_git]: https://codeberg.org/comaps/comaps/src/branch/main/iphone/Maps/LocalizedStrings/
[ios_git_en]: https://codeberg.org/comaps/comaps/src/branch/main/iphone/Maps/LocalizedStrings/en.lproj/Localizable.strings
[ios_plist_weblate]: https://hosted.weblate.org/projects/organicmaps/ios-plist/
[ios_plist_weblate]: https://translate.codeberg.org/projects/comaps/ios-plist/
[ios_plist_git_en]: https://codeberg.org/comaps/comaps/src/branch/main/iphone/Maps/LocalizedStrings/en.lproj/InfoPlist.strings
[ios_typestrings_weblate]: https://hosted.weblate.org/projects/organicmaps/ios-typestrings/
[ios_typestrings_weblate]: https://translate.codeberg.org/projects/comaps/ios-typestrings/
[ios_typestrings_git_en]: https://codeberg.org/comaps/comaps/src/branch/main/iphone/Maps/LocalizedStrings/en.lproj/LocalizableTypes.strings
[ios_plurals_weblate]: https://hosted.weblate.org/projects/organicmaps/ios-plurals/
[ios_plurals_weblate]: https://translate.codeberg.org/projects/comaps/ios-plurals/
[ios_plurals_git_en]: https://codeberg.org/comaps/comaps/src/branch/main/iphone/Maps/LocalizedStrings/en.lproj/Localizable.stringsdict
[tts_weblate]: https://hosted.weblate.org/projects/organicmaps/tts/
[tts_weblate]: https://translate.codeberg.org/projects/comaps/tts/
[tts_git]: https://codeberg.org/comaps/comaps/src/branch/main/data/sound-strings
[tts_git_en]: https://codeberg.org/comaps/comaps/src/branch/main/data/sound-strings/en.json/localize.json
[categories_git]: https://codeberg.org/comaps/comaps/src/branch/main/data/categories.txt
[categories_cuisines_git]:https://codeberg.org/comaps/comaps/src/branch/main/data/categories_cuisines.txt
[website_weblate]: https://hosted.weblate.org/projects/organicmaps/website/
[website_weblate]: https://translate.codeberg.org/projects/comaps/website/
[website_git]: https://codeberg.org/comaps/website/
[website_guide]: https://codeberg.org/comaps/website/src/branch/main/TRANSLATIONS.md
[appstore_git]: https://codeberg.org/comaps/comaps/src/branch/main/iphone/metadata
@@ -118,4 +118,4 @@ The recommended approach for resolving conflicts is as follows:
[googleplay_git]: https://codeberg.org/comaps/comaps/src/branch/main/android/app/src/fdroid/play
[googleplay_git_en]: https://codeberg.org/comaps/comaps/src/branch/main/android/app/src/fdroid/play/listings/en-US
[mergers]: https://codeberg.org/org/comaps/teams
[failing_checks]: https://hosted.weblate.org/search/organicmaps/?q=has%3Acheck+AND+state%3A%3E%3Dtranslated+language%3Aru&sort_by=target&checksum=
[failing_checks]: https://translate.codeberg.org/search/comaps/?q=has%3Acheck+AND+state%3A%3E%3Dtranslated+language%3Aru&sort_by=target&checksum=

View File

@@ -110,7 +110,7 @@ OsmOAuth OsmOAuth::DevServerAuth()
constexpr char const * kOsmDevClientId = "Tj8yyx3FWy_N5wz6sUTAXTM6YBAiwVgM7sRLrLix2u8";
constexpr char const * kOsmDevClientSecret = "TdEQaoAQkcu_E2HWfr0RDaG5hMDk3gThO1RvWQtQc8o";
constexpr char const * kOsmDevScope = "read_prefs write_api write_notes";
constexpr char const * kOsmDevRedirectUri = "om://oauth2/osm/callback";
constexpr char const * kOsmDevRedirectUri = "cm://oauth2/osm/callback";
return {kOsmDevClientId, kOsmDevClientSecret, kOsmDevScope, kOsmDevRedirectUri, kOsmDevServer, kOsmDevServer};
}
@@ -289,11 +289,12 @@ string OsmOAuth::BuildOAuth2Url() const
string OsmOAuth::FinishAuthorization(string const & oauth2code) const
{
/// @todo(pastk): remove client_secret everywhere, its not required for auth through non-confidential apps
auto params = BuildPostRequest({
{"grant_type", "authorization_code"},
{"code", oauth2code},
{"client_id", m_oauth2params.m_clientId},
{"client_secret", m_oauth2params.m_clientSecret},
//{"client_secret", m_oauth2params.m_clientSecret},
{"redirect_uri", m_oauth2params.m_redirectUri},
{"scope", m_oauth2params.m_scope},
});

View File

@@ -302,14 +302,14 @@ UNIT_TEST(Bad_Base64)
UNIT_TEST(OtherPrefixes)
{
TestSuccess("http://omaps.app/Byqqqqqqqq/Name", 45, 0, 4.25, "Name");
TestSuccess("https://omaps.app/Byqqqqqqqq/Name", 45, 0, 4.25, "Name");
TestFailure("http://omapz.app/Byqqqqqqqq/Name");
TestSuccess("http://omaps.app/AwAAAAAAAA/Super%5fPoi", 0, 0, 4, "Super Poi");
TestSuccess("https://omaps.app/AwAAAAAAAA/Super%5fPoi", 0, 0, 4, "Super Poi");
TestFailure("https://omapz.app/AwAAAAAAAA/Super%5fPoi");
TestSuccess("http://comaps.app/Byqqqqqqqq/Name", 45, 0, 4.25, "Name");
TestSuccess("https://comaps.app/Byqqqqqqqq/Name", 45, 0, 4.25, "Name");
TestFailure("http://comapz.app/Byqqqqqqqq/Name");
TestSuccess("http://comaps.app/AwAAAAAAAA/Super%5fPoi", 0, 0, 4, "Super Poi");
TestSuccess("https://comaps.app/AwAAAAAAAA/Super%5fPoi", 0, 0, 4, "Super Poi");
TestFailure("https://comapz.app/AwAAAAAAAA/Super%5fPoi");
TestSuccess("https://omaps.app/Byqqqqqqqq", 45, 0, 4.25, "");
TestFailure("https://omaps.app/Byqqqqqqq");
TestSuccess("https://comaps.app/Byqqqqqqqq", 45, 0, 4.25, "");
TestFailure("https://comaps.app/Byqqqqqqq");
}
} // namespace ge0

View File

@@ -255,91 +255,91 @@ UNIT_TEST(LatLonToString_StringDensity)
UNIT_TEST(GenerateShortShowMapUrl_SmokeTest)
{
string res = GenerateShortShowMapUrl(0, 0, 19, "Name");
TEST_EQUAL("om://8wAAAAAAAA/Name", res, ());
TEST_EQUAL("cm://8wAAAAAAAA/Name", res, ());
}
UNIT_TEST(GenerateShortShowMapUrl_NameIsEmpty)
{
string res = GenerateShortShowMapUrl(0, 0, 19, "");
TEST_EQUAL("om://8wAAAAAAAA", res, ());
TEST_EQUAL("cm://8wAAAAAAAA", res, ());
}
UNIT_TEST(GenerateShortShowMapUrl_ZoomVerySmall)
{
string res = GenerateShortShowMapUrl(0, 0, 2, "Name");
TEST_EQUAL("om://AwAAAAAAAA/Name", res, ());
TEST_EQUAL("cm://AwAAAAAAAA/Name", res, ());
}
UNIT_TEST(GenerateShortShowMapUrl_ZoomNegative)
{
string res = GenerateShortShowMapUrl(0, 0, -5, "Name");
TEST_EQUAL("om://AwAAAAAAAA/Name", res, ());
TEST_EQUAL("cm://AwAAAAAAAA/Name", res, ());
}
UNIT_TEST(GenerateShortShowMapUrl_ZoomLarge)
{
string res = GenerateShortShowMapUrl(0, 0, 20, "Name");
TEST_EQUAL("om://_wAAAAAAAA/Name", res, ());
TEST_EQUAL("cm://_wAAAAAAAA/Name", res, ());
}
UNIT_TEST(GenerateShortShowMapUrl_ZoomVeryLarge)
{
string res = GenerateShortShowMapUrl(0, 0, 2000000000, "Name");
TEST_EQUAL("om://_wAAAAAAAA/Name", res, ());
TEST_EQUAL("cm://_wAAAAAAAA/Name", res, ());
}
UNIT_TEST(GenerateShortShowMapUrl_FractionalZoom)
{
string res = GenerateShortShowMapUrl(0, 0, 8.25, "Name");
TEST_EQUAL("om://RwAAAAAAAA/Name", res, ());
TEST_EQUAL("cm://RwAAAAAAAA/Name", res, ());
}
UNIT_TEST(GenerateShortShowMapUrl_FractionalZoomRoundsDown)
{
string res = GenerateShortShowMapUrl(0, 0, 8.499, "Name");
TEST_EQUAL("om://RwAAAAAAAA/Name", res, ());
TEST_EQUAL("cm://RwAAAAAAAA/Name", res, ());
}
UNIT_TEST(GenerateShortShowMapUrl_FractionalZoomNextStep)
{
string res = GenerateShortShowMapUrl(0, 0, 8.5, "Name");
TEST_EQUAL("om://SwAAAAAAAA/Name", res, ());
TEST_EQUAL("cm://SwAAAAAAAA/Name", res, ());
}
UNIT_TEST(GenerateShortShowMapUrl_SpaceIsReplacedWithUnderscore)
{
string res = GenerateShortShowMapUrl(0, 0, 19, "Hello World");
TEST_EQUAL("om://8wAAAAAAAA/Hello_World", res, ());
TEST_EQUAL("cm://8wAAAAAAAA/Hello_World", res, ());
}
UNIT_TEST(GenerateShortShowMapUrl_NamesAreEscaped)
{
string res = GenerateShortShowMapUrl(0, 0, 19, "'Hello,World!%$");
TEST_EQUAL("om://8wAAAAAAAA/%27Hello%2CWorld%21%25%24", res, ());
TEST_EQUAL("cm://8wAAAAAAAA/%27Hello%2CWorld%21%25%24", res, ());
}
UNIT_TEST(GenerateShortShowMapUrl_UnderscoreIsReplacedWith_Percent_20)
{
string res = GenerateShortShowMapUrl(0, 0, 19, "Hello_World");
TEST_EQUAL("om://8wAAAAAAAA/Hello%20World", res, ());
TEST_EQUAL("cm://8wAAAAAAAA/Hello%20World", res, ());
}
UNIT_TEST(GenerateShortShowMapUrl_ControlCharsAreEscaped)
{
string res = GenerateShortShowMapUrl(0, 0, 19, "Hello\tWorld\n");
TEST_EQUAL("om://8wAAAAAAAA/Hello%09World%0A", res, ());
TEST_EQUAL("cm://8wAAAAAAAA/Hello%09World%0A", res, ());
}
UNIT_TEST(GenerateShortShowMapUrl_Unicode)
{
string res = GenerateShortShowMapUrl(0, 0, 19, "\xe2\x98\x84");
TEST_EQUAL("om://8wAAAAAAAA/\xe2\x98\x84", res, ());
TEST_EQUAL("cm://8wAAAAAAAA/\xe2\x98\x84", res, ());
}
UNIT_TEST(GenerateShortShowMapUrl_UnicodeMixedWithOtherChars)
{
string res = GenerateShortShowMapUrl(0, 0, 19, "Back_in \xe2\x98\x84!\xd1\x8e\xd0\xbc");
TEST_EQUAL("om://8wAAAAAAAA/Back%20in_\xe2\x98\x84%21\xd1\x8e\xd0\xbc", res, ());
TEST_EQUAL("cm://8wAAAAAAAA/Back%20in_\xe2\x98\x84%21\xd1\x8e\xd0\xbc", res, ());
}
UNIT_TEST(GenerateGeoUri_SmokeTest)

View File

@@ -34,10 +34,10 @@ bool Ge0Parser::Parse(std::string const & url, Result & result)
// |+-------+--------- 9 bytes: lat,lon
// || | +--+---- Variable number of bytes: point name
// || | | |
// om://ZCoordba64/Name
// cm://ZCoordba64/Name
// Alternative format (differs only in the prefix):
// http://omaps.app/ZCoordba64/Name
// http://comaps.app/ZCoordba64/Name
for (auto prefix : kGe0Prefixes)
{

View File

@@ -12,7 +12,7 @@ class Ge0Parser
public:
// Used by map/mwm_url.cpp.
static constexpr std::array<std::string_view, 6> kGe0Prefixes = {{
"https://comaps.app/", "om://", "http://comaps.app/",
"https://comaps.app/", "cm://", "http://comaps.app/",
"ge0://", "http://ge0.me/", "https://ge0.me/"
}};

View File

@@ -86,8 +86,8 @@ namespace ge0
{
std::string GenerateShortShowMapUrl(double lat, double lon, double zoom, std::string const & name)
{
size_t constexpr schemaLength = 5; // strlen("om://")
std::string urlSample = "om://ZCoordba64";
size_t constexpr schemaLength = 5; // strlen("cm://")
std::string urlSample = "cm://ZCoordba64";
int const zoomI = (zoom <= 4 ? 0 : (zoom >= 19.75 ? 63 : static_cast<int>((zoom - 4) * 4)));
urlSample[schemaLength] = Base64Char(zoomI);

View File

@@ -16,7 +16,7 @@ inline static int const kMaxCoordBits = kMaxPointBytes * 3;
// |+-------+--------- 9 bytes: lat,lon
// || | +--+---- Variable number of bytes: point name
// || | | |
// om://ZCoordba64/Name
// cm://ZCoordba64/Name
std::string GenerateShortShowMapUrl(double lat, double lon, double zoomLevel, std::string const & name);
// Generates a geo: uri.

Some files were not shown because too many files have changed in this diff Show More