Skip to content

Commit

Permalink
Removed hillshading option. This will be replaced by better maps.
Browse files Browse the repository at this point in the history
Closes #838

# Conflicts:
#	src/common/mapflags.h
#	src/gui/mainwindow.cpp
#	src/mapgui/mapwidget.cpp
  • Loading branch information
albar965 committed Apr 7, 2022
1 parent 39b112a commit e1bf2f0
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 101 deletions.
16 changes: 0 additions & 16 deletions marble/data/maps/earth/cartodark/cartodark.dgml
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,13 @@
<downloadPolicy usage="Browse" maximumConnections="2"/>
<downloadPolicy usage="Bulk" maximumConnections="2"/>
</texture>
<texture name="hillshading" expire="31536000">
<sourcedir format="PNG"> earth/hillshading </sourcedir>
<tileSize width="256" height="256"/>
<storageLayout levelZeroColumns="1" levelZeroRows="1" maximumTileLevel="17" mode="OpenStreetMap"/>
<projection name="Mercator"/>
<downloadUrl protocol="http" host="a.tiles.wmflabs.org" path="/hillshading/"/>
<downloadUrl protocol="http" host="b.tiles.wmflabs.org" path="/hillshading/"/>
<downloadUrl protocol="http" host="c.tiles.wmflabs.org" path="/hillshading/"/>
<blending name="AlphaBlending"/>
</texture>
</layer>
</map>
<settings>
<property name="coordinate-grid">
<value>false</value>
<available>true</available>
</property>
<group name="Texture Layers">
<property name="hillshading">
<value>false</value>
<available>true</available>
</property>
</group>
</settings>
</document>
</dgml>
16 changes: 0 additions & 16 deletions marble/data/maps/earth/cartolight/cartolight.dgml
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,13 @@
<downloadPolicy usage="Browse" maximumConnections="2"/>
<downloadPolicy usage="Bulk" maximumConnections="2"/>
</texture>
<texture name="hillshading" expire="31536000">
<sourcedir format="PNG"> earth/hillshading </sourcedir>
<tileSize width="256" height="256"/>
<storageLayout levelZeroColumns="1" levelZeroRows="1" maximumTileLevel="17" mode="OpenStreetMap"/>
<projection name="Mercator"/>
<downloadUrl protocol="http" host="a.tiles.wmflabs.org" path="/hillshading/"/>
<downloadUrl protocol="http" host="b.tiles.wmflabs.org" path="/hillshading/"/>
<downloadUrl protocol="http" host="c.tiles.wmflabs.org" path="/hillshading/"/>
<blending name="AlphaBlending"/>
</texture>
</layer>
</map>
<settings>
<property name="coordinate-grid">
<value>false</value>
<available>true</available>
</property>
<group name="Texture Layers">
<property name="hillshading">
<value>false</value>
<available>true</available>
</property>
</group>
</settings>
</document>
</dgml>
Binary file removed marble/data/maps/earth/hillshading/0/0/0.png
Binary file not shown.
16 changes: 0 additions & 16 deletions marble/data/maps/earth/openstreetmap/openstreetmap.dgml
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,13 @@

<downloadPolicy usage="Bulk" maximumConnections="2"/>
</texture>
<texture name="hillshading" expire="31536000">
<sourcedir format="PNG"> earth/hillshading </sourcedir>
<tileSize width="256" height="256"/>
<storageLayout levelZeroColumns="1" levelZeroRows="1" maximumTileLevel="17" mode="OpenStreetMap"/>
<projection name="Mercator"/>
<downloadUrl protocol="http" host="a.tiles.wmflabs.org" path="/hillshading/"/>
<downloadUrl protocol="http" host="b.tiles.wmflabs.org" path="/hillshading/"/>
<downloadUrl protocol="http" host="c.tiles.wmflabs.org" path="/hillshading/"/>
<blending name="AlphaBlending"/>
</texture>
</layer>
</map>
<settings>
<property name="coordinate-grid">
<value>false</value>
<available>true</available>
</property>
<group name="Texture Layers">
<property name="hillshading">
<value>false</value>
<available>true</available>
</property>
</group>
</settings>
<legend>

Expand Down
9 changes: 7 additions & 2 deletions src/common/mapflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,13 @@ enum MapThemeComboIndex
};

/* All known map theme names =========================================== */
static const QStringList STOCK_MAP_THEMES({"clouds", "hillshading", "openstreetmap", "opentopomap", "plain",
"political", "srtm", "srtm2", "stamenterrain", "cartodark", "cartolight"});
static const QStringList STOCK_MAP_THEMES({
// Slippy maps - online maps
"openstreetmap", "opentopomap", "stamenterrain", "cartolight", "cartodark", "humanitarian",
// Included offline maps
"political", "plain", "srtm",
// Other background services
"srtm2"});

/* Sun shading sub menu actions.
* Values are saved in settings do not change */
Expand Down
6 changes: 3 additions & 3 deletions src/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1428,11 +1428,11 @@ void MainWindow::connectAllSlots()
connect(ui->actionMapShowAirportWeather, &QAction::toggled, this, &MainWindow::updateMapObjectsShown);
connect(ui->actionMapShowCities, &QAction::toggled, this, &MainWindow::updateMapObjectsShown);
connect(ui->actionMapShowGrid, &QAction::toggled, this, &MainWindow::updateMapObjectsShown);
connect(ui->actionMapShowHillshading, &QAction::toggled, this, &MainWindow::updateMapObjectsShown);
connect(ui->actionMapShowAirports, &QAction::toggled, this, &MainWindow::updateMapObjectsShown);
connect(ui->actionMapShowSoftAirports, &QAction::toggled, this, &MainWindow::updateMapObjectsShown);
connect(ui->actionMapShowEmptyAirports, &QAction::toggled, this, &MainWindow::updateMapObjectsShown);
connect(ui->actionMapShowAddonAirports, &QAction::toggled, this, &MainWindow::updateMapObjectsShown);

connect(ui->actionMapShowVor, &QAction::toggled, this, &MainWindow::updateMapObjectsShown);
connect(ui->actionMapShowNdb, &QAction::toggled, this, &MainWindow::updateMapObjectsShown);
connect(ui->actionMapShowWp, &QAction::toggled, this, &MainWindow::updateMapObjectsShown);
Expand Down Expand Up @@ -3907,7 +3907,7 @@ void MainWindow::restoreStateMain()

// Map settings that are always loaded
widgetState.restore({mapProjectionComboBox, mapThemeComboBox, ui->actionMapShowGrid, ui->actionMapShowCities,
ui->actionMapShowHillshading, ui->actionRouteEditMode,
ui->actionRouteEditMode,
ui->actionRouteSaveSidStarWaypoints, ui->actionRouteSaveApprWaypoints,
ui->actionRouteSaveAirwayWaypoints, ui->actionLogdataCreateLogbook, ui->actionMapShowSunShading,
ui->actionMapShowAirportWeather, ui->actionMapShowMinimumAltitude, ui->actionRunWebserver,
Expand Down Expand Up @@ -4099,7 +4099,7 @@ void MainWindow::saveActionStates()
ui->actionMapShowCompassRose, ui->actionMapShowCompassRoseAttach, ui->actionMapAircraftCenter,
ui->actionMapShowAircraftAi, ui->actionMapShowAircraftAiBoat, ui->actionMapShowAircraftTrack,
ui->actionInfoApproachShowMissedAppr, ui->actionMapShowGrid, ui->actionMapShowCities,
ui->actionMapShowSunShading, ui->actionMapShowHillshading, ui->actionMapShowAirportWeather,
ui->actionMapShowSunShading, ui->actionMapShowAirportWeather,
ui->actionMapShowMinimumAltitude, ui->actionRouteEditMode,
ui->actionRouteSaveSidStarWaypoints, ui->actionRouteSaveApprWaypoints,
ui->actionRouteSaveAirwayWaypoints, ui->actionLogdataCreateLogbook, ui->actionRunWebserver,
Expand Down
23 changes: 0 additions & 23 deletions src/gui/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@
<addaction name="separator"/>
<addaction name="actionMapShowGrid"/>
<addaction name="actionMapShowCities"/>
<addaction name="actionMapShowHillshading"/>
<addaction name="actionMapShowMinimumAltitude"/>
<addaction name="separator"/>
<addaction name="actionMapShowAirportWeather"/>
Expand Down Expand Up @@ -5496,7 +5495,6 @@ relation to shown airport</string>
<addaction name="separator"/>
<addaction name="actionMapShowGrid"/>
<addaction name="actionMapShowCities"/>
<addaction name="actionMapShowHillshading"/>
<addaction name="actionMapShowMinimumAltitude"/>
<addaction name="actionMapShowAirportWeather"/>
<addaction name="actionMapShowSunShading"/>
Expand Down Expand Up @@ -8062,27 +8060,6 @@ Disabled if a navdatabase does not allow it.</string>
<string>Ctrl+Shift+D</string>
</property>
</action>
<action name="actionMapShowHillshading">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../../littlenavmap.qrc">
<normaloff>:/littlenavmap/resources/icons/hillshading.svg</normaloff>:/littlenavmap/resources/icons/hillshading.svg</iconset>
</property>
<property name="text">
<string>Show &amp;Hillshading</string>
</property>
<property name="toolTip">
<string>Show hillshading on map</string>
</property>
<property name="statusTip">
<string>Show hillshading on map</string>
</property>
</action>
<action name="actionAboutMarble">
<property name="icon">
<iconset resource="../../littlenavmap.qrc">
Expand Down
6 changes: 0 additions & 6 deletions src/mapgui/mappaintwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,6 @@ void MapPaintWidget::copySettings(const MapPaintWidget& other)
mapDetailLevel = other.mapDetailLevel;
avoidBlurredMap = other.avoidBlurredMap;

if(hillshading != other.hillshading)
{
hillshading = other.hillshading;
setPropertyValue("hillshading", hillshading);
}

if(size() != other.size())
resize(other.size());
}
Expand Down
3 changes: 0 additions & 3 deletions src/mapgui/mappaintwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,6 @@ class MapPaintWidget :
/* Defines amount of objects and other attributes on the map. min 5, max 15, default 10. */
int mapDetailLevel;

/* Need to maintain this parallel since Marble has no method to read properties */
bool hillshading = false;

MapPaintLayer *paintLayer;

/* Do not draw while database is unavailable */
Expand Down
17 changes: 1 addition & 16 deletions src/mapgui/mapwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2827,7 +2827,7 @@ void MapWidget::resetSettingActionsToDefault()
ui->actionMapShowCompassRoseAttach, ui->actionMapAircraftCenter,
ui->actionMapShowAircraftAi, ui->actionMapShowAircraftAiBoat,
ui->actionMapShowAircraftTrack, ui->actionInfoApproachShowMissedAppr,
ui->actionMapShowGrid, ui->actionMapShowCities, ui->actionMapShowHillshading,
ui->actionMapShowGrid, ui->actionMapShowCities,
ui->actionMapShowMinimumAltitude, ui->actionMapShowAirportWeather,
ui->actionMapShowSunShading});

Expand Down Expand Up @@ -2869,7 +2869,6 @@ void MapWidget::resetSettingActionsToDefault()
// -----------------
ui->actionMapShowGrid->setChecked(true);
ui->actionMapShowCities->setChecked(true);
ui->actionMapShowHillshading->setChecked(true);
ui->actionMapShowMinimumAltitude->setChecked(true);

// -----------------
Expand All @@ -2889,7 +2888,6 @@ void MapWidget::updateThemeUi(int index)
{
// Enable all buttons for custom maps
ui->actionMapShowCities->setEnabled(true);
ui->actionMapShowHillshading->setEnabled(true);
ui->actionMapShowSunShading->setEnabled(true);
}
else
Expand All @@ -2899,24 +2897,17 @@ void MapWidget::updateThemeUi(int index)
{
case map::STAMENTERRAIN:
case map::OPENTOPOMAP:
ui->actionMapShowCities->setEnabled(false);
ui->actionMapShowHillshading->setEnabled(false);
ui->actionMapShowSunShading->setEnabled(true);
break;

case map::OPENSTREETMAP:
case map::CARTOLIGHT:
case map::CARTODARK:
ui->actionMapShowCities->setEnabled(false);
ui->actionMapShowHillshading->setEnabled(true);
ui->actionMapShowSunShading->setEnabled(true);
break;

case map::SIMPLE:
case map::PLAIN:
case map::ATLAS:
ui->actionMapShowCities->setEnabled(true);
ui->actionMapShowHillshading->setEnabled(false);
ui->actionMapShowSunShading->setEnabled(false);
break;

Expand Down Expand Up @@ -2973,12 +2964,6 @@ void MapWidget::updateMapObjectsShown()
currentThemeIndex == map::ATLAS));
setShowGrid(ui->actionMapShowGrid->isChecked());

// Need to keep track of hillshading separately since Marble has not getter
hillshading = ui->actionMapShowHillshading->isChecked() &&
(currentThemeIndex == map::OPENSTREETMAP || currentThemeIndex == map::CARTODARK ||
currentThemeIndex == map::CARTOLIGHT || currentThemeIndex >= map::CUSTOM);
setPropertyValue("hillshading", hillshading);

setShowMapFeatures(map::AIRWAYV, ui->actionMapShowVictorAirways->isChecked());
setShowMapFeatures(map::AIRWAYJ, ui->actionMapShowJetAirways->isChecked());
setShowMapFeatures(map::TRACK, ui->actionMapShowTracks->isChecked() && NavApp::hasTracks());
Expand Down

0 comments on commit e1bf2f0

Please sign in to comment.