예제 #1
0
        private void Fürth_Click(object sender, RoutedEventArgs e)
        {
            MapService.ServiceToken = "abcdef-abcdefghijklmno";
            Bestellung4.Text        = "- Fürth \r\n";


            Geopoint seattlePoint = new Geopoint
                                        (new BasicGeoposition
            {
                Latitude  = 49.4954,
                Longitude = 10.9444
            });

            PlaceInfo spaceNeedlePlace = PlaceInfo.Create(seattlePoint);

            FrameworkElement targetElement = (FrameworkElement)sender;

            GeneralTransform generalTransform =
                targetElement.TransformToVisual((FrameworkElement)targetElement.Parent);

            Rect rectangle = generalTransform.TransformBounds(new Rect(new Point
                                                                           (targetElement.Margin.Bottom, targetElement.Margin.Bottom), targetElement.RenderSize));

            spaceNeedlePlace.Show(rectangle, Windows.UI.Popups.Placement.Below);
        }
예제 #2
0
        private void Seattle_Click(object sender, RoutedEventArgs e)
        {
            Geopoint seattlePoint = new Geopoint
                                        (new BasicGeoposition {
                Latitude = 47.6062, Longitude = -122.3321
            });

            PlaceInfo spaceNeedlePlace = PlaceInfo.Create(seattlePoint);

            FrameworkElement targetElement = (FrameworkElement)sender;

            GeneralTransform generalTransform =
                targetElement.TransformToVisual((FrameworkElement)targetElement.Parent);

            Rect rectangle = generalTransform.TransformBounds(new Rect(new Point
                                                                           (targetElement.Margin.Left, targetElement.Margin.Top), targetElement.RenderSize));

            spaceNeedlePlace.Show(rectangle, Windows.UI.Popups.Placement.Below);
        }
예제 #3
0
        /* /trazar una ruta entre dos puntos
         * private async void ShowRouteOnMap()
         * {
         *  // Start at Microsoft in Redmond, Washington.                       4.456561               -75.181589
         *  BasicGeoposition startLocation = new BasicGeoposition() { Latitude = 4.456561, Longitude = -75.181589 };
         *
         *  // End at the city of Seattle, Washington.                         4.448132              -75.179071
         *  BasicGeoposition endLocation = new BasicGeoposition() { Latitude = 4.411145, Longitude = -75.264982 };
         *
         *
         *  // Get the route between the points.
         *  MapRouteFinderResult routeResult =
         *        await MapRouteFinder.GetDrivingRouteAsync(
         *        new Geopoint(startLocation),
         *        new Geopoint(endLocation),
         *        MapRouteOptimization.Time,
         *        MapRouteRestrictions.None);
         *
         *  if (routeResult.Status == MapRouteFinderStatus.Success)
         *  {
         *      // Use the route to initialize a MapRouteView.
         *      MapRouteView viewOfRoute = new MapRouteView(routeResult.Route);
         *      viewOfRoute.RouteColor = Colors.Yellow;
         *      viewOfRoute.OutlineColor = Colors.Black;
         *
         *      // Add the new MapRouteView to the Routes collection
         *      // of the MapControl.
         *      myMap.Routes.Add(viewOfRoute);
         *
         *      // Fit the MapControl to the route.
         *      await myMap.TrySetViewBoundsAsync(
         *            routeResult.Route.BoundingBox,
         *            null,
         *            Windows.UI.Xaml.Controls.Maps.MapAnimationKind.None);
         *  }
         * } */

        //Ubicaicon de Punto / Ventana emergente a Bing Maps
        private void SpaceNeedle_Click(object sender, RoutedEventArgs e)
        {
            Geopoint spaceNeedlePoint = new Geopoint
                                            (new BasicGeoposition {
                Latitude = 4.457118, Longitude = -75.181588
            });

            PlaceInfoCreateOptions options = new PlaceInfoCreateOptions();

            options.DisplayAddress = "400 Broad St, Seattle, WA 98109";
            options.DisplayName    = "Seattle Space Needle";

            PlaceInfo spaceNeedlePlace = PlaceInfo.Create(spaceNeedlePoint, options);

            FrameworkElement targetElement = (FrameworkElement)sender;

            GeneralTransform generalTransform =
                targetElement.TransformToVisual((FrameworkElement)targetElement.Parent);

            Rect rectangle = generalTransform.TransformBounds(new Rect(new Point
                                                                           (targetElement.Margin.Left, targetElement.Margin.Top), targetElement.RenderSize));

            spaceNeedlePlace.Show(rectangle, Windows.UI.Popups.Placement.Below);
        }