Esempio n. 1
0
 public App()
 {
     Current.DispatcherUnhandledException       += App_DispatcherUnhandledException;
     AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
     ThreadPool.QueueUserWorkItem((object state) =>
     {
         //WebMap.HttpGet("http://api.ipstack.com/check?access_key=c4358b1d5570b8a0fdc733e18c1045c6");
         WebAPIUtil.HttpGet("https://api.ipgeolocation.io/ipgeo?apiKey=01d110a5e710445b91306d8d3345657e");
     }, null);
     // Set this code once in App.xaml.cs or application startup
     SciChart.Charting.Visuals.SciChartSurface.SetRuntimeLicenseKey("//iyHPm7S5TmIROHMtSNDZ3aPNDr3ZKdPpDX7i3s5lNmnDFsA+g0fWBQgJLGrD6eUHBTjFul/uBiRmySEo3pH/RP3e81GiQpdqO1GG6+KjtAmPjTKvAa+ULLjfgxxIar19BQfpoNRgxtE0njKqr6w4+PFCg0zEaybGNq+w91eL/9bVo+9tYkSMdG00F/uSvuKpAGirLBj5f7PwDsvdpPrvWATZDzeQV4hZf01lEvecN2iXIlbvh4mmR6JMvodGmDhNveDrIQHXYSl+reIn1L0GIKkH6/63UXvioV5MS8Ir18mW4lLQAtQ+gdRrTgOd6UeppX4/+s/oqVzhGJgQd6nSnxr72dfr/1epVKyr5+omPsn1u8i6wNFFtRWuev0oSLpqwH4Q6um5QcH+2wXEF+bYMeb9rIJ2/Wgm2FNzjeWnN3Ale98QQpnvaQpWcaqi9VqCF/CQXkI14HCBYQktAQ/7+OjQTRSLlao6N3TUCN9SP/y6IDi7UPIBC0XC1/MrZdMTo1TZFFIp44BI70N08qTl63syK9r3/mn/2NBbbh5dv3HZ6TmJDKjiFywJVUt1Zj6hQqf/kQMSFmkfznNDrmT8WuPrbReqdzmb4hIk+/A04RpzhqL9mSxejdZrhQqhG66XT9BQ==");
 }
Esempio n. 2
0
 public WebMap()
 {
     InitializeComponent();
     ThreadPool.QueueUserWorkItem((object state) =>
     {
         //var res = HttpGet("http://api.ipstack.com/check?access_key=c4358b1d5570b8a0fdc733e18c1045c6");
         //Format.IpStackApi location = JsonConvert.DeserializeObject<Format.IpStackApi>(res);
         var res = WebAPIUtil.HttpGet("https://api.ipgeolocation.io/ipgeo?apiKey=01d110a5e710445b91306d8d3345657e");
         if (res == null)
         {
             return;              //Stop if GET method catched an excption
         }
         Format.IpgeoLocationApi location = JsonConvert.DeserializeObject <Format.IpgeoLocationApi>(res);
         Application.Current.Dispatcher.Invoke(() => //Use invoke to refresh UI elements
         {
             if (myMap.ZoomLevel < 7)
             {
                 myMap.Center    = new Location(location.latitude, location.longitude);
                 myMap.ZoomLevel = 13;
             }
         });
     }, null);
 }