private async void Mapsample_Loaded(object sender, RoutedEventArgs e) { geoLocator = new Geolocator(); geoLocator.DesiredAccuracy = PositionAccuracy.High; Geoposition pos = await geoLocator.GetGeopositionAsync(); WebView_Weather.Navigate(new Uri("http://forecast.io/embed/#lat=" + pos.Coordinate.Point.Position.Latitude.ToString() + "&lon=" + pos.Coordinate.Point.Position.Longitude.ToString() + "&name=the Job Site&color=#00aaff&font=Segoe UI&units=ca")); var center = new Geopoint(new BasicGeoposition() { Latitude = pos.Coordinate.Point.Position.Latitude, Longitude = pos.Coordinate.Point.Position.Longitude }); await SmallMap.TrySetSceneAsync(MapScene.CreateFromLocationAndRadius(center, 5000)); //Define MapIcon MapIcon myPOI = new MapIcon { Location = center, NormalizedAnchorPoint = new Point(0.5, 1.0), Title = "You", ZIndex = 0 }; //add to map and center it SmallMap.MapElements.Add(myPOI); }
private async void Mapsample_Loaded(object sender, RoutedEventArgs e) { var geoLocator = new Geolocator(); geoLocator.DesiredAccuracy = PositionAccuracy.High; Geoposition pos = await geoLocator.GetGeopositionAsync(); var center = new Geopoint(new BasicGeoposition() { Latitude = pos.Coordinate.Point.Position.Latitude, Longitude = pos.Coordinate.Point.Position.Longitude }); await SmallMap.TrySetSceneAsync(MapScene.CreateFromLocationAndRadius(center, 3000)); //Define MapIcon MapIcon myPOI = new MapIcon { Location = center, NormalizedAnchorPoint = new Point(0.5, 1.0), Title = "Qaanita", ZIndex = 0 }; // add to map and center it SmallMap.MapElements.Add(myPOI); }