Skip to content

Commit

Permalink
Now disabling all offline POIs when map contains a download section (…
Browse files Browse the repository at this point in the history
…i.e. is online map).

Added new key {language} for DGML files for custom map request URLs. Allows to fetch Google map tiles using the GUI language instead of getting labels in random language.
#85
  • Loading branch information
albar965 committed Jan 27, 2022
1 parent e057db1 commit 68cf4c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion marble/data/maps/earth/example/example.dgml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

<!-- Example to build an url with access token, username and style.
A single access token or API key is often sufficient to access a map which requires an user account.
All keys enclosed in braces (except common ones like "x", "y", "z" and "zoomLevel") are extracted from
All keys enclosed in braces (except common ones like "x", "y", "z", "zoomLevel" and "language") are extracted from
the URL by LNM and are shown in the options dialog on page "Map Display Keys".
Allowed characters for keys are A-Z, a-z, 0-9, _, - and space.
The keys should to be unique for all available maps/map providers and shoult be user readable.
Expand All @@ -89,6 +89,14 @@
<downloadUrl protocol="https" host="tile.openstreetmap.org" path="/{z}/{x}/{y}.png" />
DGML without tag "downloadUrl" will be marked as offline maps.
Default keys are:
{language} Two letter language code as used in the GUI
{zoomLevel} Slippy map zoom level
{z} Synonym for {zoomLevel}
{x} Slippy map tile coordinate
{y} Slippy map tile coordinate
-->
<downloadUrl host="example.com"
path="/styles/v1/{Example Map Username}/{Example Map Style}/tiles/512/{z}/{x}/{y}?access_token={Example Token}"
Expand Down
2 changes: 1 addition & 1 deletion src/mapgui/mapthemehandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ MapTheme MapThemeHandler::loadTheme(const QFileInfo& dgml)
QString key = regexpIter.next().captured(1);

// Ignore default keys
if(key != "x" && key != "y" && key != "z" && key != "zoomLevel" &&
if(key != "x" && key != "y" && key != "z" && key != "zoomLevel" && key != "language" &&
key != "west" && key != "south" && key != "east" && key != "north")
theme.keys.append(key);
}
Expand Down
2 changes: 1 addition & 1 deletion src/mapgui/mapthemehandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class MapTheme
/* Enable show city and other POIs button if true */
bool hasPlacemarks() const
{
return geodataLayer;
return geodataLayer && !online;
}

/* Offline themes cannot do sun shading */
Expand Down

0 comments on commit 68cf4c4

Please sign in to comment.