ZOOMTO.SML

  Download

More scripts: Display Toolbar

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
numeric widthmeters, heightmeters, mindim, newdim, newscale;
if (NumberTokens(MenuChoice$," ") == 1) {
	ViewSetMapScale(View,StrToNum(MenuChoice$));
	}
else if (NumberTokens(MenuChoice$," ") == 2) {
	widthmeters = View.PixelSizeMillimeters * View.Width / 1000;
	heightmeters = View.PixelSizeMillimeters * View.Height / 1000;
	if (widthmeters < heightmeters) {
		mindim = widthmeters;
		}
	else {
		mindim = heightmeters;
		}
	newdim = StrToNum(GetToken(MenuChoice$," ",1)) * GetUnitConvDist("miles","meters");
	newscale = newdim / mindim * 1.1;
	ViewSetMapScale(View,newscale);
	}