diff --git a/docs/en/_sources/installation.rst.txt b/docs/en/_sources/installation.rst.txt index 8fdefd66..b919e95b 100644 --- a/docs/en/_sources/installation.rst.txt +++ b/docs/en/_sources/installation.rst.txt @@ -190,7 +190,7 @@ deployment method. | Tile server URL (with api key if needed), see `Map tile server `__. | Since **0.4.9**, it's also used to generate static maps (to keep default server, see `DEFAULT_STATICMAP `__) - :default: ``https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`` + :default: ``https://tile.openstreetmap.org/{z}/{x}/{y}.png`` .. envvar:: STATICMAP_SUBDOMAINS diff --git a/docs/en/installation.html b/docs/en/installation.html index 1568beff..3ad09c4f 100644 --- a/docs/en/installation.html +++ b/docs/en/installation.html @@ -523,7 +523,7 @@ see
Default:
-

https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png

+

https://tile.openstreetmap.org/{z}/{x}/{y}.png

diff --git a/docs/fr/_sources/installation.rst.txt b/docs/fr/_sources/installation.rst.txt index 8fdefd66..b919e95b 100644 --- a/docs/fr/_sources/installation.rst.txt +++ b/docs/fr/_sources/installation.rst.txt @@ -190,7 +190,7 @@ deployment method. | Tile server URL (with api key if needed), see `Map tile server `__. | Since **0.4.9**, it's also used to generate static maps (to keep default server, see `DEFAULT_STATICMAP `__) - :default: ``https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`` + :default: ``https://tile.openstreetmap.org/{z}/{x}/{y}.png`` .. envvar:: STATICMAP_SUBDOMAINS diff --git a/docs/fr/installation.html b/docs/fr/installation.html index 29093f7f..60609fe6 100644 --- a/docs/fr/installation.html +++ b/docs/fr/installation.html @@ -516,7 +516,7 @@
défaut:
-

https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png

+

https://tile.openstreetmap.org/{z}/{x}/{y}.png

diff --git a/docsrc/gettext/docs.pot b/docsrc/gettext/docs.pot index 41fb7f26..bf72daaf 100644 --- a/docsrc/gettext/docs.pot +++ b/docsrc/gettext/docs.pot @@ -4413,7 +4413,7 @@ msgid "Since **0.4.9**, it's also used to generate static maps (to keep default msgstr "" #: ../source/installation.rst:193 -msgid "``https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png``" +msgid "``https://tile.openstreetmap.org/{z}/{x}/{y}.png``" msgstr "" #: ../source/installation.rst:200 diff --git a/docsrc/locales/en/LC_MESSAGES/docs.po b/docsrc/locales/en/LC_MESSAGES/docs.po index d87b6da8..2d9b9035 100644 --- a/docsrc/locales/en/LC_MESSAGES/docs.po +++ b/docsrc/locales/en/LC_MESSAGES/docs.po @@ -4582,7 +4582,7 @@ msgid "" msgstr "" #: ../source/installation.rst:193 -msgid "``https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png``" +msgid "``https://tile.openstreetmap.org/{z}/{x}/{y}.png``" msgstr "" #: ../source/installation.rst:200 diff --git a/docsrc/locales/fr/LC_MESSAGES/docs.po b/docsrc/locales/fr/LC_MESSAGES/docs.po index 203b75b9..a55fd3f7 100644 --- a/docsrc/locales/fr/LC_MESSAGES/docs.po +++ b/docsrc/locales/fr/LC_MESSAGES/docs.po @@ -5017,7 +5017,7 @@ msgstr "" "`DEFAULT_STATICMAP `__)" #: ../source/installation.rst:193 -msgid "``https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png``" +msgid "``https://tile.openstreetmap.org/{z}/{x}/{y}.png``" msgstr "" #: ../source/installation.rst:200 diff --git a/docsrc/source/installation.rst b/docsrc/source/installation.rst index 8fdefd66..b919e95b 100644 --- a/docsrc/source/installation.rst +++ b/docsrc/source/installation.rst @@ -190,7 +190,7 @@ deployment method. | Tile server URL (with api key if needed), see `Map tile server `__. | Since **0.4.9**, it's also used to generate static maps (to keep default server, see `DEFAULT_STATICMAP `__) - :default: ``https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`` + :default: ``https://tile.openstreetmap.org/{z}/{x}/{y}.png`` .. envvar:: STATICMAP_SUBDOMAINS diff --git a/fittrackee/config.py b/fittrackee/config.py index 8520bc49..1f70d123 100644 --- a/fittrackee/config.py +++ b/fittrackee/config.py @@ -41,7 +41,7 @@ class BaseConfig: TILE_SERVER = { 'URL': os.environ.get( 'TILE_SERVER_URL', - 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', + 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', ), 'ATTRIBUTION': os.environ.get( 'MAP_ATTRIBUTION', diff --git a/fittrackee/tests/workouts/test_utils/test_maps.py b/fittrackee/tests/workouts/test_utils/test_maps.py index 672bd0d2..6b696f1d 100644 --- a/fittrackee/tests/workouts/test_utils/test_maps.py +++ b/fittrackee/tests/workouts/test_utils/test_maps.py @@ -11,16 +11,7 @@ class TestGetStaticMapTileServerUrl: 'input_tile_server_subdomains,' 'expected_tile_server_url', [ - ( - 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', - '', - 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', - ), - ( - 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', - 'a', - 'https://a.tile.openstreetmap.org/{z}/{x}/{y}.png', - ), + # tile server without subdomain ( 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', '', @@ -31,6 +22,21 @@ class TestGetStaticMapTileServerUrl: 'a', 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', ), + # tile server with subdomain + ( + 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/' + '{z}/{x}/{y}.png', + 'a', + 'https://a.tile-cyclosm.openstreetmap.fr/cyclosm/' + '{z}/{x}/{y}.png', + ), + ( + 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/' + '{z}/{x}/{y}.png', + '', + 'https://tile-cyclosm.openstreetmap.fr/cyclosm/' + '{z}/{x}/{y}.png', + ), ], ) def test_it_returns_tile_server_url( @@ -52,12 +58,15 @@ class TestGetStaticMapTileServerUrl: def test_it_returns_tile_server_url_with_random_subdomain(self) -> None: """in case multiple subdomains are provided""" tile_config = { - 'URL': 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', + 'URL': ( + 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/' + '{z}/{x}/{y}.png' + ), 'STATICMAP_SUBDOMAINS': 'a,b,c', } with patch('random.choice', return_value='b'): - assert ( - get_static_map_tile_server_url(tile_config) - == 'https://b.tile.openstreetmap.org/{z}/{x}/{y}.png' + assert get_static_map_tile_server_url(tile_config) == ( + 'https://b.tile-cyclosm.openstreetmap.fr/cyclosm/' + '{z}/{x}/{y}.png' )