public MainPage() { this.InitializeComponent(); _geolocator = new Geolocator(); _locationIcon10m = new LocationIcon10m(); _locationIcon100m = new LocationIcon100m(); _currentLocationPin = new currentLocationPin(); DataContext = _vm; }
private void txtPlacesLoaded_TextChanged(object sender, TextChangedEventArgs e) { foreach (Place p in _vm.Places) { LocationIcon10m pushpin = new LocationIcon10m(); MapLayer.SetPosition(pushpin, new Location(p.Latitude, p.Longitude)); pushpin.Tapped += new TappedEventHandler(OnPushTapped); myMap.Children.Add(pushpin); } }
private void bingmap1_TextChanged(object sender, TextChangedEventArgs e) { double latitude = Convert.ToDouble(bingmap1Lat.Text); double longitude = Convert.ToDouble(bingmap1Long.Text); bingMapTop1.SetView(new Location(latitude, longitude)); //fill up big bing map foreach (Place p in _vm.Places) { //Pushpin pushpin = new Pushpin(); //MapLayer.SetPosition(pushpin, new Location(p.Latitude, p.Longitude)); //bingMap.Children.Add(pushpin); LocationIcon10m loc = new LocationIcon10m(); MapLayer.SetPosition(loc, new Location(p.Latitude, p.Longitude)); bingMap.Children.Add(loc); } }
public DetailMapPage() { this.InitializeComponent(); DataContext = _vm; this.navigationHelper = new NavigationHelper(this); this.navigationHelper.LoadState += navigationHelper_LoadState; this.navigationHelper.SaveState += navigationHelper_SaveState; _geolocator = new Geolocator(); _locationIcon10m = new LocationIcon10m(); _locationIcon100m = new LocationIcon100m(); _locationIcon = new MyLocationIcon(); _currentLocationPin = new currentLocationPin(); goToLocation(); }
private void OnPushTapped(object sender, RoutedEventArgs e) { LocationIcon10m locationPin = sender as LocationIcon10m; if (locationPin != null) { var x = MapLayer.GetPosition(locationPin); double lat = x.Latitude; // _vm.GetSpotByLatitude(lat); foreach (Place p in _vm.Places) { if (p.Latitude == x.Latitude || p.Longitude == x.Longitude) { //txtTappedPlace.Text = p.PlaceId.ToString(); ActiveUserAndSpot uas = new ActiveUserAndSpot(); uas.Place = p; uas.User = _vm.ActiveUser; Frame.Navigate(typeof(DetailSpotPage), uas); } } } }