Exemplo n.º 1
0
        private async void button1_Click(object sender, RoutedEventArgs e)
        {
            if (MapControl1.Is3DSupported)
            {
                MapControl1.Style = MapStyle.Aerial3D;
                BasicGeoposition hwGeoposition = new BasicGeoposition()
                {
                    Latitude = 48.858, Longitude = 2.295
                };
                Geopoint hwPoint = new Geopoint(hwGeoposition);


                MapScene hwScene = MapScene.CreateFromLocationAndRadius(hwPoint, 80, 0, 60);


                await MapControl1.TrySetSceneAsync(hwScene, MapAnimationKind.Bow);
            }
            else
            {
                ContentDialog viewNotSupportedDialog = new ContentDialog()
                {
                    Title             = "3D is not supported",
                    Content           = "\n3D views are not supported on this device.",
                    PrimaryButtonText = "OK"
                };
                await viewNotSupportedDialog.ShowAsync();
            }
        }
Exemplo n.º 2
0
        private async void display3DLocation()
        {
            BasicGeoposition cityPosition = new BasicGeoposition()
            {
                Latitude = 55.6509863734914, Longitude = 37.6680877307923, Altitude = 10
            };

            SeattleLocation1 = new Geopoint(cityPosition);
            Geopoint cityCenter = new Geopoint(cityPosition);

            if (MapControl1.Is3DSupported)
            {
                // Set the aerial 3D view.
                MapControl1.Style = MapStyle.Terrain;

                // Specify the location.
                BasicGeoposition hwGeoposition = new BasicGeoposition()
                {
                    Latitude = cityCenter.Position.Latitude, Longitude = cityCenter.Position.Longitude, Altitude = cityCenter.Position.Altitude
                };
                Geopoint hwPoint = new Geopoint(hwGeoposition);

                // Create the map scene.
                MapScene hwScene = MapScene.CreateFromLocationAndRadius(hwPoint,
                                                                        80,             /* show this many meters around */
                                                                        0,              /* looking at it to the North*/
                                                                        60 /* degrees pitch */);
                // Set the 3D view with animation.
                await MapControl1.TrySetSceneAsync(hwScene, MapAnimationKind.Bow);
            }
            else
            {
                // If 3D views are not supported, display dialog.
                ContentDialog viewNotSupportedDialog = new ContentDialog()
                {
                    Title             = "3D is not supported",
                    Content           = "\n3D views are not supported on this device.",
                    PrimaryButtonText = "OK"
                };
                await viewNotSupportedDialog.ShowAsync();
            }
        }