Select to view content in your preferred language

Resetting SnapToLevels=true Is Not Applied Until the Next Map Extent Zoom Change

1823
0
09-01-2011 10:12 AM
TVlasschaert
Emerging Contributor
Silverlight API 2.2 ArcGIS 10.

Just figured this one out and thought I would share it.  Not clear on how else to report it as a bug.

Our application uses SnapToLevels=true but dynamically changes this value to false when the user approaches the minimum resolution of the base map (online world street map).  This allows the user to zoom in past the minimum resolution of the base map to a resolution that makes sense for our app, but still otherwise enjoy the benefits of SnapToLevels=true.

When zoomed in maximally (SnapToLevels set to false), it is possible to use a very small shift-ctl-zoom-out-box to zoom-out to level where the code resets SnapToLevels back to true.  This change however does not take effect on the map until the next map extent zoom level change (panning doesn't do it).

Simple work around is to set the map's extent to be itself:

map.SnapToLevels = ViewModel.MapSnapToLevels;
if (map.SnapToLevels)
{
       map.Extent = map.Extent;  // This actually causes the SnapToLevels = true to be applied immediately
}

I suggest SnapToLevels should be fixed to affect the map immediately upon being reset to true.
0 Kudos
0 Replies