Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Android.App;
- using Android.Widget;
- using Android.OS;
- using Android.Gms.Maps;
- namespace App1
- {
- [Activity(Label = "App1", MainLauncher = true)]
- public class MainActiity : Activity, IOnMapReadyCallback
- {
- private GoogleMap GMap;
- protected override void OnCreate(Bundle savedInstanceState)
- {
- base.OnCreate(savedInstanceState);
- // Set our view from the "main" layout resource
- SetContentView(Resource.Layout.Main);
- SetUpMap();
- }
- private void SetUpMap()
- {
- if (GMap == null)
- {
- FragmentManager.FindFragmentById<MapFragment>(Resource.Id.googlemap).GetMapAsync(this);
- }
- }
- public void OnMapReady(GoogleMap googleMap)
- {
- this.GMap = googleMap;
- }
- }
- }
Add Comment
Please, Sign In to add comment