Hi,

I am using MapBasic from MS VisualBasic and I have problem with precision
during centering of MAP.

I have point objects in a table.
as I select any of them (with my program by an algorithm), I want to center
the map on that point.
To do this I try to use this code:
(In var "f" there is the index of point what I want to select)

'Find the point:
msg = "Find """ & f & """"
MapInfo.do msg

'Check wether object found?
msg = "CommandInfo(3) >= CMD_INFO_FIND_RC'"
r = MapInfo.Eval(msg)
If r = "T" Then
    ' yes, object was found, obtain Lat/Lon of object:
     X = MapInfo.Eval("CommandInfo(CMD_INFO_X)")
    Y = MapInfo.Eval("CommandInfo(CMD_INFO_Y)")
    'Then I center map on obtained x,y:
     msg = "Set Map Center (" & X & "," & Y & ")" + " Smart Redraw"
     MapInfo.do msg
else
    ....
    ....
This code basically works. The only problem is with the precision of X,Y !
Although point objects Lat/Lon is with 6 digits after decimal points, when I
use above code X,Y gives only 3-4 digits after decimal point. As a result of
this centering of map slightly "flickering" (depends on how big is the
differenc between the original -six digits- coordinate and obtained X,Y
value...)

E.g. original coordinate of a pont:     18.475058     47.201188
But in X,Y I got from commandinfo:   18.475         47.201

How can I get the precise value from Commandinfo ?

Any help would be highly appreciated.

Thanks
George



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 13212

Reply via email to