Select to view content in your preferred language

Enabling Draw resets map extent

1172
1
06-21-2011 07:24 AM
KevinKing
Emerging Contributor
Hello,

I have added a Draw object to my map, but am having issues with the extent being reset when enabling draw mode. "Drawer" is my map Draw object.

I have a checkbox that is tied to this event:

        private void chkDrawmode_Checked(object sender, RoutedEventArgs e)
        {
            if ((bool)chkDrawmode.IsChecked)
            {
                Drawer.IsEnabled = true;
            }
            else
            {
                Drawer.IsEnabled = false;
                selectionLayer.Graphics.Clear();
            }
        }


The initial extent is set in the markup as:

<esri:Map.Extent >
      <esriGeometry:Envelope XMin="-96.96" YMin="40.53" XMax="-96.38" YMax="41.11"/>
</esri:Map.Extent>


If I zoom into an area of the map I'm interested in, then check the chkDraw checkbox, it resets to the original map extent (not where I had zoomed into).

Is there a way to block this behavior, or perhaps have I set up my initial extent incorrectly?

Thanks for the help,

Kevin
0 Kudos
1 Reply
KevinKing
Emerging Contributor
Bump.....

Thanks,
Kevin
0 Kudos