private void SetupMap(DataItem item) { if (item.GroupType != GroupType.PersonWithMap) { myMap.Visibility = Visibility.Collapsed; return; } var locationCollection = new Bing.Maps.LocationCollection { new Bing.Maps.Location(item.PlaceOfBirthLat,item.PlaceOfBirthLong) , new Bing.Maps.Location(item.PlaceOfDeathLat,item.PlaceOfDeathLong) }; var locationRect = new Bing.Maps.LocationRect(locationCollection); var locationRect2 = new Bing.Maps.LocationRect(locationRect.Center,locationRect.Width + locationRect.Width * 0.7, locationRect.Height + locationRect.Height * 0.20); myMap.SetView(locationRect2, TimeSpan.FromSeconds(3)); AddMapPushPin(item); }
public void AddMapPushPin(DataItem item) { var pushpinBorn = new Bing.Maps.Pushpin(); pushpinBorn.Text = "1"; pushpinBorn.Background = new SolidColorBrush(Windows.UI.Colors.Blue); Bing.Maps.MapLayer.SetPosition(pushpinBorn, new Bing.Maps.Location(item.PlaceOfBirthLat, item.PlaceOfBirthLong)); myMap.Children.Add(pushpinBorn); var pushpinDeath = new Bing.Maps.Pushpin(); pushpinDeath.Text = "2"; pushpinDeath.Background = new SolidColorBrush(Windows.UI.Colors.Red); Bing.Maps.MapLayer.SetPosition(pushpinDeath, new Bing.Maps.Location(item.PlaceOfDeathLat, item.PlaceOfDeathLong)); myMap.Children.Add(pushpinDeath); }