void OpenStreetView(UIAlertAction action)
        {
            var panoramaService = new PanoramaService();
            var location        = new CoreLocation.CLLocationCoordinate2D(viewModel.Place.Geometry.Location.Latitude,
                                                                          viewModel.Place.Geometry.Location.Longitude);

            panoramaService.RequestPanorama(location, PanoramaRequestCallback);
        }
Exemple #2
0
        void SetMapToCoordinate(CoreLocation.CLLocationCoordinate2D coordinate)
        {
            var currentSpan = new MapKit.MKCoordinateSpan(0.05, 0.05);
            var region      = new MapKit.MKCoordinateRegion(coordinate, currentSpan);

            var newCenterPoint = MapKit.MKMapPoint.FromCoordinate(coordinate);

            CoffeeMap.SetVisible(new MapKit.MKMapRect(newCenterPoint.X, newCenterPoint.Y, currentSpan.LatitudeDelta, currentSpan.LongitudeDelta));
            CoffeeMap.SetRegion(region);
        }
Exemple #3
0
        public override void WillActivate()
        {
            base.WillActivate();

            var coords = new CoreLocation.CLLocationCoordinate2D(latitude, longitude);

            SetMapToCoordinate(coords);

            this.CoffeeMap.AddAnnotation(
                coords,
                WatchKit.WKInterfaceMapPinColor.Purple);
        }
        public override void WillActivate()
        {
            base.WillActivate ();

            var coords = new CoreLocation.CLLocationCoordinate2D (latitude, longitude);

            SetMapToCoordinate (coords);

            this.CoffeeMap.AddAnnotation (
                coords,
                WatchKit.WKInterfaceMapPinColor.Purple);
        }
Exemple #5
0
        /// <summary>
        /// Adds a polyline path based on helicopter destination and current position
        /// </summary>
        /// <param name="heliPin"></param>
        private void addFlightPath(CustomPin heliPin)
        {
            CoreLocation.CLLocationCoordinate2D[] cLLocationCoordinate2Ds = new CoreLocation.CLLocationCoordinate2D[2];
            cLLocationCoordinate2Ds[0] = new CoreLocation.CLLocationCoordinate2D(heliPin.Position.Latitude, heliPin.Position.Longitude);
            cLLocationCoordinate2Ds[1] = new CoreLocation.CLLocationCoordinate2D(heliPin.HelicopterDetails.destinationPosition.Latitude,
                                                                                 heliPin.HelicopterDetails.destinationPosition.Longitude);

            var currentFlightPathOptions = MKPolyline.FromCoordinates(cLLocationCoordinate2Ds);

            nativeMap.AddOverlay(currentFlightPathOptions);

            highlightedFlightPath = new Tuple <CustomPin, MKPolyline>(heliPin, currentFlightPathOptions);
        }
Exemple #6
0
        private void prepareMap()
        {
            var markLocation     = new CoreLocation.CLLocationCoordinate2D(ViewMark.Latitude, ViewMark.Longitude);
            var coordinateSpan   = new MKCoordinateSpan(0.01, 0.01);
            var coordinateRegion = new MKCoordinateRegion(markLocation, coordinateSpan);

            mapView.SetRegion(coordinateRegion, false);
            var pin = new MKPointAnnotation()
            {
                Title      = ViewMark.Message,
                Coordinate = markLocation
            };

            mapView.AddAnnotation(pin);
        }
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            selected = options[indexPath.Row];

            CoreLocation.CLLocationCoordinate2D selectedLoc = new CoreLocation.CLLocationCoordinate2D(selected.location.Latitude, selected.location.Longitude);
            mapView.SetRegion(new MapKit.MKCoordinateRegion(selectedLoc, new MapKit.MKCoordinateSpan(30, 30)), true);

            foreach (var annotation in mapView.Annotations)
            {
                if (selected.location.Latitude == annotation.Coordinate.Latitude && selected.location.Longitude == annotation.Coordinate.Longitude)
                {
                    mapView.SelectAnnotation(annotation, true);
                }
            }


            //NSSet annotations= mapView.GetAnnotations(new MapKit.MKMapRect(new MapKit.MKMapPoint(selectedLoc.Latitude,selectedLoc.Longitude), new MapKit.MKMapSize(10,10)));
        }
        public void ShowCoffee(CoffeeShop coffee)
        {
            var coord = new CoreLocation.CLLocationCoordinate2D(
                coffee.Coordinates.Latitude,
                coffee.Coordinates.Longitude
                );
            var annotation = new MKPointAnnotation {
                Title      = coffee.Name,
                Coordinate = coord
            };

            this.map.AddAnnotation(annotation);
            this.map.ShowAnnotations(new IMKAnnotation[] { annotation }, true);
            this.map.SelectAnnotation(annotation, true);

            var span = new MKCoordinateSpan(.01f, .01f);

            map.Region = new MKCoordinateRegion(coord, span);
        }
		void OpenStreetView (UIAlertAction action)
		{
			var panoramaService = new PanoramaService ();
			var location = new CoreLocation.CLLocationCoordinate2D (viewModel.Place.Geometry.Location.Latitude,
				viewModel.Place.Geometry.Location.Longitude);
			panoramaService.RequestPanorama (location, PanoramaRequestCallback);
		}