Created
December 14, 2012 22:59
-
-
Save dvdsgl/4289386 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Register an API key in your AppDelegate's FinsihedLaunching method: | |
// GMSServices.ProvideAPIKey ("Your API key."); | |
GMSMapView mapView; | |
public override void ViewDidLoad () | |
{ | |
base.ViewDidLoad (); | |
// Create the map view, framing Xamarin headquarters | |
mapView = new GMSMapView { | |
Camera = new GMSCamera (37.797865, -122.402526, 6) | |
}; | |
// Add a marker for Sydney. | |
var xamarinhq = new GMSMarkerOptions { | |
Title = "Xamarin HQ", | |
Snippet = "Where the magic happens.", | |
Position = new CLLocationCoordinate2D (37.797865, -122.402526) | |
}; | |
mapView.AddMarker (xamarinhq); | |
// Set the map as our main view. | |
View = mapView; | |
} | |
public override void ViewWillAppear (bool animated) | |
{ | |
base.ViewWillAppear (animated); | |
mapView.StartRendering (); | |
} | |
public override void ViewWillDisappear (bool animated) | |
{ | |
base.ViewWillDisappear (animated); | |
mapView.StopRendering (); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment