[Bug] Scale not updated when zooming to an object outside of the visible extent

2708
3
05-07-2014 04:47 AM
Labels (1)
BjørnarSundsbø
Occasional Contributor
Hi,

I have discovered a minor bug where the Scale property does not update (PropertyChanged) when using the ZoomTo(Geometry) method. The object I am zooming to must be outside the visible extent for this to occur. I am using Runtime SDK 10.2.2. The scale only recovers after zooming in or out. Panning does not update the Scale property

Here is some code to reproduce. The map itself is not included. For the logic to work, the map must be in UTM (or some other reference system that represents a coordinate in meters). Or the logic around the extent to zoom to must be changed.


<Button DockPanel.Dock="Left" Padding="8" Content="Zoom to" Click="Button_Click"/>


<TextBlock HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="20" Text="{Binding Path=Scale, StringFormat='{}{0:n}', ElementName=PART_Map}" FontSize="16" />


private void Button_Click(object sender, RoutedEventArgs e)
{
    var random = new Random();
    Point point = new Point(random.Next(0, (int) PART_Map.ActualWidth), random.Next(0, (int) PART_Map.ActualHeight));
    point.X -= 10000;
    point.Y -= 10000;
    var mapPoint = PART_Map.ScreenToMap(point);
    var extent = new Envelope(mapPoint, new MapPoint { X = mapPoint.X + 1000, Y = mapPoint.Y + 1000});
    PART_Map.ZoomTo(extent);
}


Zoom the map all the way in, and click the button. This should calculate a random envelope a bit outside of the visible extent. The scale does not update. Zoom either in or out and see the scale does not reflect the actual scale. Zooming to a point inside the visible extent does update the scale

As a side note, is there somewhere else I should post any bugs I find, rather than the forums?
0 Kudos
3 Replies
BjørnarSundsbø
Occasional Contributor

Is this something that might be fixed in the next release?

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

Thank you very much for reporting this. I will enter an issue for further investigation and we will review whether it is possible to address this in the next release.

Cheers

Mike

0 Kudos
BjørnarSundsbø
Occasional Contributor

Excellent

0 Kudos