summaryrefslogtreecommitdiff
path: root/macosx/main.mm
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/main.mm')
-rw-r--r--macosx/main.mm18
1 files changed, 9 insertions, 9 deletions
diff --git a/macosx/main.mm b/macosx/main.mm
index 34cd7872b5..7d5226d246 100644
--- a/macosx/main.mm
+++ b/macosx/main.mm
@@ -1,5 +1,4 @@
#include <mbgl/platform/log.hpp>
-#include "../platform/default/default_styles.hpp"
#include <mbgl/platform/platform.hpp>
#include <mbgl/platform/darwin/settings_nsuserdefaults.hpp>
#include <mbgl/platform/darwin/reachability.h>
@@ -9,6 +8,7 @@
#include <mbgl/storage/network_status.hpp>
#include <mbgl/util/geo.hpp>
+#include <mbgl/util/default_styles.hpp>
#import <Foundation/Foundation.h>
@@ -172,23 +172,23 @@ int main(int argc, char* argv[]) {
view.setChangeStyleCallback([&map, &view] () {
static uint8_t currentStyleIndex;
- if (++currentStyleIndex == mbgl::util::defaultStyles.size()) {
+ if (++currentStyleIndex == mbgl::util::default_styles::numOrderedStyles) {
currentStyleIndex = 0;
}
- const auto& newStyle = mbgl::util::defaultStyles[currentStyleIndex];
- map.setStyleURL(newStyle.first);
- view.setWindowTitle(newStyle.second);
+ mbgl::util::default_styles::DefaultStyle newStyle = mbgl::util::default_styles::orderedStyles[currentStyleIndex];
+ map.setStyleURL(newStyle.url);
+ view.setWindowTitle(newStyle.name);
- mbgl::Log::Info(mbgl::Event::Setup, std::string("Changed style to: ") + newStyle.first);
+ mbgl::Log::Info(mbgl::Event::Setup, std::string("Changed style to: ") + newStyle.name);
});
// Load style
if (style.empty()) {
- const auto& newStyle = mbgl::util::defaultStyles.front();
- style = newStyle.first;
- view.setWindowTitle(newStyle.second);
+ mbgl::util::default_styles::DefaultStyle newStyle = mbgl::util::default_styles::orderedStyles[0];
+ style = newStyle.url;
+ view.setWindowTitle(newStyle.name);
}
map.setStyleURL(style);