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 GLMapManager.SharedManager().Init(); GLMapManager.SharedManager().ApiKey = File.ReadAllText("./APIKey.txt");; return(true); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. GLMapManager.SharedManager().TileDownloadingAllowed = true; mapView = new GLMapView(); mapView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; mapView.ShowUserLocation = true; mapView.BackgroundColor = UIColor.Red; var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var cacheDir = Path.Combine(documents, "RasterCache"); Directory.CreateDirectory(cacheDir); var cache = Path.Combine(cacheDir, "os.cache"); mapView.RasterSources = new GLMapRasterTileSource[] { new OSMTileSource(cache) }; this.View.AddSubview(mapView); }