How to disable zoom?

Hello.
I have questions again … I have a lot of them, but I will solve them gradually.

I need to disabled ZoomIn and ZoomOut of the map.
By default, zoom is available on the mouse wheel and keyboard Ctrl +
How can I make sure that after reaching a certain scale Map1.CurrentScale zoom could be disabled everywhere in ZoomBar and on hot keys?
I saw a similar topic, but did not quite understand … maybe there the author solved other problems.
When using ZoomBar … ZoomBarMaxZoom works correctly, but ZoomBarMinZoom is not applied. Which is also not clear.
Can you tell me something?

Sorry for the late response.

Can you show me some code how you try to disable ZoomBarMinZoom.
I’ll try to investigate if it should work or not.

About disabling zoom. Not sure how to do that.
Perhaps one of the Map events might help.

Here, the most common code:

Map1.ZoomBarMaxZoom = 14;
Map1.ZoomBarMinZoom = 12;

Nothing happens. ZoomBarMaxZoom is applied, and the value ZoomBarMinZoom remains the same.
But even if it works… it’s all the same to act only on the ZoomBar? The mouse wheel will still work, I understand? Map events I found, here is a sample code:

… OnExtentsChanged;
{
if EzMap1.CurrentScale < 1200 then
EzMap1.DISABLEZOOM = True
}

Of course DISABLE ZOOM that I just invented…

What about (and I’ve not tested this)

… OnExtentsChanged;
{
    if EzMap1.CurrentScale < 1200 then
        EzMap1.CurrentScale = 1200
}

This is a very interesting solution, but gives an error inside MapWinGIS: not enough resources to complete the operation.
The restriction works on the contrary:

… OnExtentsChanged;
{
    if EzMap1.CurrentScale > 1200 then
        EzMap1.CurrentScale = 1200
}

but the event is called every time the mouse wheel moves and the map does not behave beautifully… shivers, and shifts every time.

The short answer is that the map does not natively support this. Ideally it would be handled internally so that you don’t have the side affects of adjusting the scale AFTER it has already gone beyond your limit. We could add it as an enhancement request. Map.MinAllowedScale, Map.MaxAllowedScale

I went back and looked at some old VB6 code and I had handled it using similar code to above, but also incorporating a flag. As I’m sure you realize, by re-setting the scale in the handler, it generates another ExtentsChanged event, and you risk a looping echo affect.

I had used a flag to prevent the re-execution of the ExtentsChanged event. There was a bit more to it, so I can’t display the whole of it, but you may be able to try something like:

private boolean ResettingScale = False

… OnExtentsChanged;
{
    if not ResettingScale then
    {
        if EzMap1.CurrentScale < 1200 then
        {
            ResettingScale = True
            EzMap1.CurrentScale = 1200
        }
    }
    else
    {
        ResettingScale = False
    }
}

Thank you @jerryfaust I will try it for now.
How I can to do add it as an enhancement request in MapWinGIS?

Tasted… Works, but not as I would like. It would be good to add such functionality to MapWinGIS.

Someone will prompt me, will put this functionality limit zoom an enhancement request?

Hello again. I apologize for the delay. I had intended to respond sooner.

An enhancement request is a matter of someone creating an issue on our Atlassian page.

I have created MWGIS-193. Please feel free to review.

The implementation is just dependent upon when someone has time and opportunity to make the change.

Hello Jerry. Ok, Thank you very much.