public static void SetStationPin(Location location, Map map, Station station = null) { Image image = new Image(); image.Source = new BitmapImage(new Uri("ms-appx:/Assets/pushpin.gif")); image.Width = 24; image.Height = 32; image.Tag = station; if (station != null) { ToolTip stationTooltip = new ToolTip(); stationTooltip.Content = station.ToString(); ToolTipService.SetToolTip(image, stationTooltip); } MapLayer.SetPosition(image, location); MapLayer.SetPositionAnchor(image, new Windows.Foundation.Point(12, 32)); map.Children.Add(image); }
private string GetSerializedStationModel() { List<Station> stations = new List<Station>(); foreach (var station in this.NearestStations) { Station currentStation = new Station() { StationId = station.StationId, Name = station.Name, Longitude = station.Longitude, Latitude = station.Latitude, FreeBikes = station.FreeBikes, FreeDocks = station.FreeDocks }; stations.Add(currentStation); } return JsonConvert.SerializeObject(stations.AsEnumerable()); }