├── .github └── FUNDING.yml ├── .gitignore ├── README.md ├── api ├── MapsWithMeAPI.h └── MapsWithMeAPI.m ├── capitals-example ├── Capitals.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── Capitals │ ├── 100x100.png │ ├── 114x114.png │ ├── 144x144.png │ ├── 29x29.png │ ├── 50x50.png │ ├── 57x57.png │ ├── 58x58.png │ ├── 72x72.png │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Capitals-Info.plist │ ├── Capitals-Prefix.pch │ ├── CityDetailViewController.h │ ├── CityDetailViewController.m │ ├── CityDetailViewController.xib │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── MasterViewController.h │ ├── MasterViewController.m │ ├── MasterViewController.xib │ ├── capitals.plist │ └── main.m └── site-resources ├── add_custom_url_scheme.png └── download_mwm_dialog.png /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: organicmaps 2 | liberapay: OrganicMaps 3 | custom: ["https://organicmaps.app/donate"] 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | capitals-example/Capitals.xcodeproj/project.xcworkspace/xcshareddata/ 2 | capitals-example/Capitals.xcodeproj/project.xcworkspace/xcuserdata/ 3 | capitals-example/Capitals.xcodeproj/xcuserdata/ 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## MAPS.ME iOS API: Getting Started 2 | 3 | ### Introduction 4 | 5 | MAPS.ME (MapsWithMe) offline maps API for iOS (hereinafter referred to as *API*) provides an interface for other applications to perform the following tasks: 6 | 7 | For API version 1 (supported by MapsWithMe 2.4+) 8 | * Open [MapsWithMe Application][linkMwm] 9 | * Check that [MapsWithMe][linkMwm] is installed 10 | * Show one or more points on an offline map of [MapsWithMe][linkMwm] with *Back* button and client app name in the title 11 | * Return the user back to the client application: 12 | * after pressing *Back* button on the map 13 | * after selecting specific point on the map if user asks for more information by pressing *More Info* button in [MapsWithMe][linkMwm] 14 | * Open any given url or url scheme after selecting specific point on the map if user asks for more information by pressing *More Info* button in [MapsWithMe][linkMwm] 15 | * Automatically display [*Download MapsWithMe*][linkDownloadMWMDialog] dialog if [MapsWithMe][linkMwm] is not installed. 16 | 17 | In general it is possible to establish a one way or two way communication between MapsWithMe and your app. 18 | 19 | Please check our [offline travel guide apps][linkTravelGuides] as an API integration example. 20 | 21 | ### Prerequisites 22 | 23 | * Your application must target at least *iOS version 5.0* 24 | * For two way communication, you should add unique [URL scheme][linkAppleCustomUrlSchemes] to your app (see below) 25 | 26 | ### Integration 27 | 28 | First step is to clone [repository][linkRepo] or download it as an archive. 29 | 30 | When your are done you find two folders: *api* and *capitals-example*. 31 | First one contains .h and .m files which you need to include into your project. You can always modify them according to your needs. 32 | 33 | If you want to get results of API calls, please add unique URL scheme to your app. You can do it with [XCode][linkAddUrlScheme] or by editing Info.plist file in your project. To make things simple, use *mapswithme* keyword in scheme ID, like *my_mapswithme_scheme*, and create an unique scheme name (or use your existing one). 34 | *mapswithme* keyword in scheme ID simply helps API code to detect it automatically. See more details in [Apple's documentation][linkAppleCustomUrlSchemes]. 35 | 36 | MAPS.ME (MapsWithMe) supports two schemes: "mapswithme://" and "mapswithmepro://" 37 | 38 | iOS9+ note: you need to add LSApplicationQueriesSchemes key into your plist with value mapswithme to correctly query if MAPS.ME is installed. 39 | 40 | *capitals-example* folder contains sample application which demonstrates part of API features. 41 | 42 | *NOTE: If you are using Automatic References Counting (ARC) in your project, you can use [this solution][linkFixARC] or simply fix code by yourself.* 43 | 44 | ### API Calls Overview and HOW TO 45 | 46 | * All methods are static for *MWMApi* class, *BOOL* methods return *NO* if call is failed. 47 | * If id for given pin contains valid url, it will be opened from MapsWithMe after selecting *More Info* button. 48 | For any other content, id will be simply passed back to the caller's [*AppDelegate application:openURL:sourceApplication:annotation:*][linkAppleDelegate] method 49 | 50 | #### Open [MapsWithMe Application][linkMwm] 51 | 52 | Simply opens MapsWithMe app: 53 | 54 | + (BOOL)showMap; 55 | 56 | Example: 57 | 58 | [MWMApi showMap]; 59 | 60 | #### Show specified location on the map 61 | 62 | Displays given point on a map: 63 | 64 | + (BOOL)showLat:(double)lat lon:(double)lon title:(NSString *)title and:(NSString *)idOrUrl; 65 | 66 | The same as above but using pin wrapper: 67 | 68 | + (BOOL)showPin:(MWMPin *)pin; 69 | 70 | Pin wrapper is a simple helper to wrap pins displayed on the map: 71 | 72 | @interface MWMPin : NSObject 73 | @property (nonatomic, assign) double lat; 74 | @property (nonatomic, assign) double lon; 75 | @property (nonatomic, retain) NSString * title; 76 | @property (nonatomic, retain) NSString * idOrUrl; 77 | - (id)initWithLat:(double)lat lon:(double)lon title:(NSString *)title and:(NSString *)idOrUrl; 78 | @end 79 | 80 | Example: 81 | 82 | [MWMApi showLat:53.9 lon:27.56667 title:@"Minsk - the capital of Belarus" and:@"http://wikipedia.org/wiki/Minsk"]; 83 | … 84 | MWMPin * goldenGate = [[MWMPin alloc] init] autorelease]; 85 | goldenGate.lat = 37.8195; 86 | goldenGate.lon = -122.4785; 87 | goldenGate.title = @"Golden Gate in San Francisco"; 88 | goldenGate.idOrUrl = @"any number or string here you want to receive back in your app, or any url you want to be opened from MapsWithMe"; 89 | [MWMApi showPin:goldenGate]; 90 | 91 | #### Show any number of pins on the map 92 | 93 | + (BOOL)showPins:(NSArray *)pins; 94 | 95 | #### Receiving results of API calls 96 | 97 | When users presses *Back* button in MapsWithMe, or selects *More Info* button, he is redirected back to your app. 98 | Here are helper methods to obtain API call results: 99 | 100 | Returns YES if url is received from MapsWithMe and can be parsed: 101 | 102 | + (BOOL)isMapsWithMeUrl:(NSURL *)url; 103 | 104 | Returns nil if user didn't select any pin and simply pressed *Back* button: 105 | 106 | + (MWMPin *)pinFromUrl:(NSURL *)url; 107 | 108 | Example: 109 | 110 | if ([MWMApi isMapsWithMeUrl:url]) 111 | { 112 | // Good, here we know that your app was opened from MapsWithMe 113 | MWMPin * pin = [MWMApi pinFromUrl:url]; 114 | if (pin) 115 | { 116 | // User selected specific pin, and we can get it's properties 117 | } 118 | else 119 | { 120 | // User pressed "Back" button and didn't select any pin 121 | } 122 | } 123 | 124 | Note, that you can simply check that *sourceApplication* contains *com.mapswithme.* substring to detect that your app is opened from MapsWithMe. 125 | 126 | #### Check that MapsWithMe is installed 127 | 128 | Returns NO if MapsWithMe is not installed or outdated version doesn't support API calls: 129 | 130 | + (BOOL)isApiSupported; 131 | 132 | With this method you can check that user needs to install MapsWithMe and display your custom UI. 133 | Alternatively, you can do nothing and use built-in dialog which will offer users to install MapsWithMe. 134 | 135 | ### Set value if you want to open pin URL on balloon click (Available in 2.4.5) 136 | 137 | + (void)setOpenUrlOnBalloonClick:(BOOL)value; 138 | 139 | ### Under the hood 140 | 141 | If you prefer to use API on your own, here are some details about the implementation. 142 | 143 | Applications "talk" to each other using URL Scheme. API v1 supports the following parameters to the URL Scheme: 144 | 145 | mapswithme://map?v=1&ll=54.32123,12.34562&n=Point%20Name&id=AnyStringOrEncodedUrl&backurl=UrlToCallOnBackButton&appname=TitleToDisplayInNavBar 146 | 147 | * **v** - API version, currently *1* 148 | * **ll** - pin latitude and longitude, comma-separated 149 | * **n** - pin title 150 | * **id** - any string you want to receive back in your app, OR alternatively, any valid URL which will be opened on *More Info* button click 151 | * **backurl** - usually, your unique app scheme to open back your app 152 | * **appname** - string to display in navigation bar on top of the map in MAPS.ME 153 | * **balloonAction** - pass openUrlOnBalloonClick as a parameter, if you want to open pin url on balloon click(Usually pin url opens when "Show more info" button is pressed). (Available in 2.4.5) 154 | 155 | Note that you can display as many pins as you want, the only rule is that **ll** parameter comes before **n** and **id** for each point. 156 | 157 | When user selects a pin, your app is called like this: 158 | 159 | YourAppUniqueUrlScheme://pin?ll=lat,lon&n=PinName&id=PinId 160 | 161 | ------------------------------------------------------------------------------------------ 162 | ### API Code is licensed under the BSD 2-Clause License 163 | 164 | Copyright (c) 2019, MY.COM B.V. 165 | All rights reserved. 166 | 167 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 168 | 169 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 170 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 171 | 172 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 173 | 174 | [linkMwm]: https://maps.me/ "MAPS.ME - offline maps of the world" 175 | [linkRepo]: https://github.com/mapsme/api-ios "GitHub Repository" 176 | [linkAddUrlScheme]: https://raw.github.com/mapswithme/api-ios/site-resources/add_custom_url_scheme.png "How to add url scheme in XCode" 177 | [linkDownloadMWMDialog]: https://raw.github.com/mapswithme/api-ios/site-resources/download_mwm_dialog.png "Donwload MAPS.ME Dialog" 178 | [linkIssues]: https://github.com/mapsme/api-ios/issues "Post a bug or feature request" 179 | [linkAppleCustomUrlSchemes]: https://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW50 "Custom URL Scheme Apple documentation" 180 | [linkAppleDelegate]: https://developer.apple.com/library/ios/documentation/uikit/reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIApplicationDelegate/application:openURL:sourceApplication:annotation: "AppDelegate Handle custom URL Schemes" 181 | [linkFixARC]: http://stackoverflow.com/a/6658549/1209392 "How to compile non-ARC code in ARC projects" 182 | [linkTravelGuides]: http://guidewithme.com "Offline Travel Guides" 183 | -------------------------------------------------------------------------------- /api/MapsWithMeAPI.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2014, MapsWithMe GmbH 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ******************************************************************************/ 28 | 29 | #import 30 | 31 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0 32 | #error "maps.me supports iOS >= 7.0 only" 33 | #endif 34 | 35 | // Wrapper for a pin on a map 36 | @interface MWMPin : NSObject 37 | /// [required] pin latitude 38 | @property (nonatomic) double lat; 39 | /// [required] pin longitude 40 | @property (nonatomic) double lon; 41 | /// [optional] pin title 42 | @property (nullable, copy, nonatomic) NSString * title; 43 | /// [optional] passed back to the app when pin is clicked, OR, if it's a valid url, 44 | /// it will be opened from MapsWithMe after selecting "More Details..." for the pin 45 | @property (nullable, copy, nonatomic) NSString * idOrUrl; 46 | 47 | - (nullable instancetype)initWithLat:(double)lat 48 | lon:(double)lon 49 | title:(nullable NSString *)title 50 | idOrUrl:(nullable NSString *)idOrUrl; 51 | 52 | @end 53 | 54 | 55 | // MapsWithMe API interface 56 | @interface MWMApi : NSObject 57 | 58 | /// returns YES if url is received from MapsWithMe and can be parsed 59 | + (BOOL)isMapsWithMeUrl:(nonnull NSURL *)url; 60 | /// returns nil if user didn't select any pin and simply pressed "Back" button 61 | + (nullable MWMPin *)pinFromUrl:(nonnull NSURL *)url; 62 | /// returns NO if MapsWithMe is not installed or outdated version doesn't support API calls 63 | + (BOOL)isApiSupported; 64 | /// Simply opens MapsWithMe app 65 | + (BOOL)showMap; 66 | /// Displays given point on a map, title and id are optional. 67 | /// If id contains valid url, it will be opened from MapsWithMe after selecting "More Details..." for the pin 68 | + (BOOL)showLat:(double)lat lon:(double)lon title:(nullable NSString *)title idOrUrl:(nullable NSString *)idOrUrl; 69 | /// The same as above but using pin wrapper 70 | + (BOOL)showPin:(nullable MWMPin *)pin; 71 | /// Displays any number of pins 72 | + (BOOL)showPins:(nonnull NSArray *)pins; 73 | // 74 | + (void)showMapsWithMeIsNotInstalledDialog; 75 | /// Set value = YES if you want to open pin URL on balloon click, default value is NO 76 | + (void)setOpenUrlOnBalloonClick:(BOOL)value; 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /api/MapsWithMeAPI.m: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2014, MapsWithMe GmbH 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ******************************************************************************/ 28 | 29 | #import "MapsWithMeAPI.h" 30 | 31 | #define MAPSWITHME_API_VERSION 1.1 32 | 33 | static NSString * const kMWMUrlScheme = @"mapswithme://"; 34 | static BOOL kOpenUrlOnBalloonClick = NO; 35 | 36 | @implementation MWMPin 37 | 38 | - (nullable instancetype)init 39 | { 40 | self = [super init]; 41 | if (self) 42 | { 43 | _lat = INFINITY; 44 | _lon = INFINITY; 45 | } 46 | return self; 47 | } 48 | 49 | - (nullable instancetype)initWithLat:(double)lat 50 | lon:(double)lon 51 | title:(nullable NSString *)title 52 | idOrUrl:(nullable NSString *)idOrUrl 53 | { 54 | self = [super init]; 55 | if (self) 56 | { 57 | _lat = lat; 58 | _lon = lon; 59 | _title = title; 60 | _idOrUrl = idOrUrl; 61 | } 62 | return self; 63 | } 64 | 65 | @end 66 | 67 | // Utility class to automatically handle "MapsWithMe is not installed" situations 68 | @interface MWMNViewController : UIViewController 69 | 70 | @end 71 | 72 | @implementation MWMNViewController 73 | 74 | // HTML page for users who didn't install MapsWithMe 75 | static NSString * const mapsWithMeIsNotInstalledPage = 76 | @"" \ 77 | "" \ 78 | "Please install MAPS.ME - offline maps of the World" \ 79 | "" \ 80 | "" \ 81 | "" \ 89 | "" \ 90 | "" \ 91 | "
Offline maps are required to proceed. We have partnered with MAPS.ME to provide you with offline maps of the entire world.
" \ 92 | "
To continue please download the app:
" \ 93 | "Download MAPS.ME" \ 94 | "" \ 95 | ""; 96 | 97 | - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error 98 | { 99 | [(UIWebView *)self.view loadHTMLString:mapsWithMeIsNotInstalledPage baseURL:[NSURL URLWithString:@"http://maps.me/"]]; 100 | } 101 | 102 | - (void)onCloseButtonClicked:(id)sender 103 | { 104 | [self dismissViewControllerAnimated:YES completion:nil]; 105 | } 106 | 107 | @end 108 | 109 | 110 | @implementation MWMApi 111 | 112 | + (NSString *)urlEncode:(NSString *)str 113 | { 114 | return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)str, NULL, CFSTR("!$&'()*+,-./:;=?@_~"), kCFStringEncodingUTF8); 115 | } 116 | 117 | + (BOOL)isMapsWithMeUrl:(nonnull NSURL *)url 118 | { 119 | NSString * appScheme = [MWMApi detectBackUrlScheme]; 120 | return appScheme && [url.scheme isEqualToString:appScheme]; 121 | } 122 | 123 | + (nullable MWMPin *)pinFromUrl:(nonnull NSURL *)url 124 | { 125 | if (![MWMApi isMapsWithMeUrl:url]) 126 | return nil; 127 | 128 | MWMPin * pin = nil; 129 | if ([url.host isEqualToString:@"pin"]) 130 | { 131 | pin = [[MWMPin alloc] init]; 132 | for (NSString * param in [url.query componentsSeparatedByString:@"&"]) 133 | { 134 | NSArray * values = [param componentsSeparatedByString:@"="]; 135 | if ([values count] == 2) 136 | { 137 | NSString * key = values[0]; 138 | if ([key isEqualToString:@"ll"]) 139 | { 140 | NSArray * coords = [values[1] componentsSeparatedByString:@","]; 141 | if ([coords count] == 2) 142 | { 143 | pin.lat = [[NSDecimalNumber decimalNumberWithString:coords[0]] doubleValue]; 144 | pin.lon = [[NSDecimalNumber decimalNumberWithString:coords[1]] doubleValue]; 145 | } 146 | } 147 | else if ([key isEqualToString:@"n"]) 148 | pin.title = [values[1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 149 | else if ([key isEqualToString:@"id"]) 150 | pin.idOrUrl = [values[1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 151 | else 152 | NSLog(@"Unsupported url parameters: %@", values); 153 | } 154 | } 155 | // do not accept invalid coordinates 156 | if (pin.lat > 90. || pin.lat < -90. || pin.lon > 180. || pin.lon < -180.) 157 | pin = nil; 158 | } 159 | return pin; 160 | } 161 | 162 | + (BOOL)isApiSupported 163 | { 164 | return [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:kMWMUrlScheme]]; 165 | } 166 | 167 | + (BOOL)showMap 168 | { 169 | return [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[kMWMUrlScheme stringByAppendingFormat:@"map?v=%f", MAPSWITHME_API_VERSION]]]; 170 | } 171 | 172 | + (BOOL)showLat:(double)lat lon:(double)lon title:(nullable NSString *)title idOrUrl:(nullable NSString *)idOrUrl 173 | { 174 | MWMPin * pin = [[MWMPin alloc] initWithLat:lat lon:lon title:title idOrUrl:idOrUrl]; 175 | return [MWMApi showPin:pin]; 176 | } 177 | 178 | + (BOOL)showPin:(nullable MWMPin *)pin 179 | { 180 | return pin ? [MWMApi showPins:@[pin]] : NO; 181 | } 182 | 183 | + (BOOL)showPins:(nonnull NSArray *)pins 184 | { 185 | // Automatic check that MapsWithMe is installed 186 | if (![MWMApi isApiSupported]) 187 | { 188 | // Display dialog with link to the app 189 | [MWMApi showMapsWithMeIsNotInstalledDialog]; 190 | return NO; 191 | } 192 | 193 | NSString * appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; 194 | NSMutableString * str = [NSMutableString stringWithFormat:@"%@map?v=%f&appname=%@&", 195 | kMWMUrlScheme, 196 | MAPSWITHME_API_VERSION, 197 | [self urlEncode:appName]]; 198 | 199 | NSString * backUrlScheme = [MWMApi detectBackUrlScheme]; 200 | 201 | if (backUrlScheme) 202 | [str appendFormat:@"backurl=%@&", [self urlEncode:backUrlScheme]]; 203 | 204 | for (MWMPin * point in pins) 205 | { 206 | [str appendFormat:@"ll=%f,%f&", point.lat, point.lon]; 207 | @autoreleasepool 208 | { 209 | if (point.title) 210 | [str appendFormat:@"n=%@&", [self urlEncode:point.title]]; 211 | if (point.idOrUrl) 212 | [str appendFormat:@"id=%@&", [self urlEncode:point.idOrUrl]]; 213 | } 214 | } 215 | 216 | if (kOpenUrlOnBalloonClick) 217 | [str appendString:@"&balloonAction=kOpenUrlOnBalloonClick"]; 218 | 219 | NSURL * url = [NSURL URLWithString:str]; 220 | BOOL const result = [[UIApplication sharedApplication] openURL:url]; 221 | return result; 222 | } 223 | 224 | + (NSString *)detectBackUrlScheme 225 | { 226 | for (NSDictionary * dict in [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleURLTypes"]) 227 | { 228 | if ([dict[@"CFBundleURLName"] rangeOfString:@"mapswithme" options:NSCaseInsensitiveSearch].location != NSNotFound) 229 | { 230 | for (NSString * scheme in dict[@"CFBundleURLSchemes"]) 231 | { 232 | // We use the first scheme in this list, you can change this behavior if needed 233 | return scheme; 234 | } 235 | } 236 | } 237 | NSLog(@"WARNING: No com.mapswithme.maps url schemes are added in the Info.plist file. Please add them if you want API users to come back to your app."); 238 | return nil; 239 | } 240 | 241 | + (void)showMapsWithMeIsNotInstalledDialog 242 | { 243 | UIWebView * webView = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame]; 244 | // check that we have Internet connection and display fresh online page if possible 245 | [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://maps.me/api_mwm_not_installed"]]]; 246 | MWMNViewController * webController = [[MWMNViewController alloc] init]; 247 | webView.delegate = webController; 248 | webController.view = webView; 249 | webController.title = @"Install MAPS.ME"; 250 | UINavigationController * navController = [[UINavigationController alloc] initWithRootViewController:webController]; 251 | navController.navigationBar.topItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStyleDone target:webController action:@selector(onCloseButtonClicked:)]; 252 | 253 | UIWindow * window = [[UIApplication sharedApplication].windows firstObject]; 254 | [window.rootViewController presentViewController:navController animated:YES completion:nil]; 255 | } 256 | 257 | + (void)setOpenUrlOnBalloonClick:(BOOL)value 258 | { 259 | kOpenUrlOnBalloonClick = value; 260 | } 261 | 262 | @end 263 | -------------------------------------------------------------------------------- /capitals-example/Capitals.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 97F3580C185F5BB200DDF84D /* capitals.plist in Resources */ = {isa = PBXBuildFile; fileRef = 97F3580B185F5BB200DDF84D /* capitals.plist */; }; 11 | FA1792CE17784F000092B567 /* MapsWithMeAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1792CC17784F000092B567 /* MapsWithMeAPI.m */; }; 12 | FA776B4F17848A370023F7A0 /* MasterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = FA776B4D17848A370023F7A0 /* MasterViewController.xib */; }; 13 | FAA484EA178108970027B232 /* 114x114.png in Resources */ = {isa = PBXBuildFile; fileRef = FAA484E2178108970027B232 /* 114x114.png */; }; 14 | FAA484EB178108970027B232 /* 144x144.png in Resources */ = {isa = PBXBuildFile; fileRef = FAA484E3178108970027B232 /* 144x144.png */; }; 15 | FAA484EC178108970027B232 /* 100x100.png in Resources */ = {isa = PBXBuildFile; fileRef = FAA484E4178108970027B232 /* 100x100.png */; }; 16 | FAA484ED178108970027B232 /* 72x72.png in Resources */ = {isa = PBXBuildFile; fileRef = FAA484E5178108970027B232 /* 72x72.png */; }; 17 | FAA484EE178108970027B232 /* 58x58.png in Resources */ = {isa = PBXBuildFile; fileRef = FAA484E6178108970027B232 /* 58x58.png */; }; 18 | FAA484EF178108970027B232 /* 57x57.png in Resources */ = {isa = PBXBuildFile; fileRef = FAA484E7178108970027B232 /* 57x57.png */; }; 19 | FAA484F0178108970027B232 /* 50x50.png in Resources */ = {isa = PBXBuildFile; fileRef = FAA484E8178108970027B232 /* 50x50.png */; }; 20 | FAA484F1178108970027B232 /* 29x29.png in Resources */ = {isa = PBXBuildFile; fileRef = FAA484E9178108970027B232 /* 29x29.png */; }; 21 | FAD3DD4F177221B500B0735B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD3DD4E177221B500B0735B /* UIKit.framework */; }; 22 | FAD3DD51177221B500B0735B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD3DD50177221B500B0735B /* Foundation.framework */; }; 23 | FAD3DD53177221B500B0735B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD3DD52177221B500B0735B /* CoreGraphics.framework */; }; 24 | FAD3DD5B177221B500B0735B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = FAD3DD5A177221B500B0735B /* main.m */; }; 25 | FAD3DD5F177221B500B0735B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FAD3DD5E177221B500B0735B /* AppDelegate.m */; }; 26 | FAD3DD61177221B500B0735B /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FAD3DD60177221B500B0735B /* Default.png */; }; 27 | FAD3DD63177221B500B0735B /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FAD3DD62177221B500B0735B /* Default@2x.png */; }; 28 | FAD3DD65177221B500B0735B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FAD3DD64177221B500B0735B /* Default-568h@2x.png */; }; 29 | FAD3DD68177221B500B0735B /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FAD3DD67177221B500B0735B /* MasterViewController.m */; }; 30 | FAD3DD8317724D4A00B0735B /* CityDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FAD3DD8117724D4A00B0735B /* CityDetailViewController.m */; }; 31 | FAD3DD8417724D4A00B0735B /* CityDetailViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = FAD3DD8217724D4A00B0735B /* CityDetailViewController.xib */; }; 32 | /* End PBXBuildFile section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | 97F3580B185F5BB200DDF84D /* capitals.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = capitals.plist; sourceTree = ""; }; 36 | FA1792CC17784F000092B567 /* MapsWithMeAPI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MapsWithMeAPI.m; path = ../api/MapsWithMeAPI.m; sourceTree = ""; }; 37 | FA1792CD17784F000092B567 /* MapsWithMeAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MapsWithMeAPI.h; path = ../api/MapsWithMeAPI.h; sourceTree = ""; }; 38 | FA776B4D17848A370023F7A0 /* MasterViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MasterViewController.xib; sourceTree = ""; }; 39 | FAA484E2178108970027B232 /* 114x114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 114x114.png; sourceTree = ""; }; 40 | FAA484E3178108970027B232 /* 144x144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 144x144.png; sourceTree = ""; }; 41 | FAA484E4178108970027B232 /* 100x100.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 100x100.png; sourceTree = ""; }; 42 | FAA484E5178108970027B232 /* 72x72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 72x72.png; sourceTree = ""; }; 43 | FAA484E6178108970027B232 /* 58x58.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 58x58.png; sourceTree = ""; }; 44 | FAA484E7178108970027B232 /* 57x57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 57x57.png; sourceTree = ""; }; 45 | FAA484E8178108970027B232 /* 50x50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 50x50.png; sourceTree = ""; }; 46 | FAA484E9178108970027B232 /* 29x29.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 29x29.png; sourceTree = ""; }; 47 | FAD3DD4B177221B500B0735B /* World Capitals.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "World Capitals.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | FAD3DD4E177221B500B0735B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 49 | FAD3DD50177221B500B0735B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 50 | FAD3DD52177221B500B0735B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 51 | FAD3DD56177221B500B0735B /* Capitals-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Capitals-Info.plist"; sourceTree = ""; }; 52 | FAD3DD5A177221B500B0735B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 53 | FAD3DD5C177221B500B0735B /* Capitals-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Capitals-Prefix.pch"; sourceTree = ""; }; 54 | FAD3DD5D177221B500B0735B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 55 | FAD3DD5E177221B500B0735B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 56 | FAD3DD60177221B500B0735B /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 57 | FAD3DD62177221B500B0735B /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 58 | FAD3DD64177221B500B0735B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 59 | FAD3DD66177221B500B0735B /* MasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = ""; }; 60 | FAD3DD67177221B500B0735B /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = ""; }; 61 | FAD3DD8017724D4A00B0735B /* CityDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CityDetailViewController.h; sourceTree = ""; }; 62 | FAD3DD8117724D4A00B0735B /* CityDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CityDetailViewController.m; sourceTree = ""; }; 63 | FAD3DD8217724D4A00B0735B /* CityDetailViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CityDetailViewController.xib; sourceTree = ""; }; 64 | /* End PBXFileReference section */ 65 | 66 | /* Begin PBXFrameworksBuildPhase section */ 67 | FAD3DD48177221B500B0735B /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | FAD3DD4F177221B500B0735B /* UIKit.framework in Frameworks */, 72 | FAD3DD51177221B500B0735B /* Foundation.framework in Frameworks */, 73 | FAD3DD53177221B500B0735B /* CoreGraphics.framework in Frameworks */, 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | /* End PBXFrameworksBuildPhase section */ 78 | 79 | /* Begin PBXGroup section */ 80 | FA1792C7177843650092B567 /* MapsWithMe API */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | FA1792CD17784F000092B567 /* MapsWithMeAPI.h */, 84 | FA1792CC17784F000092B567 /* MapsWithMeAPI.m */, 85 | ); 86 | name = "MapsWithMe API"; 87 | sourceTree = ""; 88 | }; 89 | FAD3DD42177221B500B0735B = { 90 | isa = PBXGroup; 91 | children = ( 92 | FA1792C7177843650092B567 /* MapsWithMe API */, 93 | FAD3DD54177221B500B0735B /* Capitals */, 94 | FAD3DD4D177221B500B0735B /* Frameworks */, 95 | FAD3DD4C177221B500B0735B /* Products */, 96 | ); 97 | sourceTree = ""; 98 | }; 99 | FAD3DD4C177221B500B0735B /* Products */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | FAD3DD4B177221B500B0735B /* World Capitals.app */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | FAD3DD4D177221B500B0735B /* Frameworks */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | FAD3DD4E177221B500B0735B /* UIKit.framework */, 111 | FAD3DD50177221B500B0735B /* Foundation.framework */, 112 | FAD3DD52177221B500B0735B /* CoreGraphics.framework */, 113 | ); 114 | name = Frameworks; 115 | sourceTree = ""; 116 | }; 117 | FAD3DD54177221B500B0735B /* Capitals */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | FAD3DD5D177221B500B0735B /* AppDelegate.h */, 121 | FAD3DD5E177221B500B0735B /* AppDelegate.m */, 122 | FAD3DD8017724D4A00B0735B /* CityDetailViewController.h */, 123 | FAD3DD8117724D4A00B0735B /* CityDetailViewController.m */, 124 | FAD3DD8217724D4A00B0735B /* CityDetailViewController.xib */, 125 | FAD3DD66177221B500B0735B /* MasterViewController.h */, 126 | FAD3DD67177221B500B0735B /* MasterViewController.m */, 127 | FA776B4D17848A370023F7A0 /* MasterViewController.xib */, 128 | FAD3DD55177221B500B0735B /* Supporting Files */, 129 | ); 130 | path = Capitals; 131 | sourceTree = ""; 132 | }; 133 | FAD3DD55177221B500B0735B /* Supporting Files */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 97F3580B185F5BB200DDF84D /* capitals.plist */, 137 | FAA484E2178108970027B232 /* 114x114.png */, 138 | FAA484E3178108970027B232 /* 144x144.png */, 139 | FAA484E4178108970027B232 /* 100x100.png */, 140 | FAA484E5178108970027B232 /* 72x72.png */, 141 | FAA484E6178108970027B232 /* 58x58.png */, 142 | FAA484E7178108970027B232 /* 57x57.png */, 143 | FAA484E8178108970027B232 /* 50x50.png */, 144 | FAA484E9178108970027B232 /* 29x29.png */, 145 | FAD3DD56177221B500B0735B /* Capitals-Info.plist */, 146 | FAD3DD5A177221B500B0735B /* main.m */, 147 | FAD3DD5C177221B500B0735B /* Capitals-Prefix.pch */, 148 | FAD3DD60177221B500B0735B /* Default.png */, 149 | FAD3DD62177221B500B0735B /* Default@2x.png */, 150 | FAD3DD64177221B500B0735B /* Default-568h@2x.png */, 151 | ); 152 | name = "Supporting Files"; 153 | sourceTree = ""; 154 | }; 155 | /* End PBXGroup section */ 156 | 157 | /* Begin PBXNativeTarget section */ 158 | FAD3DD4A177221B500B0735B /* Capitals */ = { 159 | isa = PBXNativeTarget; 160 | buildConfigurationList = FAD3DD7A177221B500B0735B /* Build configuration list for PBXNativeTarget "Capitals" */; 161 | buildPhases = ( 162 | FAD3DD47177221B500B0735B /* Sources */, 163 | FAD3DD48177221B500B0735B /* Frameworks */, 164 | FAD3DD49177221B500B0735B /* Resources */, 165 | ); 166 | buildRules = ( 167 | ); 168 | dependencies = ( 169 | ); 170 | name = Capitals; 171 | productName = Capitals; 172 | productReference = FAD3DD4B177221B500B0735B /* World Capitals.app */; 173 | productType = "com.apple.product-type.application"; 174 | }; 175 | /* End PBXNativeTarget section */ 176 | 177 | /* Begin PBXProject section */ 178 | FAD3DD43177221B500B0735B /* Project object */ = { 179 | isa = PBXProject; 180 | attributes = { 181 | LastUpgradeCheck = 0720; 182 | ORGANIZATIONNAME = "MapsWithMe GmbH"; 183 | }; 184 | buildConfigurationList = FAD3DD46177221B500B0735B /* Build configuration list for PBXProject "Capitals" */; 185 | compatibilityVersion = "Xcode 3.2"; 186 | developmentRegion = English; 187 | hasScannedForEncodings = 0; 188 | knownRegions = ( 189 | en, 190 | ); 191 | mainGroup = FAD3DD42177221B500B0735B; 192 | productRefGroup = FAD3DD4C177221B500B0735B /* Products */; 193 | projectDirPath = ""; 194 | projectRoot = ""; 195 | targets = ( 196 | FAD3DD4A177221B500B0735B /* Capitals */, 197 | ); 198 | }; 199 | /* End PBXProject section */ 200 | 201 | /* Begin PBXResourcesBuildPhase section */ 202 | FAD3DD49177221B500B0735B /* Resources */ = { 203 | isa = PBXResourcesBuildPhase; 204 | buildActionMask = 2147483647; 205 | files = ( 206 | FAD3DD61177221B500B0735B /* Default.png in Resources */, 207 | 97F3580C185F5BB200DDF84D /* capitals.plist in Resources */, 208 | FAD3DD63177221B500B0735B /* Default@2x.png in Resources */, 209 | FAD3DD65177221B500B0735B /* Default-568h@2x.png in Resources */, 210 | FAD3DD8417724D4A00B0735B /* CityDetailViewController.xib in Resources */, 211 | FAA484EA178108970027B232 /* 114x114.png in Resources */, 212 | FAA484EB178108970027B232 /* 144x144.png in Resources */, 213 | FAA484EC178108970027B232 /* 100x100.png in Resources */, 214 | FAA484ED178108970027B232 /* 72x72.png in Resources */, 215 | FAA484EE178108970027B232 /* 58x58.png in Resources */, 216 | FAA484EF178108970027B232 /* 57x57.png in Resources */, 217 | FAA484F0178108970027B232 /* 50x50.png in Resources */, 218 | FAA484F1178108970027B232 /* 29x29.png in Resources */, 219 | FA776B4F17848A370023F7A0 /* MasterViewController.xib in Resources */, 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | }; 223 | /* End PBXResourcesBuildPhase section */ 224 | 225 | /* Begin PBXSourcesBuildPhase section */ 226 | FAD3DD47177221B500B0735B /* Sources */ = { 227 | isa = PBXSourcesBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | FAD3DD5B177221B500B0735B /* main.m in Sources */, 231 | FAD3DD5F177221B500B0735B /* AppDelegate.m in Sources */, 232 | FAD3DD68177221B500B0735B /* MasterViewController.m in Sources */, 233 | FAD3DD8317724D4A00B0735B /* CityDetailViewController.m in Sources */, 234 | FA1792CE17784F000092B567 /* MapsWithMeAPI.m in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin XCBuildConfiguration section */ 241 | FA776B5117848EC50023F7A0 /* Production */ = { 242 | isa = XCBuildConfiguration; 243 | buildSettings = { 244 | ALWAYS_SEARCH_USER_PATHS = NO; 245 | CLANG_CXX_LIBRARY = "libstdc++"; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_EMPTY_BODY = YES; 248 | CLANG_WARN_ENUM_CONVERSION = YES; 249 | CLANG_WARN_INT_CONVERSION = YES; 250 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 251 | CODE_SIGN_IDENTITY = "iPhone Distribution"; 252 | COPY_PHASE_STRIP = YES; 253 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 254 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 255 | GCC_WARN_UNUSED_VARIABLE = YES; 256 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 257 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 258 | PRODUCT_NAME = ""; 259 | PROVISIONING_PROFILE = ""; 260 | SDKROOT = iphoneos; 261 | TARGETED_DEVICE_FAMILY = "1,2"; 262 | VALIDATE_PRODUCT = YES; 263 | }; 264 | name = Production; 265 | }; 266 | FA776B5217848EC50023F7A0 /* Production */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | CLANG_ENABLE_OBJC_ARC = YES; 270 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 271 | GCC_PREFIX_HEADER = "Capitals/Capitals-Prefix.pch"; 272 | INFOPLIST_FILE = "Capitals/Capitals-Info.plist"; 273 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 274 | PRODUCT_BUNDLE_IDENTIFIER = com.mapswithme.api.example.Capitals; 275 | PRODUCT_NAME = "World Capitals"; 276 | WRAPPER_EXTENSION = app; 277 | }; 278 | name = Production; 279 | }; 280 | FAD3DD78177221B500B0735B /* Debug */ = { 281 | isa = XCBuildConfiguration; 282 | buildSettings = { 283 | ALWAYS_SEARCH_USER_PATHS = NO; 284 | CLANG_CXX_LIBRARY = "libstdc++"; 285 | CLANG_WARN_CONSTANT_CONVERSION = YES; 286 | CLANG_WARN_EMPTY_BODY = YES; 287 | CLANG_WARN_ENUM_CONVERSION = YES; 288 | CLANG_WARN_INT_CONVERSION = YES; 289 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 290 | CODE_SIGN_IDENTITY = "iPhone Developer"; 291 | COPY_PHASE_STRIP = NO; 292 | ENABLE_TESTABILITY = YES; 293 | GCC_DYNAMIC_NO_PIC = NO; 294 | GCC_OPTIMIZATION_LEVEL = 0; 295 | GCC_PREPROCESSOR_DEFINITIONS = ( 296 | "DEBUG=1", 297 | "$(inherited)", 298 | ); 299 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 300 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 301 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 302 | GCC_WARN_UNUSED_VARIABLE = YES; 303 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 304 | ONLY_ACTIVE_ARCH = YES; 305 | PRODUCT_NAME = ""; 306 | SDKROOT = iphoneos; 307 | TARGETED_DEVICE_FAMILY = "1,2"; 308 | }; 309 | name = Debug; 310 | }; 311 | FAD3DD79177221B500B0735B /* Release */ = { 312 | isa = XCBuildConfiguration; 313 | buildSettings = { 314 | ALWAYS_SEARCH_USER_PATHS = NO; 315 | CLANG_CXX_LIBRARY = "libstdc++"; 316 | CLANG_WARN_CONSTANT_CONVERSION = YES; 317 | CLANG_WARN_EMPTY_BODY = YES; 318 | CLANG_WARN_ENUM_CONVERSION = YES; 319 | CLANG_WARN_INT_CONVERSION = YES; 320 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 321 | CODE_SIGN_IDENTITY = "iPhone Developer"; 322 | COPY_PHASE_STRIP = YES; 323 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 324 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 325 | GCC_WARN_UNUSED_VARIABLE = YES; 326 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 327 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 328 | PRODUCT_NAME = ""; 329 | SDKROOT = iphoneos; 330 | TARGETED_DEVICE_FAMILY = "1,2"; 331 | VALIDATE_PRODUCT = YES; 332 | }; 333 | name = Release; 334 | }; 335 | FAD3DD7B177221B500B0735B /* Debug */ = { 336 | isa = XCBuildConfiguration; 337 | buildSettings = { 338 | CLANG_ENABLE_OBJC_ARC = YES; 339 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 340 | GCC_PREFIX_HEADER = "Capitals/Capitals-Prefix.pch"; 341 | INFOPLIST_FILE = "Capitals/Capitals-Info.plist"; 342 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 343 | PRODUCT_BUNDLE_IDENTIFIER = com.mapswithme.api.example.Capitals; 344 | PRODUCT_NAME = "World Capitals"; 345 | WRAPPER_EXTENSION = app; 346 | }; 347 | name = Debug; 348 | }; 349 | FAD3DD7C177221B500B0735B /* Release */ = { 350 | isa = XCBuildConfiguration; 351 | buildSettings = { 352 | CLANG_ENABLE_OBJC_ARC = YES; 353 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 354 | GCC_PREFIX_HEADER = "Capitals/Capitals-Prefix.pch"; 355 | INFOPLIST_FILE = "Capitals/Capitals-Info.plist"; 356 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 357 | PRODUCT_BUNDLE_IDENTIFIER = com.mapswithme.api.example.Capitals; 358 | PRODUCT_NAME = "World Capitals"; 359 | WRAPPER_EXTENSION = app; 360 | }; 361 | name = Release; 362 | }; 363 | /* End XCBuildConfiguration section */ 364 | 365 | /* Begin XCConfigurationList section */ 366 | FAD3DD46177221B500B0735B /* Build configuration list for PBXProject "Capitals" */ = { 367 | isa = XCConfigurationList; 368 | buildConfigurations = ( 369 | FAD3DD78177221B500B0735B /* Debug */, 370 | FAD3DD79177221B500B0735B /* Release */, 371 | FA776B5117848EC50023F7A0 /* Production */, 372 | ); 373 | defaultConfigurationIsVisible = 0; 374 | defaultConfigurationName = Release; 375 | }; 376 | FAD3DD7A177221B500B0735B /* Build configuration list for PBXNativeTarget "Capitals" */ = { 377 | isa = XCConfigurationList; 378 | buildConfigurations = ( 379 | FAD3DD7B177221B500B0735B /* Debug */, 380 | FAD3DD7C177221B500B0735B /* Release */, 381 | FA776B5217848EC50023F7A0 /* Production */, 382 | ); 383 | defaultConfigurationIsVisible = 0; 384 | defaultConfigurationName = Release; 385 | }; 386 | /* End XCConfigurationList section */ 387 | }; 388 | rootObject = FAD3DD43177221B500B0735B /* Project object */; 389 | } 390 | -------------------------------------------------------------------------------- /capitals-example/Capitals.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /capitals-example/Capitals/100x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/organicmaps/api-ios/7b95e1e24c1a9ed4b547788b3dcfd2cce36acace/capitals-example/Capitals/100x100.png -------------------------------------------------------------------------------- /capitals-example/Capitals/114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/organicmaps/api-ios/7b95e1e24c1a9ed4b547788b3dcfd2cce36acace/capitals-example/Capitals/114x114.png -------------------------------------------------------------------------------- /capitals-example/Capitals/144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/organicmaps/api-ios/7b95e1e24c1a9ed4b547788b3dcfd2cce36acace/capitals-example/Capitals/144x144.png -------------------------------------------------------------------------------- /capitals-example/Capitals/29x29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/organicmaps/api-ios/7b95e1e24c1a9ed4b547788b3dcfd2cce36acace/capitals-example/Capitals/29x29.png -------------------------------------------------------------------------------- /capitals-example/Capitals/50x50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/organicmaps/api-ios/7b95e1e24c1a9ed4b547788b3dcfd2cce36acace/capitals-example/Capitals/50x50.png -------------------------------------------------------------------------------- /capitals-example/Capitals/57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/organicmaps/api-ios/7b95e1e24c1a9ed4b547788b3dcfd2cce36acace/capitals-example/Capitals/57x57.png -------------------------------------------------------------------------------- /capitals-example/Capitals/58x58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/organicmaps/api-ios/7b95e1e24c1a9ed4b547788b3dcfd2cce36acace/capitals-example/Capitals/58x58.png -------------------------------------------------------------------------------- /capitals-example/Capitals/72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/organicmaps/api-ios/7b95e1e24c1a9ed4b547788b3dcfd2cce36acace/capitals-example/Capitals/72x72.png -------------------------------------------------------------------------------- /capitals-example/Capitals/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2013, MapsWithMe GmbH 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ******************************************************************************/ 28 | 29 | #import 30 | 31 | @interface AppDelegate : UIResponder 32 | 33 | @property (strong, nonatomic) UIWindow * window; 34 | 35 | @property (strong, nonatomic) UINavigationController * navigationController; 36 | 37 | @property (strong, nonatomic) UISplitViewController * splitViewController; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /capitals-example/Capitals/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2013, MapsWithMe GmbH 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ******************************************************************************/ 28 | 29 | #import "AppDelegate.h" 30 | #import "MasterViewController.h" 31 | #import "CityDetailViewController.h" 32 | 33 | #import "MapsWithMeAPI.h" 34 | 35 | @implementation AppDelegate 36 | 37 | // MapsWithMe API entry point, when user comes back to your app 38 | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation 39 | { 40 | if ([MWMApi isMapsWithMeUrl:url]) 41 | { 42 | // if we got nil, it means that Back button was pressed without selecting any pin 43 | MWMPin * pin = [MWMApi pinFromUrl:url]; 44 | if (pin) 45 | { 46 | NSInteger const cityId = [pin.idOrUrl integerValue]; 47 | // display selected page based on passed id 48 | if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) 49 | { 50 | [self.navigationController popToRootViewControllerAnimated:NO]; 51 | MasterViewController * masterVC = self.navigationController.viewControllers[0]; 52 | if (!masterVC.detailViewController) 53 | masterVC.detailViewController = [[CityDetailViewController alloc] initWithNibName:@"CityDetailViewController" bundle:nil]; 54 | masterVC.detailViewController.city = masterVC.capitals[cityId]; 55 | masterVC.detailViewController.cityIndex = cityId; 56 | [masterVC.navigationController pushViewController:masterVC.detailViewController animated:YES]; 57 | } 58 | else 59 | { 60 | CityDetailViewController * detailVC = (CityDetailViewController *)self.splitViewController.delegate; 61 | detailVC.cityIndex = cityId; 62 | } 63 | } 64 | return YES; 65 | } 66 | return NO; 67 | } 68 | 69 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 70 | { 71 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 72 | 73 | if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) 74 | { 75 | MasterViewController * masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil]; 76 | self.navigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController]; 77 | self.window.rootViewController = self.navigationController; 78 | } 79 | else 80 | { 81 | MasterViewController * masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil]; 82 | UINavigationController * masterNavigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController]; 83 | 84 | CityDetailViewController * detailViewController = [[CityDetailViewController alloc] initWithNibName:@"CityDetailViewController" bundle:nil]; 85 | UINavigationController * detailNavigationController = [[UINavigationController alloc] initWithRootViewController:detailViewController]; 86 | 87 | masterViewController.detailViewController = detailViewController; 88 | 89 | self.splitViewController = [[UISplitViewController alloc] init]; 90 | self.splitViewController.delegate = detailViewController; 91 | self.splitViewController.viewControllers = @[masterNavigationController, detailNavigationController]; 92 | 93 | self.window.rootViewController = self.splitViewController; 94 | } 95 | 96 | [self.window makeKeyAndVisible]; 97 | return YES; 98 | } 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /capitals-example/Capitals/Capitals-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDisplayName 6 | ${PRODUCT_NAME} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFiles 10 | 11 | 114x114.png 12 | 144x144.png 13 | 100x100.png 14 | 72x72.png 15 | 58x58.png 16 | 57x57.png 17 | 50x50.png 18 | 29x29.png 19 | 20 | CFBundleIdentifier 21 | $(PRODUCT_BUNDLE_IDENTIFIER) 22 | CFBundleInfoDictionaryVersion 23 | 6.0 24 | CFBundleName 25 | ${PRODUCT_NAME} 26 | CFBundlePackageType 27 | APPL 28 | CFBundleShortVersionString 29 | 1.0 30 | CFBundleSignature 31 | ???? 32 | CFBundleURLTypes 33 | 34 | 35 | CFBundleTypeRole 36 | Viewer 37 | CFBundleURLName 38 | com.mapswithme.maps 39 | CFBundleURLSchemes 40 | 41 | MapsWithMeApiExampleCapitals 42 | 43 | 44 | 45 | CFBundleVersion 46 | 1.0 47 | LSApplicationQueriesSchemes 48 | 49 | mapswithme 50 | 51 | LSRequiresIPhoneOS 52 | 53 | UIPrerenderedIcon 54 | 55 | UIRequiredDeviceCapabilities 56 | 57 | armv7 58 | 59 | UIStatusBarTintParameters 60 | 61 | UINavigationBar 62 | 63 | Style 64 | UIBarStyleDefault 65 | Translucent 66 | 67 | 68 | 69 | UISupportedInterfaceOrientations 70 | 71 | UIInterfaceOrientationPortrait 72 | UIInterfaceOrientationLandscapeLeft 73 | UIInterfaceOrientationLandscapeRight 74 | UIInterfaceOrientationPortraitUpsideDown 75 | 76 | UISupportedInterfaceOrientations~ipad 77 | 78 | UIInterfaceOrientationPortrait 79 | UIInterfaceOrientationPortraitUpsideDown 80 | UIInterfaceOrientationLandscapeLeft 81 | UIInterfaceOrientationLandscapeRight 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /capitals-example/Capitals/Capitals-Prefix.pch: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2013, MapsWithMe GmbH 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ******************************************************************************/ 28 | 29 | #import 30 | 31 | #ifndef __IPHONE_4_3 32 | #warning "This project uses features only available in iOS SDK 4.3 and later." 33 | #endif 34 | 35 | #ifdef __OBJC__ 36 | #import 37 | #import 38 | #endif 39 | -------------------------------------------------------------------------------- /capitals-example/Capitals/CityDetailViewController.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2013, MapsWithMe GmbH 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ******************************************************************************/ 28 | 29 | #import 30 | 31 | @interface CityDetailViewController : UITableViewController 32 | 33 | @property (nonatomic, assign) NSInteger cityIndex; 34 | @property (strong, nonatomic) NSDictionary * city; 35 | @property (strong, nonatomic) UIPopoverController * masterPopoverController; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /capitals-example/Capitals/CityDetailViewController.m: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2013, MapsWithMe GmbH 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ******************************************************************************/ 28 | 29 | #import "CityDetailViewController.h" 30 | 31 | #import "MapsWithMeAPI.h" 32 | 33 | @interface CityDetailViewController () 34 | 35 | - (void)configureView; 36 | 37 | @end 38 | 39 | 40 | @implementation CityDetailViewController 41 | 42 | - (NSString *)urlEncode:(NSString *)str 43 | { 44 | return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)str, NULL, CFSTR("!$&'()*+,-./:;=?@_~"), kCFStringEncodingUTF8); 45 | } 46 | 47 | - (void)showCapitalOnTheMap:(BOOL)withLink 48 | { 49 | NSString * pinId; 50 | if (withLink) 51 | pinId = [NSString stringWithFormat:@"http://en.wikipedia.org/wiki/%@", [self urlEncode:self.city[@"name"]]]; 52 | else 53 | pinId = [NSString stringWithFormat:@"%@", @(_cityIndex)]; 54 | [MWMApi showLat:[self.city[@"lat"] doubleValue] lon:[self.city[@"lon"] doubleValue] title:self.city[@"name"] idOrUrl:pinId]; 55 | } 56 | 57 | - (void)setCityIndex:(NSInteger)newCityIndex 58 | { 59 | if (_cityIndex != newCityIndex) 60 | { 61 | _cityIndex = newCityIndex; 62 | // Update the view. 63 | [self configureView]; 64 | } 65 | 66 | if (self.masterPopoverController) 67 | [self.masterPopoverController dismissPopoverAnimated:YES]; 68 | } 69 | 70 | - (void)configureView 71 | { 72 | self.title = self.city[@"name"]; 73 | [self.tableView reloadData]; 74 | } 75 | 76 | - (void)viewDidLoad 77 | { 78 | [super viewDidLoad]; 79 | [self configureView]; 80 | } 81 | 82 | #pragma mark - Table view data source 83 | 84 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 85 | { 86 | return 3; 87 | } 88 | 89 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 90 | { 91 | return section == 0 ? 5 : 1; 92 | } 93 | 94 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 95 | { 96 | NSString * cellId = [NSString stringWithFormat:@"%@%@", @(indexPath.section), @(indexPath.row)]; 97 | UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellId]; 98 | if (cell == nil) 99 | { 100 | if (indexPath.section == 0) 101 | { 102 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellId]; 103 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 104 | switch (indexPath.row) 105 | { 106 | case 0: cell.textLabel.text = @"Latitude"; break; 107 | case 1: cell.textLabel.text = @"Longitude"; break; 108 | case 2: cell.textLabel.text = @"Country Code"; break; 109 | case 3: cell.textLabel.text = @"Population"; break; 110 | case 4: cell.textLabel.text = @"Time Zone"; break; 111 | default: break; 112 | } 113 | } 114 | else 115 | { 116 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; 117 | cell.textLabel.textAlignment = NSTextAlignmentCenter; 118 | if (indexPath.section == 1) 119 | cell.textLabel.text = @"Show map and come back"; 120 | else 121 | cell.textLabel.text = @"Show map and read Wikipedia"; 122 | } 123 | } 124 | 125 | if (indexPath.section == 0) 126 | { 127 | switch (indexPath.row) 128 | { 129 | case 0: cell.detailTextLabel.text = [self.city[@"lat"] stringValue]; break; 130 | case 1: cell.detailTextLabel.text = [self.city[@"lon"] stringValue]; break; 131 | case 2: cell.detailTextLabel.text = self.city[@"countryCode"]; break; 132 | case 3: cell.detailTextLabel.text = [self.city[@"population"] stringValue]; break; 133 | case 4: cell.detailTextLabel.text = self.city[@"timeZone"]; break; 134 | default: break; 135 | } 136 | } 137 | return cell; 138 | } 139 | 140 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 141 | { 142 | [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; 143 | switch (indexPath.section) 144 | { 145 | case 1: [self showCapitalOnTheMap:NO]; break; 146 | case 2: [self showCapitalOnTheMap:YES]; break; 147 | default: break; 148 | } 149 | } 150 | 151 | #pragma mark - Split view 152 | 153 | - (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController 154 | { 155 | barButtonItem.title = NSLocalizedString(@"World Capitals", nil); 156 | [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES]; 157 | self.masterPopoverController = popoverController; 158 | } 159 | 160 | - (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem 161 | { 162 | // Called when the view is shown again in the split view, invalidating the button and popover controller. 163 | [self.navigationItem setLeftBarButtonItem:nil animated:YES]; 164 | self.masterPopoverController = nil; 165 | } 166 | 167 | @end 168 | -------------------------------------------------------------------------------- /capitals-example/Capitals/CityDetailViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1552 5 | 12E55 6 | 3084 7 | 1187.39 8 | 626.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 2083 12 | 13 | 14 | IBProxyObject 15 | IBUITableView 16 | 17 | 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | PluginDependencyRecalculationVersion 22 | 23 | 24 | 25 | 26 | IBFilesOwner 27 | IBIPadFramework 28 | 29 | 30 | IBFirstResponder 31 | IBIPadFramework 32 | 33 | 34 | 35 | 274 36 | {768, 1024} 37 | 38 | 39 | 40 | 1 41 | MCAwIDAgMAA 42 | groupTableViewBackgroundColor 43 | 44 | NO 45 | YES 46 | NO 47 | 48 | IBUISplitViewDetailSimulatedSizeMetrics 49 | 50 | YES 51 | 52 | 53 | 54 | 55 | 56 | {768, 1024} 57 | {703, 768} 58 | 59 | 60 | IBIPadFramework 61 | Detail 62 | IBUISplitViewController 63 | 64 | IBUISplitViewControllerContentSizeLocation 65 | IBUISplitViewControllerContentSizeLocationDetail 66 | 67 | 68 | IBIPadFramework 69 | NO 70 | 1 71 | 2 72 | 0 73 | YES 74 | 44 75 | 10 76 | 10 77 | 78 | 79 | 80 | 81 | 82 | 83 | view 84 | 85 | 86 | 87 | 11 88 | 89 | 90 | 91 | dataSource 92 | 93 | 94 | 95 | 9 96 | 97 | 98 | 99 | delegate 100 | 101 | 102 | 103 | 10 104 | 105 | 106 | 107 | 108 | 109 | 0 110 | 111 | 112 | 113 | 114 | 115 | -1 116 | 117 | 118 | File's Owner 119 | 120 | 121 | -2 122 | 123 | 124 | 125 | 126 | 8 127 | 128 | 129 | 130 | 131 | 132 | 133 | CityDetailViewController 134 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 135 | UIResponder 136 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 137 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 138 | 139 | 140 | 141 | 142 | 143 | 11 144 | 145 | 146 | 147 | 148 | CityDetailViewController 149 | UITableViewController 150 | 151 | IBProjectSource 152 | ./Classes/CityDetailViewController.h 153 | 154 | 155 | 156 | 157 | 0 158 | IBIPadFramework 159 | YES 160 | 3 161 | YES 162 | 2083 163 | 164 | 165 | -------------------------------------------------------------------------------- /capitals-example/Capitals/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/organicmaps/api-ios/7b95e1e24c1a9ed4b547788b3dcfd2cce36acace/capitals-example/Capitals/Default-568h@2x.png -------------------------------------------------------------------------------- /capitals-example/Capitals/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/organicmaps/api-ios/7b95e1e24c1a9ed4b547788b3dcfd2cce36acace/capitals-example/Capitals/Default.png -------------------------------------------------------------------------------- /capitals-example/Capitals/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/organicmaps/api-ios/7b95e1e24c1a9ed4b547788b3dcfd2cce36acace/capitals-example/Capitals/Default@2x.png -------------------------------------------------------------------------------- /capitals-example/Capitals/MasterViewController.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2013, MapsWithMe GmbH 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ******************************************************************************/ 28 | 29 | #import 30 | 31 | @class CityDetailViewController; 32 | 33 | @interface MasterViewController : UITableViewController 34 | 35 | @property (strong, nonatomic) CityDetailViewController * detailViewController; 36 | @property (strong, nonatomic) NSArray * capitals; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /capitals-example/Capitals/MasterViewController.m: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2013, MapsWithMe GmbH 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ******************************************************************************/ 28 | 29 | #import "MasterViewController.h" 30 | #import "CityDetailViewController.h" 31 | 32 | #import "MapsWithMeAPI.h" 33 | 34 | @implementation MasterViewController 35 | 36 | - (CityDetailViewController *)detailViewController 37 | { 38 | if (!_detailViewController) 39 | _detailViewController = [[CityDetailViewController alloc] initWithNibName:@"CityDetailViewController" bundle:nil]; 40 | return _detailViewController; 41 | } 42 | 43 | - (NSArray *)capitals 44 | { 45 | if (!_capitals) 46 | { 47 | NSString * path = [[NSBundle mainBundle] pathForResource:@"capitals" ofType:@"plist"]; 48 | _capitals = [NSArray arrayWithContentsOfFile:path]; 49 | } 50 | return _capitals; 51 | } 52 | 53 | - (void)showAllCitiesOnTheMap:(id)sender 54 | { 55 | NSMutableArray * array = [[NSMutableArray alloc] initWithCapacity:[self.capitals count]]; 56 | 57 | for (NSInteger i = 0; i < [self.capitals count]; ++i) 58 | { 59 | NSString * pinId = [NSString stringWithFormat:@"%@", @(i)]; 60 | // Note that url is empty - it means "More details" button for a pin in MapsWithMe will lead back to this example app 61 | NSDictionary * city = self.capitals[i]; 62 | MWMPin * pin = [[MWMPin alloc] initWithLat:[city[@"lat"] doubleValue] lon:[city[@"lon"] doubleValue] title:city[@"name"] idOrUrl:pinId]; 63 | [array addObject:pin]; 64 | } 65 | // Your should hide any top view objects like UIPopoverController before calling +showPins: 66 | // If user does not installed MapsWithMe app, a popup dialog will be shown 67 | [self.detailViewController.masterPopoverController dismissPopoverAnimated:YES]; 68 | 69 | [MWMApi showPins:array]; 70 | } 71 | 72 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 73 | { 74 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 75 | if (self) 76 | { 77 | self.title = NSLocalizedString(@"World Capitals", nil); 78 | if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) 79 | { 80 | self.clearsSelectionOnViewWillAppear = NO; 81 | self.preferredContentSize = CGSizeMake(320.0, 600.0); 82 | } 83 | } 84 | return self; 85 | } 86 | 87 | - (void)viewDidLoad 88 | { 89 | [super viewDidLoad]; 90 | 91 | UIBarButtonItem * showMapButton = [[UIBarButtonItem alloc] initWithTitle:@"Show All" style:UIBarButtonItemStyleDone target:self action:@selector(showAllCitiesOnTheMap:)]; 92 | self.navigationItem.rightBarButtonItem = showMapButton; 93 | } 94 | 95 | #pragma mark - Table View 96 | 97 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 98 | { 99 | return 1; 100 | } 101 | 102 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 103 | { 104 | return [self.capitals count]; 105 | } 106 | 107 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 108 | { 109 | UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 240, tableView.rowHeight)]; 110 | label.text = [MWMApi isApiSupported] ? @"MapsWithMe is installed" : @"MapsWithMe is not installed"; 111 | label.textAlignment = NSTextAlignmentCenter; 112 | label.backgroundColor = [UIColor clearColor]; 113 | return label; 114 | } 115 | 116 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section 117 | { 118 | return tableView.rowHeight / 2; 119 | } 120 | 121 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 122 | { 123 | static NSString * cellId = @"MasterCell"; 124 | 125 | UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellId]; 126 | if (cell == nil) 127 | { 128 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; 129 | if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) 130 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 131 | } 132 | 133 | cell.textLabel.text = self.capitals[indexPath.row][@"name"]; 134 | return cell; 135 | } 136 | 137 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 138 | { 139 | self.detailViewController.city = self.capitals[indexPath.row]; 140 | self.detailViewController.cityIndex = indexPath.row; 141 | if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) 142 | [self.navigationController pushViewController:self.detailViewController animated:YES]; 143 | } 144 | 145 | @end 146 | -------------------------------------------------------------------------------- /capitals-example/Capitals/MasterViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /capitals-example/Capitals/capitals.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | countryCode 7 | AE 8 | lat 9 | 24.466670000000001 10 | lon 11 | 54.366669999999999 12 | name 13 | Abu Dhabi 14 | population 15 | 603492 16 | timeZone 17 | Asia/Dubai 18 | 19 | 20 | countryCode 21 | NG 22 | lat 23 | 9.0685300000000009 24 | lon 25 | 7.4837499999999997 26 | name 27 | Abuja 28 | population 29 | 590400 30 | timeZone 31 | Africa/Lagos 32 | 33 | 34 | countryCode 35 | GH 36 | lat 37 | 5.5560200000000002 38 | lon 39 | -0.19689999999999999 40 | name 41 | Accra 42 | population 43 | 1963264 44 | timeZone 45 | Africa/Accra 46 | 47 | 48 | countryCode 49 | PN 50 | lat 51 | -25.06597 52 | lon 53 | -130.10149999999999 54 | name 55 | Adamstown 56 | population 57 | 46 58 | timeZone 59 | Pacific/Pitcairn 60 | 61 | 62 | countryCode 63 | ET 64 | lat 65 | 9.0249699999999997 66 | lon 67 | 38.74689 68 | name 69 | Addis Ababa 70 | population 71 | 2757729 72 | timeZone 73 | Africa/Addis_Ababa 74 | 75 | 76 | countryCode 77 | DZ 78 | lat 79 | 36.752499999999998 80 | lon 81 | 3.0419700000000001 82 | name 83 | Algiers 84 | population 85 | 1977663 86 | timeZone 87 | Africa/Algiers 88 | 89 | 90 | countryCode 91 | NU 92 | lat 93 | -19.059519999999999 94 | lon 95 | -169.9187 96 | name 97 | Alofi 98 | population 99 | 624 100 | timeZone 101 | Pacific/Niue 102 | 103 | 104 | countryCode 105 | JO 106 | lat 107 | 31.955220000000001 108 | lon 109 | 35.945030000000003 110 | name 111 | Amman 112 | population 113 | 1275857 114 | timeZone 115 | Asia/Amman 116 | 117 | 118 | countryCode 119 | NL 120 | lat 121 | 52.374029999999998 122 | lon 123 | 4.8896899999999999 124 | name 125 | Amsterdam 126 | population 127 | 741636 128 | timeZone 129 | Europe/Amsterdam 130 | 131 | 132 | countryCode 133 | AD 134 | lat 135 | 42.50779 136 | lon 137 | 1.5210900000000001 138 | name 139 | Andorra la Vella 140 | population 141 | 20430 142 | timeZone 143 | Europe/Andorra 144 | 145 | 146 | countryCode 147 | TR 148 | lat 149 | 39.919870000000003 150 | lon 151 | 32.85427 152 | name 153 | Ankara 154 | population 155 | 3517182 156 | timeZone 157 | Europe/Istanbul 158 | 159 | 160 | countryCode 161 | MG 162 | lat 163 | -18.913679999999999 164 | lon 165 | 47.53613 166 | name 167 | Antananarivo 168 | population 169 | 1391433 170 | timeZone 171 | Indian/Antananarivo 172 | 173 | 174 | countryCode 175 | WS 176 | lat 177 | -13.83333 178 | lon 179 | -171.76669999999999 180 | name 181 | Apia 182 | population 183 | 40407 184 | timeZone 185 | Pacific/Apia 186 | 187 | 188 | countryCode 189 | TM 190 | lat 191 | 37.950000000000003 192 | lon 193 | 58.383330000000001 194 | name 195 | Ashgabat 196 | population 197 | 727700 198 | timeZone 199 | Asia/Ashgabat 200 | 201 | 202 | countryCode 203 | ER 204 | lat 205 | 15.338050000000001 206 | lon 207 | 38.931840000000001 208 | name 209 | Asmara 210 | population 211 | 563930 212 | timeZone 213 | Africa/Asmara 214 | 215 | 216 | countryCode 217 | KZ 218 | lat 219 | 51.180100000000003 220 | lon 221 | 71.445980000000006 222 | name 223 | Astana 224 | population 225 | 345604 226 | timeZone 227 | Asia/Almaty 228 | 229 | 230 | countryCode 231 | PY 232 | lat 233 | -25.300660000000001 234 | lon 235 | -57.635910000000003 236 | name 237 | Asunción 238 | population 239 | 1482200 240 | timeZone 241 | America/Asuncion 242 | 243 | 244 | countryCode 245 | GR 246 | lat 247 | 37.97945 248 | lon 249 | 23.71622 250 | name 251 | Athens 252 | population 253 | 729137 254 | timeZone 255 | Europe/Athens 256 | 257 | 258 | countryCode 259 | CK 260 | lat 261 | -21.20778 262 | lon 263 | -159.77500000000001 264 | name 265 | Avarua 266 | population 267 | 13373 268 | timeZone 269 | Pacific/Rarotonga 270 | 271 | 272 | countryCode 273 | IQ 274 | lat 275 | 33.340580000000003 276 | lon 277 | 44.400880000000001 278 | name 279 | Baghdad 280 | population 281 | 5672513 282 | timeZone 283 | Asia/Baghdad 284 | 285 | 286 | countryCode 287 | AZ 288 | lat 289 | 40.377670000000002 290 | lon 291 | 49.892009999999999 292 | name 293 | Baku 294 | population 295 | 1116513 296 | timeZone 297 | Asia/Baku 298 | 299 | 300 | countryCode 301 | ML 302 | lat 303 | 12.65 304 | lon 305 | -8 306 | name 307 | Bamako 308 | population 309 | 1297281 310 | timeZone 311 | Africa/Bamako 312 | 313 | 314 | countryCode 315 | BN 316 | lat 317 | 4.9402900000000001 318 | lon 319 | 114.9481 320 | name 321 | Bandar Seri Begawan 322 | population 323 | 64409 324 | timeZone 325 | Asia/Brunei 326 | 327 | 328 | countryCode 329 | TH 330 | lat 331 | 13.75398 332 | lon 333 | 100.5014 334 | name 335 | Bangkok 336 | population 337 | 5104476 338 | timeZone 339 | Asia/Bangkok 340 | 341 | 342 | countryCode 343 | CF 344 | lat 345 | 4.3612200000000003 346 | lon 347 | 18.554960000000001 348 | name 349 | Bangui 350 | population 351 | 542393 352 | timeZone 353 | Africa/Bangui 354 | 355 | 356 | countryCode 357 | GM 358 | lat 359 | 13.45274 360 | lon 361 | -16.578029999999998 362 | name 363 | Banjul 364 | population 365 | 34589 366 | timeZone 367 | Africa/Banjul 368 | 369 | 370 | countryCode 371 | GP 372 | lat 373 | 15.99854 374 | lon 375 | -61.725479999999997 376 | name 377 | Basse-Terre 378 | population 379 | 11472 380 | timeZone 381 | America/Guadeloupe 382 | 383 | 384 | countryCode 385 | KN 386 | lat 387 | 17.294840000000001 388 | lon 389 | -62.726100000000002 390 | name 391 | Basseterre 392 | population 393 | 12920 394 | timeZone 395 | America/St_Kitts 396 | 397 | 398 | countryCode 399 | CN 400 | lat 401 | 39.907499999999999 402 | lon 403 | 116.3972 404 | name 405 | Beijing 406 | population 407 | 7480601 408 | timeZone 409 | Asia/Shanghai 410 | 411 | 412 | countryCode 413 | LB 414 | lat 415 | 33.888939999999998 416 | lon 417 | 35.494419999999998 418 | name 419 | Beirut 420 | population 421 | 1916100 422 | timeZone 423 | Asia/Beirut 424 | 425 | 426 | countryCode 427 | RS 428 | lat 429 | 44.804009999999998 430 | lon 431 | 20.465129999999998 432 | name 433 | Belgrade 434 | population 435 | 1273651 436 | timeZone 437 | Europe/Belgrade 438 | 439 | 440 | countryCode 441 | BZ 442 | lat 443 | 17.25 444 | lon 445 | -88.766670000000005 446 | name 447 | Belmopan 448 | population 449 | 13381 450 | timeZone 451 | America/Belize 452 | 453 | 454 | countryCode 455 | DE 456 | lat 457 | 52.524369999999998 458 | lon 459 | 13.41053 460 | name 461 | Berlin 462 | population 463 | 3426354 464 | timeZone 465 | Europe/Berlin 466 | 467 | 468 | countryCode 469 | CH 470 | lat 471 | 46.948090000000001 472 | lon 473 | 7.4474400000000003 474 | name 475 | Bern 476 | population 477 | 121631 478 | timeZone 479 | Europe/Zurich 480 | 481 | 482 | countryCode 483 | KG 484 | lat 485 | 42.869999999999997 486 | lon 487 | 74.590000000000003 488 | name 489 | Bishkek 490 | population 491 | 900000 492 | timeZone 493 | Asia/Bishkek 494 | 495 | 496 | countryCode 497 | GW 498 | lat 499 | 11.863569999999999 500 | lon 501 | -15.597670000000001 502 | name 503 | Bissau 504 | population 505 | 388028 506 | timeZone 507 | Africa/Bissau 508 | 509 | 510 | countryCode 511 | CO 512 | lat 513 | 4.6097099999999998 514 | lon 515 | -74.08175 516 | name 517 | Bogotá 518 | population 519 | 7102602 520 | timeZone 521 | America/Bogota 522 | 523 | 524 | countryCode 525 | BR 526 | lat 527 | -15.779719999999999 528 | lon 529 | -47.929720000000003 530 | name 531 | Brasília 532 | population 533 | 2207718 534 | timeZone 535 | America/Sao_Paulo 536 | 537 | 538 | countryCode 539 | SK 540 | lat 541 | 48.148159999999997 542 | lon 543 | 17.106739999999999 544 | name 545 | Bratislava 546 | population 547 | 423737 548 | timeZone 549 | Europe/Bratislava 550 | 551 | 552 | countryCode 553 | CG 554 | lat 555 | -4.2661300000000004 556 | lon 557 | 15.28318 558 | name 559 | Brazzaville 560 | population 561 | 1284609 562 | timeZone 563 | Africa/Brazzaville 564 | 565 | 566 | countryCode 567 | BB 568 | lat 569 | 13.1 570 | lon 571 | -59.616669999999999 572 | name 573 | Bridgetown 574 | population 575 | 98511 576 | timeZone 577 | America/Barbados 578 | 579 | 580 | countryCode 581 | BE 582 | lat 583 | 50.850450000000002 584 | lon 585 | 4.3487799999999996 586 | name 587 | Brussels 588 | population 589 | 1019022 590 | timeZone 591 | Europe/Brussels 592 | 593 | 594 | countryCode 595 | RO 596 | lat 597 | 44.432250000000003 598 | lon 599 | 26.106259999999999 600 | name 601 | Bucharest 602 | population 603 | 1877155 604 | timeZone 605 | Europe/Bucharest 606 | 607 | 608 | countryCode 609 | HU 610 | lat 611 | 47.498010000000001 612 | lon 613 | 19.039909999999999 614 | name 615 | Budapest 616 | population 617 | 1696128 618 | timeZone 619 | Europe/Budapest 620 | 621 | 622 | countryCode 623 | AR 624 | lat 625 | -34.613149999999997 626 | lon 627 | -58.377229999999997 628 | name 629 | Buenos Aires 630 | population 631 | 13076300 632 | timeZone 633 | America/Argentina/Buenos_Aires 634 | 635 | 636 | countryCode 637 | BI 638 | lat 639 | -3.3822000000000001 640 | lon 641 | 29.3644 642 | name 643 | Bujumbura 644 | population 645 | 331700 646 | timeZone 647 | Africa/Bujumbura 648 | 649 | 650 | countryCode 651 | EG 652 | lat 653 | 30.062629999999999 654 | lon 655 | 31.249669999999998 656 | name 657 | Cairo 658 | population 659 | 7734614 660 | timeZone 661 | Africa/Cairo 662 | 663 | 664 | countryCode 665 | AU 666 | lat 667 | -35.283459999999998 668 | lon 669 | 149.12809999999999 670 | name 671 | Canberra 672 | population 673 | 327700 674 | timeZone 675 | Australia/Sydney 676 | 677 | 678 | countryCode 679 | VE 680 | lat 681 | 10.488009999999999 682 | lon 683 | -66.879189999999994 684 | name 685 | Caracas 686 | population 687 | 3000000 688 | timeZone 689 | America/Caracas 690 | 691 | 692 | countryCode 693 | LC 694 | lat 695 | 13.995699999999999 696 | lon 697 | -61.006140000000002 698 | name 699 | Castries 700 | population 701 | 10000 702 | timeZone 703 | America/St_Lucia 704 | 705 | 706 | countryCode 707 | GF 708 | lat 709 | 4.9333299999999998 710 | lon 711 | -52.333329999999997 712 | name 713 | Cayenne 714 | population 715 | 61550 716 | timeZone 717 | America/Cayenne 718 | 719 | 720 | countryCode 721 | VI 722 | lat 723 | 18.341899999999999 724 | lon 725 | -64.930700000000002 726 | name 727 | Charlotte Amalie 728 | population 729 | 20000 730 | timeZone 731 | America/St_Thomas 732 | 733 | 734 | countryCode 735 | MD 736 | lat 737 | 47.005560000000003 738 | lon 739 | 28.857500000000002 740 | name 741 | Chişinău 742 | population 743 | 635994 744 | timeZone 745 | Europe/Chisinau 746 | 747 | 748 | countryCode 749 | TC 750 | lat 751 | 21.461220000000001 752 | lon 753 | -71.14188 754 | name 755 | Cockburn Town 756 | population 757 | 3720 758 | timeZone 759 | America/Grand_Turk 760 | 761 | 762 | countryCode 763 | LK 764 | lat 765 | 6.93194 766 | lon 767 | 79.84778 768 | name 769 | Colombo 770 | population 771 | 648034 772 | timeZone 773 | Asia/Colombo 774 | 775 | 776 | countryCode 777 | GN 778 | lat 779 | 9.5379500000000004 780 | lon 781 | -13.677289999999999 782 | name 783 | Conakry 784 | population 785 | 1767200 786 | timeZone 787 | Africa/Conakry 788 | 789 | 790 | countryCode 791 | DK 792 | lat 793 | 55.675939999999997 794 | lon 795 | 12.565530000000001 796 | name 797 | Copenhagen 798 | population 799 | 1153615 800 | timeZone 801 | Europe/Copenhagen 802 | 803 | 804 | countryCode 805 | SN 806 | lat 807 | 14.6937 808 | lon 809 | -17.44406 810 | name 811 | Dakar 812 | population 813 | 2476400 814 | timeZone 815 | Africa/Dakar 816 | 817 | 818 | countryCode 819 | SY 820 | lat 821 | 33.510199999999998 822 | lon 823 | 36.29128 824 | name 825 | Damascus 826 | population 827 | 1569394 828 | timeZone 829 | Asia/Damascus 830 | 831 | 832 | countryCode 833 | BD 834 | lat 835 | 23.7104 836 | lon 837 | 90.407439999999994 838 | name 839 | Dhaka 840 | population 841 | 10356500 842 | timeZone 843 | Asia/Dhaka 844 | 845 | 846 | countryCode 847 | TL 848 | lat 849 | -8.5586099999999998 850 | lon 851 | 125.5736 852 | name 853 | Dili 854 | population 855 | 150000 856 | timeZone 857 | Asia/Dili 858 | 859 | 860 | countryCode 861 | DJ 862 | lat 863 | 11.58901 864 | lon 865 | 43.145029999999998 866 | name 867 | Djibouti 868 | population 869 | 623891 870 | timeZone 871 | Africa/Djibouti 872 | 873 | 874 | countryCode 875 | TZ 876 | lat 877 | -6.1722099999999998 878 | lon 879 | 35.739469999999997 880 | name 881 | Dodoma 882 | population 883 | 180541 884 | timeZone 885 | Africa/Dar_es_Salaam 886 | 887 | 888 | countryCode 889 | QA 890 | lat 891 | 25.279319999999998 892 | lon 893 | 51.522449999999999 894 | name 895 | Doha 896 | population 897 | 344939 898 | timeZone 899 | Asia/Qatar 900 | 901 | 902 | countryCode 903 | IM 904 | lat 905 | 54.149999999999999 906 | lon 907 | -4.4833299999999996 908 | name 909 | Douglas 910 | population 911 | 26218 912 | timeZone 913 | Europe/Isle_of_Man 914 | 915 | 916 | countryCode 917 | IE 918 | lat 919 | 53.333060000000003 920 | lon 921 | -6.2488900000000003 922 | name 923 | Dublin 924 | population 925 | 1024027 926 | timeZone 927 | Europe/Dublin 928 | 929 | 930 | countryCode 931 | TJ 932 | lat 933 | 38.53575 934 | lon 935 | 68.779049999999998 936 | name 937 | Dushanbe 938 | population 939 | 543107 940 | timeZone 941 | Asia/Dushanbe 942 | 943 | 944 | countryCode 945 | CX 946 | lat 947 | -10.421720000000001 948 | lon 949 | 105.67910000000001 950 | name 951 | Flying Fish Cove 952 | population 953 | 500 954 | timeZone 955 | Indian/Christmas 956 | 957 | 958 | countryCode 959 | MQ 960 | lat 961 | 14.608919999999999 962 | lon 963 | -61.073340000000002 964 | name 965 | Fort-de-France 966 | population 967 | 89995 968 | timeZone 969 | America/Martinique 970 | 971 | 972 | countryCode 973 | SL 974 | lat 975 | 8.484 976 | lon 977 | -13.229939999999999 978 | name 979 | Freetown 980 | population 981 | 802639 982 | timeZone 983 | Africa/Freetown 984 | 985 | 986 | countryCode 987 | TV 988 | lat 989 | -8.5242500000000003 990 | lon 991 | 179.1942 992 | name 993 | Funafuti 994 | population 995 | 4492 996 | timeZone 997 | Pacific/Funafuti 998 | 999 | 1000 | countryCode 1001 | BW 1002 | lat 1003 | -24.654509999999998 1004 | lon 1005 | 25.90859 1006 | name 1007 | Gaborone 1008 | population 1009 | 208411 1010 | timeZone 1011 | Africa/Gaborone 1012 | 1013 | 1014 | countryCode 1015 | KY 1016 | lat 1017 | 19.286919999999999 1018 | lon 1019 | -81.367059999999995 1020 | name 1021 | George Town 1022 | population 1023 | 29370 1024 | timeZone 1025 | America/Cayman 1026 | 1027 | 1028 | countryCode 1029 | GY 1030 | lat 1031 | 6.8044799999999999 1032 | lon 1033 | -58.155270000000002 1034 | name 1035 | Georgetown 1036 | population 1037 | 235017 1038 | timeZone 1039 | America/Guyana 1040 | 1041 | 1042 | countryCode 1043 | GI 1044 | lat 1045 | 36.144739999999999 1046 | lon 1047 | -5.3525700000000001 1048 | name 1049 | Gibraltar 1050 | population 1051 | 26544 1052 | timeZone 1053 | Europe/Gibraltar 1054 | 1055 | 1056 | countryCode 1057 | GS 1058 | lat 1059 | -54.281109999999998 1060 | lon 1061 | -36.5092 1062 | name 1063 | Grytviken 1064 | population 1065 | 2 1066 | timeZone 1067 | Atlantic/South_Georgia 1068 | 1069 | 1070 | countryCode 1071 | GT 1072 | lat 1073 | 14.64072 1074 | lon 1075 | -90.513270000000006 1076 | name 1077 | Guatemala City 1078 | population 1079 | 994938 1080 | timeZone 1081 | America/Guatemala 1082 | 1083 | 1084 | countryCode 1085 | BL 1086 | lat 1087 | 17.896180000000001 1088 | lon 1089 | -62.849780000000003 1090 | name 1091 | Gustavia 1092 | population 1093 | 5988 1094 | timeZone 1095 | America/St_Barthelemy 1096 | 1097 | 1098 | countryCode 1099 | GU 1100 | lat 1101 | 13.475669999999999 1102 | lon 1103 | 144.74889999999999 1104 | name 1105 | Hagåtña 1106 | population 1107 | 1051 1108 | timeZone 1109 | Pacific/Guam 1110 | 1111 | 1112 | countryCode 1113 | BM 1114 | lat 1115 | 32.291490000000003 1116 | lon 1117 | -64.777969999999996 1118 | name 1119 | Hamilton 1120 | population 1121 | 902 1122 | timeZone 1123 | Atlantic/Bermuda 1124 | 1125 | 1126 | countryCode 1127 | ZW 1128 | lat 1129 | -17.827719999999999 1130 | lon 1131 | 31.053370000000001 1132 | name 1133 | Harare 1134 | population 1135 | 1542813 1136 | timeZone 1137 | Africa/Harare 1138 | 1139 | 1140 | countryCode 1141 | CU 1142 | lat 1143 | 23.133019999999998 1144 | lon 1145 | -82.383039999999994 1146 | name 1147 | Havana 1148 | population 1149 | 2163824 1150 | timeZone 1151 | America/Havana 1152 | 1153 | 1154 | countryCode 1155 | FI 1156 | lat 1157 | 60.169519999999999 1158 | lon 1159 | 24.935449999999999 1160 | name 1161 | Helsinki 1162 | population 1163 | 558457 1164 | timeZone 1165 | Europe/Helsinki 1166 | 1167 | 1168 | countryCode 1169 | HK 1170 | lat 1171 | 22.285520000000002 1172 | lon 1173 | 114.15770000000001 1174 | name 1175 | Hong Kong 1176 | population 1177 | 7012738 1178 | timeZone 1179 | Asia/Hong_Kong 1180 | 1181 | 1182 | countryCode 1183 | SB 1184 | lat 1185 | -9.4333299999999998 1186 | lon 1187 | 159.94999999999999 1188 | name 1189 | Honiara 1190 | population 1191 | 56298 1192 | timeZone 1193 | Pacific/Guadalcanal 1194 | 1195 | 1196 | countryCode 1197 | VN 1198 | lat 1199 | 21.0245 1200 | lon 1201 | 105.8412 1202 | name 1203 | Hà Nội 1204 | population 1205 | 1431270 1206 | timeZone 1207 | Asia/Ho_Chi_Minh 1208 | 1209 | 1210 | countryCode 1211 | PK 1212 | lat 1213 | 33.72148 1214 | lon 1215 | 73.043289999999999 1216 | name 1217 | Islamabad 1218 | population 1219 | 601600 1220 | timeZone 1221 | Asia/Karachi 1222 | 1223 | 1224 | countryCode 1225 | ID 1226 | lat 1227 | -6.21462 1228 | lon 1229 | 106.8451 1230 | name 1231 | Jakarta 1232 | population 1233 | 8540121 1234 | timeZone 1235 | Asia/Jakarta 1236 | 1237 | 1238 | countryCode 1239 | SH 1240 | lat 1241 | -15.93872 1242 | lon 1243 | -5.7167500000000002 1244 | name 1245 | Jamestown 1246 | population 1247 | 637 1248 | timeZone 1249 | Atlantic/St_Helena 1250 | 1251 | 1252 | countryCode 1253 | SS 1254 | lat 1255 | 4.8516500000000002 1256 | lon 1257 | 31.582470000000001 1258 | name 1259 | Juba 1260 | population 1261 | 300000 1262 | timeZone 1263 | Africa/Juba 1264 | 1265 | 1266 | countryCode 1267 | AF 1268 | lat 1269 | 34.528129999999997 1270 | lon 1271 | 69.172330000000002 1272 | name 1273 | Kabul 1274 | population 1275 | 3043532 1276 | timeZone 1277 | Asia/Kabul 1278 | 1279 | 1280 | countryCode 1281 | UG 1282 | lat 1283 | 0.31628000000000001 1284 | lon 1285 | 32.582189999999997 1286 | name 1287 | Kampala 1288 | population 1289 | 1353189 1290 | timeZone 1291 | Africa/Kampala 1292 | 1293 | 1294 | countryCode 1295 | NP 1296 | lat 1297 | 27.701689999999999 1298 | lon 1299 | 85.320599999999999 1300 | name 1301 | Kathmandu 1302 | population 1303 | 1442271 1304 | timeZone 1305 | Asia/Kathmandu 1306 | 1307 | 1308 | countryCode 1309 | SD 1310 | lat 1311 | 15.551769999999999 1312 | lon 1313 | 32.532409999999999 1314 | name 1315 | Khartoum 1316 | population 1317 | 1974647 1318 | timeZone 1319 | Africa/Khartoum 1320 | 1321 | 1322 | countryCode 1323 | UA 1324 | lat 1325 | 50.454659999999997 1326 | lon 1327 | 30.523800000000001 1328 | name 1329 | Kiev 1330 | population 1331 | 2514227 1332 | timeZone 1333 | Europe/Kiev 1334 | 1335 | 1336 | countryCode 1337 | RW 1338 | lat 1339 | -1.9499500000000001 1340 | lon 1341 | 30.05885 1342 | name 1343 | Kigali 1344 | population 1345 | 745261 1346 | timeZone 1347 | Africa/Kigali 1348 | 1349 | 1350 | countryCode 1351 | NF 1352 | lat 1353 | -29.054590000000001 1354 | lon 1355 | 167.96629999999999 1356 | name 1357 | Kingston 1358 | population 1359 | 880 1360 | timeZone 1361 | Pacific/Norfolk 1362 | 1363 | 1364 | countryCode 1365 | JM 1366 | lat 1367 | 17.997019999999999 1368 | lon 1369 | -76.793580000000006 1370 | name 1371 | Kingston 1372 | population 1373 | 937700 1374 | timeZone 1375 | America/Jamaica 1376 | 1377 | 1378 | countryCode 1379 | VC 1380 | lat 1381 | 13.158720000000001 1382 | lon 1383 | -61.22475 1384 | name 1385 | Kingstown 1386 | population 1387 | 24518 1388 | timeZone 1389 | America/St_Vincent 1390 | 1391 | 1392 | countryCode 1393 | CD 1394 | lat 1395 | -4.3214199999999998 1396 | lon 1397 | 15.308070000000001 1398 | name 1399 | Kinshasa 1400 | population 1401 | 7785965 1402 | timeZone 1403 | Africa/Kinshasa 1404 | 1405 | 1406 | countryCode 1407 | BQ 1408 | lat 1409 | 12.15 1410 | lon 1411 | -68.266670000000005 1412 | name 1413 | Kralendijk 1414 | population 1415 | 3081 1416 | timeZone 1417 | America/Kralendijk 1418 | 1419 | 1420 | countryCode 1421 | MY 1422 | lat 1423 | 3.1412 1424 | lon 1425 | 101.6865 1426 | name 1427 | Kuala Lumpur 1428 | population 1429 | 1453975 1430 | timeZone 1431 | Asia/Kuala_Lumpur 1432 | 1433 | 1434 | countryCode 1435 | KW 1436 | lat 1437 | 29.369720000000001 1438 | lon 1439 | 47.97833 1440 | name 1441 | Kuwait City 1442 | population 1443 | 60064 1444 | timeZone 1445 | Asia/Kuwait 1446 | 1447 | 1448 | countryCode 1449 | EH 1450 | lat 1451 | 27.162240000000001 1452 | lon 1453 | -13.203150000000001 1454 | name 1455 | El Aaiún 1456 | population 1457 | 188084 1458 | timeZone 1459 | Africa/El_Aaiun 1460 | 1461 | 1462 | countryCode 1463 | GA 1464 | lat 1465 | 0.39240999999999998 1466 | lon 1467 | 9.4535599999999995 1468 | name 1469 | Libreville 1470 | population 1471 | 578156 1472 | timeZone 1473 | Africa/Libreville 1474 | 1475 | 1476 | countryCode 1477 | MW 1478 | lat 1479 | -13.96692 1480 | lon 1481 | 33.78725 1482 | name 1483 | Lilongwe 1484 | population 1485 | 646750 1486 | timeZone 1487 | Africa/Blantyre 1488 | 1489 | 1490 | countryCode 1491 | PE 1492 | lat 1493 | -12.04318 1494 | lon 1495 | -77.028239999999997 1496 | name 1497 | Lima 1498 | population 1499 | 7737002 1500 | timeZone 1501 | America/Lima 1502 | 1503 | 1504 | countryCode 1505 | PT 1506 | lat 1507 | 38.716670000000001 1508 | lon 1509 | -9.1333300000000008 1510 | name 1511 | Lisbon 1512 | population 1513 | 517802 1514 | timeZone 1515 | Europe/Lisbon 1516 | 1517 | 1518 | countryCode 1519 | SI 1520 | lat 1521 | 46.051079999999999 1522 | lon 1523 | 14.505129999999999 1524 | name 1525 | Ljubljana 1526 | population 1527 | 255115 1528 | timeZone 1529 | Europe/Ljubljana 1530 | 1531 | 1532 | countryCode 1533 | TG 1534 | lat 1535 | 6.13748 1536 | lon 1537 | 1.21227 1538 | name 1539 | Lomé 1540 | population 1541 | 749700 1542 | timeZone 1543 | Africa/Lome 1544 | 1545 | 1546 | countryCode 1547 | GB 1548 | lat 1549 | 51.50853 1550 | lon 1551 | -0.12573999999999999 1552 | name 1553 | London 1554 | population 1555 | 7556900 1556 | timeZone 1557 | Europe/London 1558 | 1559 | 1560 | countryCode 1561 | SJ 1562 | lat 1563 | 78.218599999999995 1564 | lon 1565 | 15.64007 1566 | name 1567 | Longyearbyen 1568 | population 1569 | 2060 1570 | timeZone 1571 | Arctic/Longyearbyen 1572 | 1573 | 1574 | countryCode 1575 | AO 1576 | lat 1577 | -8.8368199999999995 1578 | lon 1579 | 13.23432 1580 | name 1581 | Luanda 1582 | population 1583 | 2776168 1584 | timeZone 1585 | Africa/Luanda 1586 | 1587 | 1588 | countryCode 1589 | ZM 1590 | lat 1591 | -15.406689999999999 1592 | lon 1593 | 28.287130000000001 1594 | name 1595 | Lusaka 1596 | population 1597 | 1267440 1598 | timeZone 1599 | Africa/Lusaka 1600 | 1601 | 1602 | countryCode 1603 | LU 1604 | lat 1605 | 49.611669999999997 1606 | lon 1607 | 6.1299999999999999 1608 | name 1609 | Luxembourg 1610 | population 1611 | 76684 1612 | timeZone 1613 | Europe/Luxembourg 1614 | 1615 | 1616 | countryCode 1617 | MO 1618 | lat 1619 | 22.200559999999999 1620 | lon 1621 | 113.5461 1622 | name 1623 | Macau 1624 | population 1625 | 520400 1626 | timeZone 1627 | Asia/Macau 1628 | 1629 | 1630 | countryCode 1631 | ES 1632 | lat 1633 | 40.416499999999999 1634 | lon 1635 | -3.7025600000000001 1636 | name 1637 | Madrid 1638 | population 1639 | 3255944 1640 | timeZone 1641 | Europe/Madrid 1642 | 1643 | 1644 | countryCode 1645 | MH 1646 | lat 1647 | 7.0897100000000002 1648 | lon 1649 | 171.38030000000001 1650 | name 1651 | Majuro 1652 | population 1653 | 25400 1654 | timeZone 1655 | Pacific/Majuro 1656 | 1657 | 1658 | countryCode 1659 | GQ 1660 | lat 1661 | 3.75 1662 | lon 1663 | 8.7833299999999994 1664 | name 1665 | Malabo 1666 | population 1667 | 155963 1668 | timeZone 1669 | Africa/Malabo 1670 | 1671 | 1672 | countryCode 1673 | MV 1674 | lat 1675 | 4.1748000000000003 1676 | lon 1677 | 73.508880000000005 1678 | name 1679 | Male 1680 | population 1681 | 103693 1682 | timeZone 1683 | Indian/Maldives 1684 | 1685 | 1686 | countryCode 1687 | YT 1688 | lat 1689 | -12.779439999999999 1690 | lon 1691 | 45.227220000000003 1692 | name 1693 | Mamoudzou 1694 | population 1695 | 54831 1696 | timeZone 1697 | Indian/Mayotte 1698 | 1699 | 1700 | countryCode 1701 | NI 1702 | lat 1703 | 12.132820000000001 1704 | lon 1705 | -86.250399999999999 1706 | name 1707 | Managua 1708 | population 1709 | 973087 1710 | timeZone 1711 | America/Managua 1712 | 1713 | 1714 | countryCode 1715 | BH 1716 | lat 1717 | 26.21536 1718 | lon 1719 | 50.583199999999998 1720 | name 1721 | Manama 1722 | population 1723 | 147074 1724 | timeZone 1725 | Asia/Bahrain 1726 | 1727 | 1728 | countryCode 1729 | PH 1730 | lat 1731 | 14.604200000000001 1732 | lon 1733 | 120.98220000000001 1734 | name 1735 | Manila 1736 | population 1737 | 10444527 1738 | timeZone 1739 | Asia/Manila 1740 | 1741 | 1742 | countryCode 1743 | MZ 1744 | lat 1745 | -25.965530000000001 1746 | lon 1747 | 32.583219999999997 1748 | name 1749 | Maputo 1750 | population 1751 | 1191613 1752 | timeZone 1753 | Africa/Maputo 1754 | 1755 | 1756 | countryCode 1757 | AX 1758 | lat 1759 | 60.097259999999999 1760 | lon 1761 | 19.934809999999999 1762 | name 1763 | Mariehamn 1764 | population 1765 | 10682 1766 | timeZone 1767 | Europe/Mariehamn 1768 | 1769 | 1770 | countryCode 1771 | MF 1772 | lat 1773 | 18.066669999999998 1774 | lon 1775 | -63.083329999999997 1776 | name 1777 | Marigot 1778 | population 1779 | 5700 1780 | timeZone 1781 | America/Marigot 1782 | 1783 | 1784 | countryCode 1785 | LS 1786 | lat 1787 | -29.316669999999998 1788 | lon 1789 | 27.483329999999999 1790 | name 1791 | Maseru 1792 | population 1793 | 118355 1794 | timeZone 1795 | Africa/Maseru 1796 | 1797 | 1798 | countryCode 1799 | WF 1800 | lat 1801 | -13.28163 1802 | lon 1803 | -176.17449999999999 1804 | name 1805 | Mata-Utu 1806 | population 1807 | 1200 1808 | timeZone 1809 | Pacific/Wallis 1810 | 1811 | 1812 | countryCode 1813 | SZ 1814 | lat 1815 | -26.316669999999998 1816 | lon 1817 | 31.133330000000001 1818 | name 1819 | Mbabane 1820 | population 1821 | 76218 1822 | timeZone 1823 | Africa/Mbabane 1824 | 1825 | 1826 | countryCode 1827 | PW 1828 | lat 1829 | 7.5004299999999997 1830 | lon 1831 | 134.62350000000001 1832 | name 1833 | Melekeok 1834 | population 1835 | 0 1836 | timeZone 1837 | Pacific/Palau 1838 | 1839 | 1840 | countryCode 1841 | MX 1842 | lat 1843 | 19.428470000000001 1844 | lon 1845 | -99.127660000000006 1846 | name 1847 | Mexico City 1848 | population 1849 | 12294193 1850 | timeZone 1851 | America/Mexico_City 1852 | 1853 | 1854 | countryCode 1855 | BY 1856 | lat 1857 | 53.899999999999999 1858 | lon 1859 | 27.566669999999998 1860 | name 1861 | Minsk 1862 | population 1863 | 1742124 1864 | timeZone 1865 | Europe/Minsk 1866 | 1867 | 1868 | countryCode 1869 | SO 1870 | lat 1871 | 2.0371100000000002 1872 | lon 1873 | 45.34375 1874 | name 1875 | Mogadishu 1876 | population 1877 | 2587183 1878 | timeZone 1879 | Africa/Mogadishu 1880 | 1881 | 1882 | countryCode 1883 | MC 1884 | lat 1885 | 43.733330000000002 1886 | lon 1887 | 7.4166699999999999 1888 | name 1889 | Monaco 1890 | population 1891 | 32965 1892 | timeZone 1893 | Europe/Monaco 1894 | 1895 | 1896 | countryCode 1897 | LR 1898 | lat 1899 | 6.3005399999999998 1900 | lon 1901 | -10.796900000000001 1902 | name 1903 | Monrovia 1904 | population 1905 | 939524 1906 | timeZone 1907 | Africa/Monrovia 1908 | 1909 | 1910 | countryCode 1911 | UY 1912 | lat 1913 | -34.833460000000002 1914 | lon 1915 | -56.167349999999999 1916 | name 1917 | Montevideo 1918 | population 1919 | 1270737 1920 | timeZone 1921 | America/Montevideo 1922 | 1923 | 1924 | countryCode 1925 | KM 1926 | lat 1927 | -11.702159999999999 1928 | lon 1929 | 43.25506 1930 | name 1931 | Moroni 1932 | population 1933 | 42872 1934 | timeZone 1935 | Indian/Comoro 1936 | 1937 | 1938 | countryCode 1939 | RU 1940 | lat 1941 | 55.752220000000001 1942 | lon 1943 | 37.615560000000002 1944 | name 1945 | Moscow 1946 | population 1947 | 10381222 1948 | timeZone 1949 | Europe/Moscow 1950 | 1951 | 1952 | countryCode 1953 | OM 1954 | lat 1955 | 23.613869999999999 1956 | lon 1957 | 58.592199999999998 1958 | name 1959 | Muscat 1960 | population 1961 | 797000 1962 | timeZone 1963 | Asia/Muscat 1964 | 1965 | 1966 | countryCode 1967 | TD 1968 | lat 1969 | 12.106719999999999 1970 | lon 1971 | 15.0444 1972 | name 1973 | N'Djamena 1974 | population 1975 | 721081 1976 | timeZone 1977 | Africa/Ndjamena 1978 | 1979 | 1980 | countryCode 1981 | KE 1982 | lat 1983 | -1.2833300000000001 1984 | lon 1985 | 36.816670000000002 1986 | name 1987 | Nairobi 1988 | population 1989 | 2750547 1990 | timeZone 1991 | Africa/Nairobi 1992 | 1993 | 1994 | countryCode 1995 | BS 1996 | lat 1997 | 25.058229999999998 1998 | lon 1999 | -77.343059999999994 2000 | name 2001 | Nassau 2002 | population 2003 | 227940 2004 | timeZone 2005 | America/Nassau 2006 | 2007 | 2008 | countryCode 2009 | MM 2010 | lat 2011 | 19.745000000000001 2012 | lon 2013 | 96.129720000000006 2014 | name 2015 | Nay Pyi Taw 2016 | population 2017 | 925000 2018 | timeZone 2019 | Asia/Rangoon 2020 | 2021 | 2022 | countryCode 2023 | IN 2024 | lat 2025 | 28.635760000000001 2026 | lon 2027 | 77.224450000000004 2028 | name 2029 | New Delhi 2030 | population 2031 | 317797 2032 | timeZone 2033 | Asia/Kolkata 2034 | 2035 | 2036 | countryCode 2037 | NE 2038 | lat 2039 | 13.51366 2040 | lon 2041 | 2.1097999999999999 2042 | name 2043 | Niamey 2044 | population 2045 | 774235 2046 | timeZone 2047 | Africa/Niamey 2048 | 2049 | 2050 | countryCode 2051 | CY 2052 | lat 2053 | 35.166670000000003 2054 | lon 2055 | 33.366669999999999 2056 | name 2057 | Nicosia 2058 | population 2059 | 200452 2060 | timeZone 2061 | Asia/Nicosia 2062 | 2063 | 2064 | countryCode 2065 | MR 2066 | lat 2067 | 18.085809999999999 2068 | lon 2069 | -15.9785 2070 | name 2071 | Nouakchott 2072 | population 2073 | 661400 2074 | timeZone 2075 | Africa/Nouakchott 2076 | 2077 | 2078 | countryCode 2079 | NC 2080 | lat 2081 | -22.276309999999999 2082 | lon 2083 | 166.4572 2084 | name 2085 | Nouméa 2086 | population 2087 | 93060 2088 | timeZone 2089 | Pacific/Noumea 2090 | 2091 | 2092 | countryCode 2093 | TO 2094 | lat 2095 | -21.139379999999999 2096 | lon 2097 | -175.20179999999999 2098 | name 2099 | Nuku‘alofa 2100 | population 2101 | 22400 2102 | timeZone 2103 | Pacific/Tongatapu 2104 | 2105 | 2106 | countryCode 2107 | GL 2108 | lat 2109 | 64.18347 2110 | lon 2111 | -51.72157 2112 | name 2113 | Nuuk 2114 | population 2115 | 14798 2116 | timeZone 2117 | America/Godthab 2118 | 2119 | 2120 | countryCode 2121 | AW 2122 | lat 2123 | 12.52398 2124 | lon 2125 | -70.027029999999996 2126 | name 2127 | Oranjestad 2128 | population 2129 | 29998 2130 | timeZone 2131 | America/Aruba 2132 | 2133 | 2134 | countryCode 2135 | NO 2136 | lat 2137 | 59.912730000000003 2138 | lon 2139 | 10.746090000000001 2140 | name 2141 | Oslo 2142 | population 2143 | 580000 2144 | timeZone 2145 | Europe/Oslo 2146 | 2147 | 2148 | countryCode 2149 | CA 2150 | lat 2151 | 45.411169999999998 2152 | lon 2153 | -75.698120000000003 2154 | name 2155 | Ottawa 2156 | population 2157 | 812129 2158 | timeZone 2159 | America/Toronto 2160 | 2161 | 2162 | countryCode 2163 | BF 2164 | lat 2165 | 12.36566 2166 | lon 2167 | -1.5338799999999999 2168 | name 2169 | Ouagadougou 2170 | population 2171 | 1086505 2172 | timeZone 2173 | Africa/Ouagadougou 2174 | 2175 | 2176 | countryCode 2177 | AS 2178 | lat 2179 | -14.27806 2180 | lon 2181 | -170.70249999999999 2182 | name 2183 | Pago Pago 2184 | population 2185 | 11500 2186 | timeZone 2187 | Pacific/Pago_Pago 2188 | 2189 | 2190 | countryCode 2191 | FM 2192 | lat 2193 | 6.9247699999999996 2194 | lon 2195 | 158.1611 2196 | name 2197 | Palikir - National Government Center 2198 | population 2199 | 0 2200 | timeZone 2201 | Pacific/Pohnpei 2202 | 2203 | 2204 | countryCode 2205 | PA 2206 | lat 2207 | 8.9936000000000007 2208 | lon 2209 | -79.519729999999996 2210 | name 2211 | Panamá 2212 | population 2213 | 408168 2214 | timeZone 2215 | America/Panama 2216 | 2217 | 2218 | countryCode 2219 | PF 2220 | lat 2221 | -17.533329999999999 2222 | lon 2223 | -149.5667 2224 | name 2225 | Papeete 2226 | population 2227 | 26357 2228 | timeZone 2229 | Pacific/Tahiti 2230 | 2231 | 2232 | countryCode 2233 | SR 2234 | lat 2235 | 5.8663800000000004 2236 | lon 2237 | -55.166820000000001 2238 | name 2239 | Paramaribo 2240 | population 2241 | 223757 2242 | timeZone 2243 | America/Paramaribo 2244 | 2245 | 2246 | countryCode 2247 | FR 2248 | lat 2249 | 48.853409999999997 2250 | lon 2251 | 2.3488000000000002 2252 | name 2253 | Paris 2254 | population 2255 | 2138551 2256 | timeZone 2257 | Europe/Paris 2258 | 2259 | 2260 | countryCode 2261 | SX 2262 | lat 2263 | 18.026 2264 | lon 2265 | -63.045819999999999 2266 | name 2267 | Philipsburg 2268 | population 2269 | 1400 2270 | timeZone 2271 | America/Lower_Princes 2272 | 2273 | 2274 | countryCode 2275 | KH 2276 | lat 2277 | 11.56245 2278 | lon 2279 | 104.916 2280 | name 2281 | Phnom Penh 2282 | population 2283 | 1573544 2284 | timeZone 2285 | Asia/Phnom_Penh 2286 | 2287 | 2288 | countryCode 2289 | MS 2290 | lat 2291 | 16.705549999999999 2292 | lon 2293 | -62.212919999999997 2294 | name 2295 | Plymouth 2296 | population 2297 | 0 2298 | timeZone 2299 | America/Montserrat 2300 | 2301 | 2302 | countryCode 2303 | ME 2304 | lat 2305 | 42.441110000000002 2306 | lon 2307 | 19.26361 2308 | name 2309 | Podgorica 2310 | population 2311 | 136473 2312 | timeZone 2313 | Europe/Podgorica 2314 | 2315 | 2316 | countryCode 2317 | MU 2318 | lat 2319 | -20.161940000000001 2320 | lon 2321 | 57.498890000000003 2322 | name 2323 | Port Louis 2324 | population 2325 | 155226 2326 | timeZone 2327 | Indian/Mauritius 2328 | 2329 | 2330 | countryCode 2331 | PG 2332 | lat 2333 | -9.4431399999999996 2334 | lon 2335 | 147.1797 2336 | name 2337 | Port Moresby 2338 | population 2339 | 283733 2340 | timeZone 2341 | Pacific/Port_Moresby 2342 | 2343 | 2344 | countryCode 2345 | VU 2346 | lat 2347 | -17.733809999999998 2348 | lon 2349 | 168.3219 2350 | name 2351 | Port-Vila 2352 | population 2353 | 35901 2354 | timeZone 2355 | Pacific/Efate 2356 | 2357 | 2358 | countryCode 2359 | HT 2360 | lat 2361 | 18.539169999999999 2362 | lon 2363 | -72.334999999999994 2364 | name 2365 | Port-au-Prince 2366 | population 2367 | 1234742 2368 | timeZone 2369 | America/Port-au-Prince 2370 | 2371 | 2372 | countryCode 2373 | TF 2374 | lat 2375 | -49.350000000000001 2376 | lon 2377 | 70.216669999999993 2378 | name 2379 | Port-aux-Français 2380 | population 2381 | 45 2382 | timeZone 2383 | Indian/Kerguelen 2384 | 2385 | 2386 | countryCode 2387 | TT 2388 | lat 2389 | 10.666169999999999 2390 | lon 2391 | -61.516570000000002 2392 | name 2393 | Port-of-Spain 2394 | population 2395 | 49031 2396 | timeZone 2397 | America/Port_of_Spain 2398 | 2399 | 2400 | countryCode 2401 | BJ 2402 | lat 2403 | 6.4964599999999999 2404 | lon 2405 | 2.6035900000000001 2406 | name 2407 | Porto-Novo 2408 | population 2409 | 234168 2410 | timeZone 2411 | Africa/Porto-Novo 2412 | 2413 | 2414 | countryCode 2415 | CZ 2416 | lat 2417 | 50.088039999999999 2418 | lon 2419 | 14.42076 2420 | name 2421 | Prague 2422 | population 2423 | 1165581 2424 | timeZone 2425 | Europe/Prague 2426 | 2427 | 2428 | countryCode 2429 | CV 2430 | lat 2431 | 14.931520000000001 2432 | lon 2433 | -23.512540000000001 2434 | name 2435 | Praia 2436 | population 2437 | 113364 2438 | timeZone 2439 | Atlantic/Cape_Verde 2440 | 2441 | 2442 | countryCode 2443 | ZA 2444 | lat 2445 | -25.744859999999999 2446 | lon 2447 | 28.187830000000002 2448 | name 2449 | Pretoria 2450 | population 2451 | 1619438 2452 | timeZone 2453 | Africa/Johannesburg 2454 | 2455 | 2456 | countryCode 2457 | XK 2458 | lat 2459 | 42.672719999999998 2460 | lon 2461 | 21.166879999999999 2462 | name 2463 | Pristina 2464 | population 2465 | 550000 2466 | timeZone 2467 | Europe/Belgrade 2468 | 2469 | 2470 | countryCode 2471 | KP 2472 | lat 2473 | 39.033850000000001 2474 | lon 2475 | 125.7543 2476 | name 2477 | Pyongyang 2478 | population 2479 | 3222000 2480 | timeZone 2481 | Asia/Pyongyang 2482 | 2483 | 2484 | countryCode 2485 | EC 2486 | lat 2487 | -0.22985 2488 | lon 2489 | -78.524950000000004 2490 | name 2491 | Quito 2492 | population 2493 | 1399814 2494 | timeZone 2495 | America/Guayaquil 2496 | 2497 | 2498 | countryCode 2499 | MA 2500 | lat 2501 | 34.013249999999999 2502 | lon 2503 | -6.8325500000000003 2504 | name 2505 | Rabat 2506 | population 2507 | 1655753 2508 | timeZone 2509 | Africa/Casablanca 2510 | 2511 | 2512 | countryCode 2513 | IS 2514 | lat 2515 | 64.135480000000001 2516 | lon 2517 | -21.895409999999998 2518 | name 2519 | Reykjavík 2520 | population 2521 | 113906 2522 | timeZone 2523 | Atlantic/Reykjavik 2524 | 2525 | 2526 | countryCode 2527 | LV 2528 | lat 2529 | 56.945999999999998 2530 | lon 2531 | 24.105889999999999 2532 | name 2533 | Riga 2534 | population 2535 | 742572 2536 | timeZone 2537 | Europe/Riga 2538 | 2539 | 2540 | countryCode 2541 | SA 2542 | lat 2543 | 24.687729999999998 2544 | lon 2545 | 46.721850000000003 2546 | name 2547 | Riyadh 2548 | population 2549 | 4205961 2550 | timeZone 2551 | Asia/Riyadh 2552 | 2553 | 2554 | countryCode 2555 | VG 2556 | lat 2557 | 18.41667 2558 | lon 2559 | -64.616669999999999 2560 | name 2561 | Road Town 2562 | population 2563 | 8449 2564 | timeZone 2565 | America/Tortola 2566 | 2567 | 2568 | countryCode 2569 | IT 2570 | lat 2571 | 41.894739999999999 2572 | lon 2573 | 12.4839 2574 | name 2575 | Rome 2576 | population 2577 | 2563241 2578 | timeZone 2579 | Europe/Rome 2580 | 2581 | 2582 | countryCode 2583 | DM 2584 | lat 2585 | 15.301740000000001 2586 | lon 2587 | -61.388080000000002 2588 | name 2589 | Roseau 2590 | population 2591 | 16571 2592 | timeZone 2593 | America/Dominica 2594 | 2595 | 2596 | countryCode 2597 | GD 2598 | lat 2599 | 12.05644 2600 | lon 2601 | -61.748489999999997 2602 | name 2603 | Saint George's 2604 | population 2605 | 7500 2606 | timeZone 2607 | America/Grenada 2608 | 2609 | 2610 | countryCode 2611 | JE 2612 | lat 2613 | 49.188040000000001 2614 | lon 2615 | -2.1049099999999998 2616 | name 2617 | Saint Helier 2618 | population 2619 | 28000 2620 | timeZone 2621 | Europe/Jersey 2622 | 2623 | 2624 | countryCode 2625 | AG 2626 | lat 2627 | 17.116669999999999 2628 | lon 2629 | -61.850000000000001 2630 | name 2631 | Saint John’s 2632 | population 2633 | 24226 2634 | timeZone 2635 | America/Antigua 2636 | 2637 | 2638 | countryCode 2639 | GG 2640 | lat 2641 | 49.459809999999997 2642 | lon 2643 | -2.5352700000000001 2644 | name 2645 | Saint Peter Port 2646 | population 2647 | 16488 2648 | timeZone 2649 | Europe/Guernsey 2650 | 2651 | 2652 | countryCode 2653 | RE 2654 | lat 2655 | -20.88231 2656 | lon 2657 | 55.450400000000002 2658 | name 2659 | Saint-Denis 2660 | population 2661 | 137195 2662 | timeZone 2663 | Indian/Reunion 2664 | 2665 | 2666 | countryCode 2667 | PM 2668 | lat 2669 | 46.780909999999999 2670 | lon 2671 | -56.171959999999999 2672 | name 2673 | Saint-Pierre 2674 | population 2675 | 6200 2676 | timeZone 2677 | America/Miquelon 2678 | 2679 | 2680 | countryCode 2681 | MP 2682 | lat 2683 | 15.21233 2684 | lon 2685 | 145.75450000000001 2686 | name 2687 | Saipan 2688 | population 2689 | 48220 2690 | timeZone 2691 | Pacific/Saipan 2692 | 2693 | 2694 | countryCode 2695 | CR 2696 | lat 2697 | 9.9333299999999998 2698 | lon 2699 | -84.083330000000004 2700 | name 2701 | San José 2702 | population 2703 | 335007 2704 | timeZone 2705 | America/Costa_Rica 2706 | 2707 | 2708 | countryCode 2709 | PR 2710 | lat 2711 | 18.466329999999999 2712 | lon 2713 | -66.105720000000005 2714 | name 2715 | San Juan 2716 | population 2717 | 418140 2718 | timeZone 2719 | America/Puerto_Rico 2720 | 2721 | 2722 | countryCode 2723 | SM 2724 | lat 2725 | 43.936669999999999 2726 | lon 2727 | 12.446389999999999 2728 | name 2729 | San Marino 2730 | population 2731 | 4500 2732 | timeZone 2733 | Europe/San_Marino 2734 | 2735 | 2736 | countryCode 2737 | SV 2738 | lat 2739 | 13.689349999999999 2740 | lon 2741 | -89.187179999999998 2742 | name 2743 | San Salvador 2744 | population 2745 | 525990 2746 | timeZone 2747 | America/El_Salvador 2748 | 2749 | 2750 | countryCode 2751 | YE 2752 | lat 2753 | 15.35472 2754 | lon 2755 | 44.206670000000003 2756 | name 2757 | Sanaa 2758 | population 2759 | 1937451 2760 | timeZone 2761 | Asia/Aden 2762 | 2763 | 2764 | countryCode 2765 | CL 2766 | lat 2767 | -33.456940000000003 2768 | lon 2769 | -70.648269999999997 2770 | name 2771 | Santiago 2772 | population 2773 | 4837295 2774 | timeZone 2775 | America/Santiago 2776 | 2777 | 2778 | countryCode 2779 | DO 2780 | lat 2781 | 18.500119999999999 2782 | lon 2783 | -69.988569999999996 2784 | name 2785 | Santo Domingo 2786 | population 2787 | 2201941 2788 | timeZone 2789 | America/Santo_Domingo 2790 | 2791 | 2792 | countryCode 2793 | BA 2794 | lat 2795 | 43.848640000000003 2796 | lon 2797 | 18.356439999999999 2798 | name 2799 | Sarajevo 2800 | population 2801 | 696731 2802 | timeZone 2803 | Europe/Sarajevo 2804 | 2805 | 2806 | countryCode 2807 | KR 2808 | lat 2809 | 37.568260000000002 2810 | lon 2811 | 126.9778 2812 | name 2813 | Seoul 2814 | population 2815 | 10349312 2816 | timeZone 2817 | Asia/Seoul 2818 | 2819 | 2820 | countryCode 2821 | SG 2822 | lat 2823 | 1.2896700000000001 2824 | lon 2825 | 103.8501 2826 | name 2827 | Singapore 2828 | population 2829 | 3547809 2830 | timeZone 2831 | Asia/Singapore 2832 | 2833 | 2834 | countryCode 2835 | MK 2836 | lat 2837 | 42.001220000000004 2838 | lon 2839 | 21.42878 2840 | name 2841 | Skopje 2842 | population 2843 | 474889 2844 | timeZone 2845 | Europe/Skopje 2846 | 2847 | 2848 | countryCode 2849 | BG 2850 | lat 2851 | 42.697510000000001 2852 | lon 2853 | 23.324149999999999 2854 | name 2855 | Sofia 2856 | population 2857 | 1152556 2858 | timeZone 2859 | Europe/Sofia 2860 | 2861 | 2862 | countryCode 2863 | FK 2864 | lat 2865 | -51.700000000000003 2866 | lon 2867 | -57.850000000000001 2868 | name 2869 | Stanley 2870 | population 2871 | 2213 2872 | timeZone 2873 | Atlantic/Stanley 2874 | 2875 | 2876 | countryCode 2877 | SE 2878 | lat 2879 | 59.33258 2880 | lon 2881 | 18.064900000000002 2882 | name 2883 | Stockholm 2884 | population 2885 | 1253309 2886 | timeZone 2887 | Europe/Stockholm 2888 | 2889 | 2890 | countryCode 2891 | BO 2892 | lat 2893 | -19.03332 2894 | lon 2895 | -65.262739999999994 2896 | name 2897 | Sucre 2898 | population 2899 | 224838 2900 | timeZone 2901 | America/La_Paz 2902 | 2903 | 2904 | countryCode 2905 | FJ 2906 | lat 2907 | -18.14161 2908 | lon 2909 | 178.44149999999999 2910 | name 2911 | Suva 2912 | population 2913 | 77366 2914 | timeZone 2915 | Pacific/Fiji 2916 | 2917 | 2918 | countryCode 2919 | ST 2920 | lat 2921 | 0.33654000000000001 2922 | lon 2923 | 6.7273199999999997 2924 | name 2925 | São Tomé 2926 | population 2927 | 53300 2928 | timeZone 2929 | Africa/Sao_Tome 2930 | 2931 | 2932 | countryCode 2933 | TW 2934 | lat 2935 | 25.04776 2936 | lon 2937 | 121.53189999999999 2938 | name 2939 | Taipei 2940 | population 2941 | 7871900 2942 | timeZone 2943 | Asia/Taipei 2944 | 2945 | 2946 | countryCode 2947 | EE 2948 | lat 2949 | 59.436959999999999 2950 | lon 2951 | 24.753530000000001 2952 | name 2953 | Tallinn 2954 | population 2955 | 394024 2956 | timeZone 2957 | Europe/Tallinn 2958 | 2959 | 2960 | countryCode 2961 | KI 2962 | lat 2963 | 1.3278000000000001 2964 | lon 2965 | 172.977 2966 | name 2967 | Tarawa 2968 | population 2969 | 40311 2970 | timeZone 2971 | Pacific/Tarawa 2972 | 2973 | 2974 | countryCode 2975 | UZ 2976 | lat 2977 | 41.264650000000003 2978 | lon 2979 | 69.216269999999994 2980 | name 2981 | Tashkent 2982 | population 2983 | 1978028 2984 | timeZone 2985 | Asia/Tashkent 2986 | 2987 | 2988 | countryCode 2989 | GE 2990 | lat 2991 | 41.694110000000002 2992 | lon 2993 | 44.833680000000001 2994 | name 2995 | Tbilisi 2996 | population 2997 | 1049498 2998 | timeZone 2999 | Asia/Tbilisi 3000 | 3001 | 3002 | countryCode 3003 | HN 3004 | lat 3005 | 14.081799999999999 3006 | lon 3007 | -87.206810000000004 3008 | name 3009 | Tegucigalpa 3010 | population 3011 | 850848 3012 | timeZone 3013 | America/Tegucigalpa 3014 | 3015 | 3016 | countryCode 3017 | IR 3018 | lat 3019 | 35.694389999999999 3020 | lon 3021 | 51.421509999999998 3022 | name 3023 | Tehrān 3024 | population 3025 | 7153309 3026 | timeZone 3027 | Asia/Tehran 3028 | 3029 | 3030 | countryCode 3031 | AI 3032 | lat 3033 | 18.217040000000001 3034 | lon 3035 | -63.057830000000003 3036 | name 3037 | The Valley 3038 | population 3039 | 2035 3040 | timeZone 3041 | America/Anguilla 3042 | 3043 | 3044 | countryCode 3045 | BT 3046 | lat 3047 | 27.466090000000001 3048 | lon 3049 | 89.641909999999996 3050 | name 3051 | Thimphu 3052 | population 3053 | 98676 3054 | timeZone 3055 | Asia/Thimphu 3056 | 3057 | 3058 | countryCode 3059 | AL 3060 | lat 3061 | 41.327500000000001 3062 | lon 3063 | 19.81889 3064 | name 3065 | Tirana 3066 | population 3067 | 374801 3068 | timeZone 3069 | Europe/Tirane 3070 | 3071 | 3072 | countryCode 3073 | JP 3074 | lat 3075 | 35.689500000000002 3076 | lon 3077 | 139.6917 3078 | name 3079 | Tokyo 3080 | population 3081 | 8336599 3082 | timeZone 3083 | Asia/Tokyo 3084 | 3085 | 3086 | countryCode 3087 | LY 3088 | lat 3089 | 32.875190000000003 3090 | lon 3091 | 13.18746 3092 | name 3093 | Tripoli 3094 | population 3095 | 1150989 3096 | timeZone 3097 | Africa/Tripoli 3098 | 3099 | 3100 | countryCode 3101 | TN 3102 | lat 3103 | 36.81897 3104 | lon 3105 | 10.165789999999999 3106 | name 3107 | Tunis 3108 | population 3109 | 693210 3110 | timeZone 3111 | Africa/Tunis 3112 | 3113 | 3114 | countryCode 3115 | FO 3116 | lat 3117 | 62.009729999999998 3118 | lon 3119 | -6.7716399999999997 3120 | name 3121 | Tórshavn 3122 | population 3123 | 13200 3124 | timeZone 3125 | Atlantic/Faroe 3126 | 3127 | 3128 | countryCode 3129 | MN 3130 | lat 3131 | 47.907710000000002 3132 | lon 3133 | 106.8832 3134 | name 3135 | Ulaanbaatar 3136 | population 3137 | 844818 3138 | timeZone 3139 | Asia/Ulaanbaatar 3140 | 3141 | 3142 | countryCode 3143 | LI 3144 | lat 3145 | 47.141509999999997 3146 | lon 3147 | 9.5215399999999999 3148 | name 3149 | Vaduz 3150 | population 3151 | 5197 3152 | timeZone 3153 | Europe/Vaduz 3154 | 3155 | 3156 | countryCode 3157 | MT 3158 | lat 3159 | 35.899720000000002 3160 | lon 3161 | 14.514720000000001 3162 | name 3163 | Valletta 3164 | population 3165 | 6794 3166 | timeZone 3167 | Europe/Malta 3168 | 3169 | 3170 | countryCode 3171 | VA 3172 | lat 3173 | 41.902360000000002 3174 | lon 3175 | 12.45332 3176 | name 3177 | Vatican City 3178 | population 3179 | 829 3180 | timeZone 3181 | Europe/Vatican 3182 | 3183 | 3184 | countryCode 3185 | SC 3186 | lat 3187 | -4.6166700000000001 3188 | lon 3189 | 55.450000000000003 3190 | name 3191 | Victoria 3192 | population 3193 | 22881 3194 | timeZone 3195 | Indian/Mahe 3196 | 3197 | 3198 | countryCode 3199 | AT 3200 | lat 3201 | 48.208489999999998 3202 | lon 3203 | 16.37208 3204 | name 3205 | Vienna 3206 | population 3207 | 1691468 3208 | timeZone 3209 | Europe/Vienna 3210 | 3211 | 3212 | countryCode 3213 | LA 3214 | lat 3215 | 17.966670000000001 3216 | lon 3217 | 102.59999999999999 3218 | name 3219 | Vientiane 3220 | population 3221 | 196731 3222 | timeZone 3223 | Asia/Vientiane 3224 | 3225 | 3226 | countryCode 3227 | LT 3228 | lat 3229 | 54.689160000000001 3230 | lon 3231 | 25.279800000000002 3232 | name 3233 | Vilnius 3234 | population 3235 | 542366 3236 | timeZone 3237 | Europe/Vilnius 3238 | 3239 | 3240 | countryCode 3241 | PL 3242 | lat 3243 | 52.229770000000002 3244 | lon 3245 | 21.011780000000002 3246 | name 3247 | Warsaw 3248 | population 3249 | 1702139 3250 | timeZone 3251 | Europe/Warsaw 3252 | 3253 | 3254 | countryCode 3255 | US 3256 | lat 3257 | 38.895110000000003 3258 | lon 3259 | -77.036370000000005 3260 | name 3261 | Washington, D. C. 3262 | population 3263 | 601723 3264 | timeZone 3265 | America/New_York 3266 | 3267 | 3268 | countryCode 3269 | NZ 3270 | lat 3271 | -41.286639999999998 3272 | lon 3273 | 174.7756 3274 | name 3275 | Wellington 3276 | population 3277 | 381900 3278 | timeZone 3279 | Pacific/Auckland 3280 | 3281 | 3282 | countryCode 3283 | CC 3284 | lat 3285 | -12.15681 3286 | lon 3287 | 96.822509999999994 3288 | name 3289 | West Island 3290 | population 3291 | 120 3292 | timeZone 3293 | Indian/Cocos 3294 | 3295 | 3296 | countryCode 3297 | CW 3298 | lat 3299 | 12.1084 3300 | lon 3301 | -68.933539999999994 3302 | name 3303 | Willemstad 3304 | population 3305 | 125000 3306 | timeZone 3307 | America/Curacao 3308 | 3309 | 3310 | countryCode 3311 | NA 3312 | lat 3313 | -22.55941 3314 | lon 3315 | 17.08323 3316 | name 3317 | Windhoek 3318 | population 3319 | 268132 3320 | timeZone 3321 | Africa/Windhoek 3322 | 3323 | 3324 | countryCode 3325 | CI 3326 | lat 3327 | 6.8205499999999999 3328 | lon 3329 | -5.2767400000000002 3330 | name 3331 | Yamoussoukro 3332 | population 3333 | 194530 3334 | timeZone 3335 | Africa/Abidjan 3336 | 3337 | 3338 | countryCode 3339 | CM 3340 | lat 3341 | 3.8666700000000001 3342 | lon 3343 | 11.51667 3344 | name 3345 | Yaoundé 3346 | population 3347 | 1299369 3348 | timeZone 3349 | Africa/Douala 3350 | 3351 | 3352 | countryCode 3353 | AM 3354 | lat 3355 | 40.181109999999997 3356 | lon 3357 | 44.51361 3358 | name 3359 | Yerevan 3360 | population 3361 | 1093485 3362 | timeZone 3363 | Asia/Yerevan 3364 | 3365 | 3366 | countryCode 3367 | HR 3368 | lat 3369 | 45.814439999999998 3370 | lon 3371 | 15.977980000000001 3372 | name 3373 | Zagreb 3374 | population 3375 | 698966 3376 | timeZone 3377 | Europe/Zagreb 3378 | 3379 | 3380 | 3381 | -------------------------------------------------------------------------------- /capitals-example/Capitals/main.m: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2013, MapsWithMe GmbH 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ******************************************************************************/ 28 | 29 | #import 30 | 31 | #import "AppDelegate.h" 32 | 33 | int main(int argc, char * argv[]) 34 | { 35 | @autoreleasepool 36 | { 37 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /site-resources/add_custom_url_scheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/organicmaps/api-ios/7b95e1e24c1a9ed4b547788b3dcfd2cce36acace/site-resources/add_custom_url_scheme.png -------------------------------------------------------------------------------- /site-resources/download_mwm_dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/organicmaps/api-ios/7b95e1e24c1a9ed4b547788b3dcfd2cce36acace/site-resources/download_mwm_dialog.png --------------------------------------------------------------------------------