Guest User

Untitled

a guest
Jan 24th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. using Android.App;
  2. using Android.Widget;
  3. using Android.OS;
  4. using Android.Gms.Maps;
  5.  
  6. namespace App1
  7. {
  8. [Activity(Label = "App1", MainLauncher = true)]
  9.  
  10. public class MainActiity : Activity, IOnMapReadyCallback
  11.  
  12. {
  13. private GoogleMap GMap;
  14. protected override void OnCreate(Bundle savedInstanceState)
  15. {
  16. base.OnCreate(savedInstanceState);
  17.  
  18. // Set our view from the "main" layout resource
  19. SetContentView(Resource.Layout.Main);
  20. SetUpMap();
  21. }
  22. private void SetUpMap()
  23. {
  24. if (GMap == null)
  25. {
  26. FragmentManager.FindFragmentById<MapFragment>(Resource.Id.googlemap).GetMapAsync(this);
  27. }
  28. }
  29. public void OnMapReady(GoogleMap googleMap)
  30. {
  31. this.GMap = googleMap;
  32. }
  33. }
  34. }
Add Comment
Please, Sign In to add comment