Tim -
Integrated Mapping works by sending command into MapInfo. The simplest means
of receiving information back (other than using EVAL, which is not
appropriate in this case) using a series of standard public subroutines on
your callback object to receive messages from MapInfo - messages you can
then interpret. There aren't very many of these subroutines defined - sadly!
- but you can make them do a fair amount.
I'm copying in a simple example of how you get the cursor location. See the
MapBasic User Guide for a full discussion (OR get some of the sample
projects off the MI site and dig around in the code). You then pass out the
bit of the message you are interested in (in this case as events but you
could update the form directly) to your form for display to the user.
You also need to tell MapInfo to display the cursor location rather than
zoom or scale - if you want these too (as you probably will) you can
retrieve them using MapperInfo calls - again, check the guide or samples.
HTH
Set the display to show the cursor something like this:
moMap.do "Set map window frontwindow() display position"
And heres the cursor location routine - with (mostly) original MI Sample
header!
Public Sub SetStatusText(ByVal strstatusText As String)
'---------------------------------------------------------------------------
--------
'Name: SetStatusText
'Purpose: Standard public method for integrated mapping
' This is a standard method that MapInfo looks for in its
Callback
' object. If MapInfo finds this method in the Callback object,
it
' will get called automatically every time the text in
MapInfo's
' status bar text changes. The string passed in is a
tab-delimited
' string containing each of the status bar "Fields", i.e. -
the
' first field is the zoom, scale, or cursor location, the
second field
' is the editable layer, etc.
'Parameters: In - String - strStatusText is generated by MapInfo
'---------------------------------------------------------------------------
--------
Dim sScene As String
On Error GoTo lblerror
sScene = "Received message " & strstatusText
If Not mBooStartup Then
RaiseEvent StatusText(strstatusText)
End If
Exit Sub
lblerror:
Debug.Print "SetStatusText: " & sScene
End Sub
Paul Crisp
Syntegra
Direct: 0191 461 4522
Mobile: 0776 414 3762
Fax: (0191) 461 1959
Innovation Place Metro Riverside Park
Delta Bank Road Gateshead Tyne & Wear NE11 9DJ
-----Original Message-----
From: Fast, Tim [mailto:[EMAIL PROTECTED]]
Sent: 08 March 2002 19:55
To: MapInfo-L (E-mail)
Subject: MI-L Cursor Coordinate Display with Integrated Mapping
Listers,
I am trying to create a status bar display in Visual Basic that will show
the cursor's position (Lat./Long.) as it moves over a map window in
Integrated Mapping. Has anyone been able to do this? I know in MapX it is
fairly simple using the ConvertCoord method, but MapBasic seems to be
lacking this ability. If it involves using Windows API, I would appreciate a
code sample as I am not too familiar with accessing the API.
Thanks,
Tim Fast
Pioneer Hi-Bred International, Inc.
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.
********************************************************************
This email may contain information which is privileged or confidential. If you are not
the intended recipient of this email, please notify the sender immediately and delete
it without reading, copying, storing, forwarding or disclosing its contents to any
other person
Thank you
Check us out at http://www.syntegra.com
********************************************************************
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.