private void OnMouseWheel(object sender, MouseWheelEventArgs e) { mapJustZoomed = true; double currentValue = MapBorder.GetScaleTransform().ScaleX; MapZoomSlider.Value += (currentValue - lastMapScalingValue) / 0.2; lastMapZoomSliderValue = MapZoomSlider.Value; lastMapScalingValue = currentValue; }
private Thickness GetMapLocationAsMargin(Pin pin, double width, double height) { double scalingFactor = (MapImage.ActualWidth / (MapImage.Source as BitmapSource).PixelWidth) * MapBorder.GetScaleTransform().ScaleX; double translationX = MapBorder.GetTranslateTransform().X; double translationY = MapBorder.GetTranslateTransform().Y; Thickness thickness = new Thickness( (pin.xDistance * scalingFactor + translationX) - (width / 2), (pin.yDistance * scalingFactor + translationY) - (height / 2), 0, 0); return(thickness); }
private void UpdateSearchAreaCircle() { if (IsLoaded) { if (currentBasePin != null && AddressTextBox.Text != "" && !SavedListingsButton.FilterActive) { SearchAreaCircle.Width = oneKmCircleSize * int.Parse(Filters.FilterDict["AddressProx"].ToString()) * (MapImage.ActualWidth / (MapImage.Source as BitmapSource).PixelWidth) * MapBorder.GetScaleTransform().ScaleX; SearchAreaCircle.Height = SearchAreaCircle.Width; SearchAreaCircle.Margin = GetMapLocationAsMargin(currentBasePin, SearchAreaCircle.Width, SearchAreaCircle.Height); SearchAreaCircle.Visibility = Visibility.Visible; } else { SearchAreaCircle.Visibility = Visibility.Hidden; } } }