private void marker_MouseUp(object sender, MouseButtonEventArgs e) { if (e.ChangedButton == MouseButton.Left) { FactoryMarker marker = sender as FactoryMarker; _viewModel.SelectedFactory = marker.DataContext as FactoryEVM; marker.PlayBounce(); } }
private void ZoomOnFactory(FactoryEVM factory) { if (factory.Latitude.HasValue && factory.Longitude.HasValue) { PointLatLng?point = new PointLatLng(factory.Latitude.Value, factory.Longitude.Value); if (point.HasValue) { ZoomOnPoint(point.Value, ApplicationSettings.Map.ZoomMarker); FactoryMarker marker = factoriesMapControl.Markers.Where(m => ((FactoryEVM)((FactoryMarker)m.Shape).DataContext).Id == factory.Id).Select(m => m.Shape as FactoryMarker).FirstOrDefault(); if (marker != null) { marker.PlayBounce(); } } } }
private GMapMarker CreateMarker(PointLatLng point, FactoryEVM factory, FactoryMarkerColor color) { FactoryMarker shape = new FactoryMarker() { DataContext = factory, Color = color }; GMapMarker marker = new GMapMarker(point); marker.Tag = factory; marker.Shape = shape; marker.Offset = new Point(-(shape.Rectangle.Width / 2), -shape.Rectangle.Height); factory.Latitude = point.Lat; factory.Longitude = point.Lng; return(marker); }