MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Capturing Pushpin movement

This is a discussion on Capturing Pushpin movement within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have the same issue, but I'm working with Mappoint 2002 and VBA for MS Access 2000. In my database ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-12-2003
Junior Member
White Belt
 
Join Date: Nov 2003
Posts: 4
Capturing Pushpin movement

I have the same issue, but I'm working with Mappoint 2002 and VBA for MS Access 2000. In my database I have a frmMain which opens frmMap which has a fsubMap. I hae the following code and I'm looking to capture the LOCID of the pushpin that I just doubleclicked. I would like to pass this to an access query to update the frmMap record that the frmMap is currently displaying.

Start Sub Snipet()

If rstProps.RecordCount > 0 Then
If LoadMap() Then
FormOpen "frmMap"
Set objMap = gappmp.ActiveMap

While Not rstProps.EOF
i = i + 1
Set objLoc = objMap.GetLocation(rstProps!Latitude, rstProps!_ Longitude)
Set objPushpin = objMap.AddPushpin(objLoc, rstProps!LOCID)
objPushpin.Name = rstProps!CompanyName
objPushpin.Note = rstProps!HID
objPushpin.Symbol = 0
rstProps.MoveNext
Wend
'Show all pushpins on the map display
objMap.DataSets.ZoomTo
Else
strMsg = "Unable to load map."
MsgBox strMsg, vbOKOnly + vbExclamation, APP_NAME
End If
Else
strMsg = "No properties selected."
MsgBox strMsg, vbOKOnly + vbExclamation, APP_NAME
End If

End Sub Snipet

--------------------------------------------------------------------------------

Function LoadMap() As Boolean
On Error GoTo LoadMap_Err
Set gappmp = CreateObject("MapPoint.Application")
gappmp.Visible = False
gappmp.PaneState = geoPaneNone
ghwndMP = FindWindow(vbNullString, "Map - Microsoft MapPoint _ North America")
FlipBit ghwndMP, WS_CAPTION, False
LoadMap = True
End Function

It is at this point that the forms and map are finished loading, with the pins from the records that I pulled from the tblLocations. The frmMap's data source is tblLocations and has the four or five fields being displayed.

As I click on the map I would like to update the from record to reflect the pin that I just clicked.

-----------------------------------------------
In short I'm looking for something like:
------------------------------------------------
Onclick of objPushpin
Get LOCID
FindRecord in frmForm Where LOCID = Pushpin.LOCID
-----------------------------------------------------------------

-------------------------------------------------------------------
I saw some of the below code and modified it a little. I'm not sure where to "put it" or even if this is getting me started in the right direction.:

If I can get the LOCID into X as String I can recode to pass this to a FindRecod Method. Also objPushpin.Name = LOCID by the way.
----------------------------------------------------------------------------------
Private Sub MPC_BeforeClick(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long, Cancel As Boolean)

On Error Resume Next
Dim oResults As MapPoint.Pushpin
Dim X As String
SetParent ghwndMP, Me.hwnd <---- I'm not sure if I need this.
Set oResults = gappmp.ActiveMap.ObjectsFromPoint(X, Y)

For Each oResult In oResults
If TypeOf oResult Is Pushpin Then
X = objPushpin.Name
MsgBox (X)
End If
Next
DoEvents
End Sub
------------------------------------------------------------------------

All or any help is greatly appreciated in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
capturing, movement, pushpin


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Capturing Mouse Wheel Event Anonymous MapPoint Web Service and Virtual Earth 2 11-30-2005 08:31 AM
Capturing Pushpin movement Anonymous MapPoint 2006/2009 Discussion 6 06-09-2003 06:37 PM
Finding Pushpin Name by clicking on the Pushpin?(MP 2002) NickSP MapPoint 2006/2009 Discussion 4 01-10-2003 01:11 PM


All times are GMT -5. The time now is 03:38 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54