protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            // Get a reference to the sensor manager
            sensor_manager = (SensorManager) GetSystemService (Context.SensorService);

            // Create our view
            var map_view = new MapView (this, "MapViewCompassDemo_DummyAPIKey");

            rotate_view = new RotateView (this);
            rotate_view.AddView (map_view);

            SetContentView (rotate_view);

            // Create the location overlay
            location_overlay = new MyLocationOverlay (this, map_view);
            location_overlay.RunOnFirstFix (delegate {
                map_view.Controller.AnimateTo (location_overlay.MyLocation);
            });
            map_view.Overlays.Add (location_overlay);

            map_view.Controller.SetZoom(18);
            map_view.Clickable = true;
            map_view.Enabled = true;
        }
Beispiel #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Get a reference to the sensor manager
            sensor_manager = (SensorManager)GetSystemService(Context.SensorService);

            // Create our view
            var map_view = new MapView(this, "MapViewCompassDemo_DummyAPIKey");

            rotate_view = new RotateView(this);
            rotate_view.AddView(map_view);

            SetContentView(rotate_view);

            // Create the location overlay
            location_overlay = new MyLocationOverlay(this, map_view);
            location_overlay.RunOnFirstFix(delegate {
                map_view.Controller.AnimateTo(location_overlay.MyLocation);
            });
            map_view.Overlays.Add(location_overlay);

            map_view.Controller.SetZoom(18);
            map_view.Clickable = true;
            map_view.Enabled   = true;
        }