Restricting Zooming to Avoid Blank Spaces

Topics: General
Nov 12, 2010 at 7:28 AM

I think somebody already raised the issue that the map is not continuous, that is, you can drag it or zoom out in a way that you can see blank spaces around the map or on one or several of its side/s. I tried to address this issue not by creating continuos map (I am not fit for this humanuous task) but by trying to limit zoom out. Well, I failed... If anybody has any idea how to acieve it? I do have this in my form that host GMapControl:

        private void MapZoomMinusBtn_Click(object sender, EventArgs e)
        {
            m_PrevZoom = MainMap.Zoom;
            m_tPrevOp = tMAPOP.tZoom;

            MainMap.Zoom -= 1;
            System.Windows.Forms.Application.DoEvents();
            MapZoomSlider.Refresh();
        }

which is an event handler of a "minus" (zoom out) button. It seems like the most appropriate place to restrict zoom out before I decrease the value by 1. When I keep zooming out the map shrinks in a way that its left edge separates from the left edge 
of the frame... I am not sure if this is the map becomes smaller than the hosting GMapControl or GMapControl becomes smaller that hosting pane (BTW the pane has dock=Full and so does GMapControl, so I suspect that it is a drwaing of the map within the 
control shrinks to be smaller than the control itself...). So before I decrease zoom value I need somehow to calculate if the next zoom will create a gap and bail from the event handler if it does. Alternatively, I need to move the map so its topleft corner
will align with topleft corner of the GMapControl or (or my form which is equivalent in this case). Any ideas?