ThinkGeo.com    |     Documentation    |     Premium Support

Problem with zoom out with mousewheel locked until zoomin is used

Hi


If i set map center point and zoomtoscale, the zoom out with the mouse wheel dosen't work, until you have zoom in first. Then you

can zoom out with mousewheel.


winMap.MapControl.CenterAt(new Feature(gc.Longitude, gc.Latitude));

double scale = new ZoomLevelSet().ZoomLevel10.Scale;

winMap.MapControl.ZoomToScale(scale);


Its only a problem if i start with ZoomToScale.


 /Lars



Lars,


Thanks for your post and question.
 
I am not sure which version you are trying to use now? You can get the version information by calling the static API WinformsMap.GetVersion.
 
In latest version(3.1.299 or later), I tested against the following code, it works fine:

private void DisplayMap_Load(object sender, EventArgs e)
        {
            winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
            winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);
 
            WorldMapKitWmsDesktopOverlay worldMapKitDesktopOverlay = new WorldMapKitWmsDesktopOverlay();
            winformsMap1.Overlays.Add(worldMapKitDesktopOverlay);
 
            winformsMap1.CurrentExtent = new RectangleShape(-139.2, 92.4, 120.9, -93.2);
 
            winformsMap1.CenterAt(new Feature(-10.0,-1.2));
            double scale = new ZoomLevelSet().ZoomLevel10.Scale;
            winformsMap1.ZoomToScale(scale);
 
            winformsMap1.Refresh();
        }
 

 
Any more quesiotns just feel free to let me know.
 
Thanks.
 
Yale

Hi 

I have tried to reproduce the problem in an sample app, there is no problem with it (version 3.1.302) 

Its strange that the zoom in, in the application  works, but not zoom out, so the control have the focus. 



I get back if i manage to recreate the problem, in the test app. 



/Lars



Lars, 
  
 So do you mean the Yale’s sample code can work but yours can not. If like that, please make a small sample to reproduce this problem to us. 
 Or can you explain it more clear? 
  
 Thanks, 
 James

Hi 
  
 I try to make me self more clear :) 
  
 I have made an sample app,trying to reproduce the problem (can’t reproduce in sample app) 
  
 The control in the Production code, have the problem with not zooming out with the mouse wheel (if you start with zoom out) Zoomin works, if you after zooming in, try to zoom out the control works ok. 
  
 So button line: if start with zoom out, the control ignores the mousewheel zoom out. 
 Zoom out by context menu, wooks fine. 
  
 The difference between sample and production, is there are defined some more layer, i will try to add them also, to see if that makes the 
 difference. 
  
 /Lars

Lars, 
  
 Hope you can find which thing caused the problem. And also you can supply more information for us. 
 Such as What is your threading mode set? It is the ThreadingMode property on the Map control. Do you use TileCache for overlay? What is your ZoomLevel Snapping mode set? It is the ZoomLevelSnapping property on the Map control. 
  
 Any strange code which you think may cause the problem you can tell us which will be helpful. 
  
 Thanks 
 James