Hi Mats,

If you're getting confused about handling two units, just set them to be the same in 
your MBX.

Set Paper Units MapperInfo(wid,MAPPER_INFO_DISTUNITS)
scale = MapperInfo(wid,MAPPER_INFO_ZOOM) / WindowInfo(wid,WIN_INFO_WIDTH)
Print "Scale is 1:" + scale

Best regards / Med venlig hilsen
Lars V. Nielsen
Odense, Denmark
----- Original Message ----- 
From: Mats Elfstr�m <[EMAIL PROTECTED]>
To: MapInfo User Listing E-mail <[EMAIL PROTECTED]>
Sent: Tuesday, October 01, 2002 9:47 PM
Subject: MI-L Displaying map scale in Windows Title


> 
> Hi All!
> 
> I thought it would be a good idea to display the current scale of a mapper
> window in the window title.
> Then I would use the WinChangedHandler to rewrite the title if the user
> zooms in or out.
> But I am unable to figure out the math involved, or more precisely the way
> MI defines scale.
> 
> MB help tells me that MapperInfo(window_id,MAPPER_INFO_SCALE) will display :
> The Map window's current scale, defined in terms of the number of map
> distance units (e.g. Miles) per paper unit (e.g. Inches) displayed in the
> window. This returns a value in MapBasic's current distance units.
> 
> I've gotten so far as to get a decimal fraction value written to the title,
> but I cannot relate this number to the scale I know the map to be.
> I've set (I think) all affected Units right, i e "cm" for paper and "km" for
> map distance but the problem persists.
> Please, you MB gurus out there, provide a few lines of code to enlighten me.
> 
> Regards, Mats.E
> :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
> :Email/ [EMAIL PROTECTED]                            ICQ#9517386:
> :---------------------------------------------------------------------:
> :Mail/ GISKRAFT, Mats Elfstroem, Vaepplingv 21, SE-227 38 LUND, SWEDEN:
> :Phones: +46 46 145959, +46 70 595 3935                               :
> :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
> 
> 
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> Message number: 3342
> 
> 


Reply via email to