public static void Init(string apiKey, PlatformConfig config = null) { MapServices.ProvideApiKey(apiKey); GeocoderBackend.Register(); MapRenderer.Config = config ?? new PlatformConfig(); IsInitialized = true; }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { // Override point for customization after application launch. // If not required for your application you can safely delete this method var splitViewController = UIStoryboard.FromName("Main", null).InstantiateViewController(nameof(UISplitViewController)) as UISplitViewController; splitViewController.Delegate = this; splitViewController.PreferredDisplayMode = UISplitViewControllerDisplayMode.PrimaryOverlay; Window = new UIWindow(UIScreen.MainScreen.Bounds) { RootViewController = splitViewController }; Window.MakeKeyAndVisible(); if (string.IsNullOrWhiteSpace(GoogleApiKey.Key)) { var message = $"Configure the Key property inside GoogleApiKey class for your bundle {NSBundle.MainBundle.BundleIdentifier}"; ShowMessage("Google API Key is missing...", message, Window.RootViewController); } else { // Provide the Places API with your API key. PlacesClient.ProvideApiKey(GoogleApiKey.Key); // Provide the Maps API with your API key. You may not need // this in your app, however we do need this for the demo // app as it uses Maps. MapServices.ProvideApiKey(GoogleApiKey.Key); } return(true); }
public bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { if (string.IsNullOrEmpty(kMapsAPIKey)) { throw new Exception("Please provide your own Google Maps Api Key"); } MapServices.ProvideApiKey(kMapsAPIKey); return(true); }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { MapServices.ProvideApiKey("<Get your Api Key at https://code.google.com/apis/console/>"); window = new UIWindow(UIScreen.MainScreen.Bounds) { RootViewController = new MapViewController() }; window.MakeKeyAndVisible(); return(true); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { MapServices.ProvideApiKey(MapsApiKey); window = new UIWindow(UIScreen.MainScreen.Bounds); dvc = new DVCMenu(); navController = new UINavigationController(dvc); window.RootViewController = navController; window.MakeKeyAndVisible(); return(true); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { MapServices.ProvideApiKey(MapsApiKey); global::Xamarin.Forms.Forms.Init(); // Override default ImageFactory by your implementation. var platformConfig = new PlatformConfig { ImageFactory = new CachingImageFactory() }; Xamarin.FormsGoogleMaps.Init(MapsApiKey, platformConfig); LoadApplication(new App()); return(base.FinishedLaunching(app, options)); }