2016-05-10 11 views
0

Hallo im Blick, das eine Karte in einer Universal-Windows-Plattform ich das fellowing tat zu machen versucht:Geolokalisierung arbeitet nicht auf einem Desktop-Emulator (UWP)

   using System; 
      using System.Collections.Generic; 
      using System.IO; 
      using System.Linq; 
      using System.Runtime.InteropServices.WindowsRuntime; 
      using Windows.Foundation; 
      using Windows.Foundation.Collections; 
      using Windows.UI.Xaml; 
      using Windows.UI.Xaml.Controls; 
      using Windows.UI.Xaml.Controls.Primitives; 
      using Windows.UI.Xaml.Data; 
      using Windows.UI.Xaml.Input; 
      using Windows.UI.Xaml.Media; 
      using Windows.UI.Xaml.Navigation; 
      using Windows.Devices.Geolocation; 


    namespace Project 
     { 
      /// <summary> 
    /// An empty page that can be used on its own or navigated to within a      Frame. 
/// </summary> 
public sealed partial class Geolocation : Page 
{ 
    public Geolocation() 
    { 
     this.InitializeComponent(); 
    } 
    public async void GetCords() 
    { 
     Geolocator locator = new Geolocator(); 
     Geoposition pos = await locator.GetGeopositionAsync(); 
     await new Windows.UI.Popups.MessageDialog(pos.CivicAddress.City).ShowAsync(); 
     } 
    } 
} 

, aber ich habe eine leere Seite! Was fehlt mir hier?

Antwort

1

Wenn Sie eine MapControl in Ihrer Seite hinzufügen möchten, müssen Sie:

  1. Create a key für Ihre Karte
  2. xmlns:maps="using:Windows.UI.Xaml.Controls.Maps <maps:MapControl
  3. <maps:MapControl x:Name="map" MapServiceToken="YOUR_TOKEN_HERE" />
+0

u mich gerettet Kopfschmerzen oder 2! Vielen Dank, es funktioniert perfekt –