Quantcast
Channel: MapWinGIS ActiveX Map and GIS Component
Viewing all articles
Browse latest Browse all 2341

New Post: AxMap.ZoomToSelected sometimes zooms more than needed

$
0
0
HI, most likely it's caused by AxMap.ZoomBehavior = zbUseTileLevels, which is set by default. It adjusts extents to the closest tile level. In theory it can only expand the extents, but apparently we have a bug there (those calculations are quite tricky).

To solve this you can:
a) call AxMap.ZoomOut() after zooming (optionally call AxMap.LockWindow to make it look like a single zoom);
b) set AxMap.ZoomBehavior = zbDefault and add more padding after zooming by expanding AxMap.Extents;
var ext = AxMap.Extents;
ext.GetBounds(...);
var extNew = new Extents();
extNew.SetBounds(...);   // larger extents
axMap1.Extents = extNew;
c) calculate extents of selected shapes yourself and add enough padding.

Unfortunately AxMap.ZoomToSelected doesn't use AxMap.ExtentPad property - it would be easier to handle it that way, I'll add its support in the next release.

Regards,
Sergei

Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>