summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-01-22 07:02:14 -0800
committerKonstantin Käfer <mail@kkaefer.com>2015-02-04 10:49:06 +0100
commit92a7f73bbe10f817d5c2d607ba07fc69b859593b (patch)
tree6dfb4734d3b8731e8ec21cd036b192eceb31104b /linux
parentbf629c97db98cc835e324409edfd8729bb3583c2 (diff)
downloadqtlocation-mapboxgl-92a7f73bbe10f817d5c2d607ba07fc69b859593b.tar.gz
fixes for linux
Diffstat (limited to 'linux')
-rw-r--r--linux/main.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/linux/main.cpp b/linux/main.cpp
index c324e76094..fdcf8baab9 100644
--- a/linux/main.cpp
+++ b/linux/main.cpp
@@ -4,7 +4,8 @@
#include <mbgl/platform/default/settings_json.hpp>
#include <mbgl/platform/default/glfw_view.hpp>
#include <mbgl/platform/default/log_stderr.hpp>
-#include <mbgl/storage/caching_http_file_source.hpp>
+#include <mbgl/storage/default/default_file_source.hpp>
+#include <mbgl/storage/default/sqlite_cache.hpp>
#include <signal.h>
#include <getopt.h>
@@ -64,7 +65,9 @@ int main(int argc, char *argv[]) {
sigaction(SIGINT, &sigIntHandler, NULL);
view = new GLFWView();
- mbgl::CachingHTTPFileSource fileSource();
+
+ mbgl::SQLiteCache cache("/tmp/mbgl-cache.db");
+ mbgl::DefaultFileSource fileSource(&cache);
mbgl::Map map(*view, fileSource);
// Load settings
@@ -78,12 +81,13 @@ int main(int argc, char *argv[]) {
if (token == nullptr) {
mbgl::Log::Warning(mbgl::Event::Setup, "no access token set. mapbox.com tiles won't work.");
} else {
- fileSource.setAccessToken(std::string(token));
+ map.setAccessToken(std::string(token));
}
// Load style
- if (style.empty())
+ if (style.empty()) {
style = std::string("asset://") + std::string("styles/bright-v7.json");
+ }
map.setStyleURL(style);