summaryrefslogtreecommitdiff
path: root/macosx
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
parent6fd1525335bb753bb0efdfc3cfb58e1b6c4c1539 (diff)
downloadqtlocation-mapboxgl-a81a336638000f1986f1bde56e909a07b2a6ae36.tar.gz
programmatic styling API
Diffstat (limited to 'macosx')
-rw-r--r--macosx/llmr-app.gyp1
-rw-r--r--macosx/main.mm10
2 files changed, 10 insertions, 1 deletions
diff --git a/macosx/llmr-app.gyp b/macosx/llmr-app.gyp
index 83bcd0f039..02319da94b 100644
--- a/macosx/llmr-app.gyp
+++ b/macosx/llmr-app.gyp
@@ -21,6 +21,7 @@
'mac_bundle': 1,
'mac_bundle_resources': [
'Icon.icns',
+ '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js'
],
'xcode_settings': {
'SDKROOT': 'macosx',
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)