diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-01-17 16:35:00 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2017-02-13 13:02:40 +0100 |
commit | 1771bebf53d804b5076fcfc0867a81fa281917d1 (patch) | |
tree | fbe6f0c945f9fc57c747991308bd13faa1e42738 | |
parent | 26e6101dbe48c1986fb36d85eedab1695679e58a (diff) | |
download | qtlocation-mapboxgl-upstream/custom-queries.tar.gz |
Example adding a query string to OSM tilesupstream/custom-queries
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapboxApplication.java | 2 | ||||
-rw-r--r-- | platform/macos/app/AppDelegate.m | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapboxApplication.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapboxApplication.java index a10c6eaad3..0ff79f8aae 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapboxApplication.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapboxApplication.java @@ -38,6 +38,8 @@ public class MapboxApplication extends Application { .build()); Mapbox.getInstance(getApplicationContext(), getString(R.string.mapbox_access_token)); + + Mapbox.setCustomQuery("a.tile.openstreetmap.org", "access_token=xxx"); } private void initializeLogger() { diff --git a/platform/macos/app/AppDelegate.m b/platform/macos/app/AppDelegate.m index 5b848cc79b..8454624a28 100644 --- a/platform/macos/app/AppDelegate.m +++ b/platform/macos/app/AppDelegate.m @@ -131,6 +131,9 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; [self showPreferences:nil]; } + NSDictionary* customQueries = [NSDictionary dictionaryWithObject:@"access_token=xxx" forKey:@"a.tile.openstreetmap.org"]; + [[NSUserDefaults standardUserDefaults] setObject:customQueries forKey:@"MBXCustomQuery"]; + [self.offlinePacksArrayController bind:@"content" toObject:[MGLOfflineStorage sharedOfflineStorage] withKeyPath:@"packs" options:nil]; } |