summaryrefslogtreecommitdiff
path: root/macosx/main.mm
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@codesorcery.net>2014-05-31 11:32:42 -0700
committerJustin R. Miller <incanus@codesorcery.net>2014-05-31 11:32:42 -0700
commita81a336638000f1986f1bde56e909a07b2a6ae36 (patch)
tree19ca5424367a3c89e76009a77fe54413d8c3ea51 /macosx/main.mm
parent6fd1525335bb753bb0efdfc3cfb58e1b6c4c1539 (diff)
downloadqtlocation-mapboxgl-a81a336638000f1986f1bde56e909a07b2a6ae36.tar.gz
programmatic styling API
Diffstat (limited to 'macosx/main.mm')
-rw-r--r--macosx/main.mm10
1 files changed, 9 insertions, 1 deletions
diff --git a/macosx/main.mm b/macosx/main.mm
index 174b0f1b1f..4c5da2f329 100644
--- a/macosx/main.mm
+++ b/macosx/main.mm
@@ -1,6 +1,8 @@
#include "../common/settings_nsuserdefaults.hpp"
#include "../common/glfw_view.hpp"
+#import <Foundation/Foundation.h>
+
int main() {
GLFWView view;
llmr::Map map(view);
@@ -10,7 +12,13 @@ int main() {
map.setLonLatZoom(settings.longitude, settings.latitude, settings.zoom);
map.setAngle(settings.angle);
map.setDebug(settings.debug);
- map.toggleRaster();
+
+ // Load style
+ NSString *path = [[NSBundle mainBundle] pathForResource:@"style.min" ofType:@"js"];
+ NSString *json = [NSString stringWithContentsOfFile:path
+ encoding:[NSString defaultCStringEncoding]
+ error:nil];
+ map.setStyleJSON((std::string)[json cStringUsingEncoding:[NSString defaultCStringEncoding]]);
// fprintf(stderr, "lon: %f, lat: %f, zoom: %f, angle: %f, debug: %d\n", settings.l)