Hi,
I linked a DB (using a UDL) to a dataset.
But I need to change the Lat,lon data on my database when the user move the pushpin.
Is this possible?
Thanks in advance!
This is a discussion on Capture the Pushpin move event within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, I linked a DB (using a UDL) to a dataset. But I need to change the Lat,lon data on ...
Hi,
I linked a DB (using a UDL) to a dataset.
But I need to change the Lat,lon data on my database when the user move the pushpin.
Is this possible?
Thanks in advance!
Maybe. Depends on how you want it to work. You could try using the mouse events. Somehting like the following untested code:
Dim WithEvents mpObj As New MapPoint.Map
Dim objLoc As MapPoint.Location
Dim objPin As MapPoint.Pushpin
Private Sub mpObj_MouseDown(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)
If TypeOf mpObj.Selection Is MapPoint.Pushpin Then
Set objPin = mpObj.Selection
Set objLoc = objPin.Location
Else
Set objPin = Nothing
Set objLoc = Nothing
End If
End Sub
Private Sub mpObj_MouseUp(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)
If objPin Is mpObj.Selection Then
' It's the same pushpin
If 0 <> objPin.Location.DistanceTo(objLoc) Then
'It's moved do something
End If
End If
Set objPin = Nothing
Set objLoc = Nothing
End Sub
Note the location object don't have identiy, but pushpin objects do. A location is really just an object that represents a number (e.g. Lat/Long). A pushpin is an actual object on a map, so "objPin is mpObj.Selection" works while "objPin.Location is objLoc" does not.
There are currently 1 users browsing this thread. (0 members and 1 guests)