private void ShowFlag(MapCoord coord, Uri imageUri, bool target) { if (_informationLayer == null) { throw new NullReferenceException("Map not already created!"); } var hotSpot = new HotSpot(); if (target) { hotSpot.X = 0.15; hotSpot.Y = 0.85; } else { hotSpot.X = 0.22; hotSpot.Y = 0.9; } var reprojCoord = coord.ToGeographic(); var mapPinPoint = new MapPinPoint { ImageSource = new BitmapImage(imageUri) }; MapLayer.SetHotSpot(mapPinPoint, hotSpot); MapLayer.SetLocation(mapPinPoint, new Location(reprojCoord.Latitude, reprojCoord.Longitude)); _informationLayer.Items.Add(mapPinPoint); }
private void BuildPoints(MapPolyline polyline) { for (int i = 0; i < polyline.Points.Count; i++) { MapPinPoint pinPoint = new MapPinPoint(); pinPoint.ImageSource = new BitmapImage(new Uri(@"/Resources/point_small.png", UriKind.RelativeOrAbsolute)); MapLayer.SetLocation(pinPoint, polyline.Points[i]); this.pointLayer.Items.Add(pinPoint); this.AttachMouseEvents(pinPoint); } }
private void SetUpPinPoints() { // add MapPinPoint at city location for (int i = 0; i < cityLocations.Length; i++) { MapPinPoint cityPinPoint = new MapPinPoint(); cityPinPoint.IsHitTestVisible = false; MapLayer.SetHotSpot(cityPinPoint, new Controls.HotSpot() { X = 0.5, Y = 0.5 }); cityPinPoint.ImageSource = new BitmapImage(new Uri("/Map;component/Resources/placemark_circle.png", UriKind.Relative)); MapLayer.SetLocation(cityPinPoint, cityLocations[i]); this.VisualizationLayer.Items.Add(cityPinPoint); } }
private void AttachMouseEvents(MapPinPoint pinPoint) { pinPoint.MouseLeftButtonDown += new MouseButtonEventHandler(pinPoint_MouseLeftButtonDown); pinPoint.MouseLeftButtonUp += new MouseButtonEventHandler(pinPoint_MouseLeftButtonUp); pinPoint.MouseMove += new MouseEventHandler(pinPoint_MouseMove); }
private void ShowFlag(MapCoord coord, Uri imageUri, bool target) { if (_informationLayer == null) { throw new NullReferenceException("Map not already created!"); } var hotSpot = new HotSpot(); if (target) { hotSpot.X = 0.15; hotSpot.Y = 0.85; } else { hotSpot.X = 0.22; hotSpot.Y = 0.9; } var reprojCoord = coord.ToGeographic(); var mapPinPoint = new MapPinPoint {ImageSource = new BitmapImage(imageUri)}; MapLayer.SetHotSpot(mapPinPoint, hotSpot); MapLayer.SetLocation(mapPinPoint, new Location(reprojCoord.Latitude, reprojCoord.Longitude)); _informationLayer.Items.Add(mapPinPoint); }