コード例 #1
0
        public void OnLocationChanged(Location location)
        {
            var currentLocation = new GeoPoint((int)(location.Latitude * 1e6), (int)(location.Longitude * 1e6));

            _mapOverlay.Add(currentLocation, "Current Location");

            _map.Controller.AnimateTo(currentLocation);
        }
コード例 #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Map);

            _map = FindViewById<MapView>(Resource.Id.Map);
            _map.SetBuiltInZoomControls(true);

            var newYorkCity = new GeoPoint((int) (40.716667 * 1e6), (int) (-74 * 1e6));
            _map.Controller.SetCenter(newYorkCity);
            _map.Controller.SetZoom(14);

            _mapOverlay = new MapOverlay(Resources.GetDrawable(Resource.Drawable.Icon), this);
            _map.Overlays.Add(_mapOverlay);

            _mapOverlay.Add(newYorkCity, "New York City");

            _locationManager = (LocationManager)GetSystemService(LocationService);
        }
コード例 #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Map);

            _map = FindViewById <MapView>(Resource.Id.Map);
            _map.SetBuiltInZoomControls(true);

            var newYorkCity = new GeoPoint((int)(40.716667 * 1e6), (int)(-74 * 1e6));

            _map.Controller.SetCenter(newYorkCity);
            _map.Controller.SetZoom(14);

            _mapOverlay = new MapOverlay(Resources.GetDrawable(Resource.Drawable.Icon), this);
            _map.Overlays.Add(_mapOverlay);

            _mapOverlay.Add(newYorkCity, "New York City");

            _locationManager = (LocationManager)GetSystemService(LocationService);
        }