private void VEPushPin_Click(object sender, VEPushPinClickedEventArgs e) { VEPushPin pin = sender as VEPushPin; if (pin == null) { return; } map.FlyTo(pin.LatLong, -90, 0, 300, null); }
void addPushPin(PacketInfo packetInfo) { var latLong = new VELatLong( packetInfo.Latitude.Value, packetInfo.Longitude.Value); var pushPin = new VEPushPin(latLong); map.Items.Add(pushPin); }
private void SurfacePushPin_Click(object sender, VEPushPinClickedEventArgs e) { VEPushPin pin = sender as VEPushPin; map.FlyTo(pin.LatLong, -90, 0, 300, null); }
private void SetUpMap() { //Create the VE Map //map = new VEMap //{ // Width = 800, // Height = 800, // Margin = new Thickness(5), // VerticalAlignment = VerticalAlignment.Top, // HorizontalAlignment = System.Windows.HorizontalAlignment.Center, // MapStyle = VEMapStyle.Hybrid, // LatLong = new Point(38.9444195081574, -77.0630161230201), // Clip = new EllipseGeometry // { // RadiusX = 400, // RadiusY = 400, // Center = new Point(400, 400) // } //}; //Ceeate a default pin location (my house) var newPin = new VEPushPin(new VELatLong(50.826958333333337, -0.16388055555555556)); newPin.SetResourceReference(VEPushPin.StyleProperty, "PushPinStyle"); newPin.Content = new Label { Content = "Waiting", HorizontalAlignment = HorizontalAlignment.Center, FontSize = 20 }; newPin.Click += VEPushPin_Click; Map.Items.Add(newPin); ////I do not like doing this with indexes that may change, but ////I had no choice as I wanted map to be exactly 4th child, and ////when setting up map in XAML it would sometimes loose intellisense //mainGrid.Children.Insert(4, map); }
void NewPinMouseDown(object sender, MouseButtonEventArgs e) { _currentPin = sender as VEPushPin; _pinTouched = true; }
void GlobeControl_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { var point = e.Location; foreach (var item in Map.Items.OfType<VEPushPin>()) { if (item.IsMouseDirectlyOver) { _currentPin = item; break; } } }
private void CreateMarker(VELatLong currentLocation, string pushpinstyle) { var newPin = new VEPushPin(currentLocation); newPin.Style = (Style)FindResource(pushpinstyle); newPin.Content = new Label { Content = new Border() { Width = 40, Height = 40, Background = new ImageBrush(new BitmapImage(new Uri(@"blueMarker.png", UriKind.Relative))) }, HorizontalAlignment = HorizontalAlignment.Center, FontSize = 20 }; //newPin.Click += VEPushPin_Click; newPin.PreviewMouseDown += newPin_PreviewMouseDown; newPin.MouseMove += newPin_MouseMove; //newPin.PreviewMouseUp += NewPinMouseUp; //newPin.PreviewMouseMove += NewPinMouseMove; Map.Items.Add(newPin); }