private void DrawMapMarker(GeoCoordinate coordinate, Color color, MapLayer mapLayer) { // Create a map marker var item = new MapItemControl(); Polygon polygon = new Polygon(); polygon.Points.Add(new Point(0, 0)); polygon.Points.Add(new Point(0, 75)); polygon.Points.Add(new Point(25, 0)); polygon.Fill = new SolidColorBrush(color); item.Image = ViewModelLocator.MainStatic.CurrentItem.Image; item.Tag = new GeoCoordinate(coordinate.Latitude, coordinate.Longitude); // Enable marker to be tapped for location information polygon.Tag = new GeoCoordinate(coordinate.Latitude, coordinate.Longitude); polygon.MouseLeftButtonUp += new MouseButtonEventHandler(Marker_Click); // Create a MapOverlay and add marker MapOverlay overlay = new MapOverlay(); overlay.Content = item; //polygon; overlay.GeoCoordinate = new GeoCoordinate(coordinate.Latitude, coordinate.Longitude); overlay.PositionOrigin = new Point(0.5, 1.0); mapLayer.Add(overlay); }
private void DrawMapMarker(GeoCoordinate coordinate, AssistsPhoto place, MapLayer mapLayer) { // Create a map marker var item = new MapItemControl(); item.Image = place.Image; item.Tag = place.ObjectId; //new GeoCoordinate(coordinate.Latitude, coordinate.Longitude); // Enable marker to be tapped for location information item.MouseLeftButtonUp += new MouseButtonEventHandler(Marker_Click); // Create a MapOverlay and add marker MapOverlay overlay = new MapOverlay(); overlay.Content = item; //polygon; overlay.GeoCoordinate = new GeoCoordinate(coordinate.Latitude, coordinate.Longitude); overlay.PositionOrigin = new System.Windows.Point(0.5, 1.0); mapLayer.Add(overlay); }