diff options
author | Justin R. Miller <incanus@users.noreply.github.com> | 2014-05-31 11:54:00 -0700 |
---|---|---|
committer | Justin R. Miller <incanus@users.noreply.github.com> | 2014-05-31 11:54:00 -0700 |
commit | 92e1a8d59395480814e349abf28f379e2ee82665 (patch) | |
tree | ed1a02119338e6b3c9fea09efc6813a2ae5c3822 /macosx | |
parent | 2ee26ba0e6de7ee3eb60906ede41a65b65ac70f2 (diff) | |
parent | eb35c0181d60011008672a96a83b4c61b6fa6c1c (diff) | |
download | qtlocation-mapboxgl-92e1a8d59395480814e349abf28f379e2ee82665.tar.gz |
Merge pull request #293 from mapbox/livestyle-squash
merge programmatic styling API
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/llmr-app.gyp | 1 | ||||
-rw-r--r-- | macosx/main.mm | 10 |
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) |