View Full Version : Adding a PushPin from a Long/Lat position
10-03-2005, 02:43 AM
Background: I have vehicles in the field and they report their long,lat positions to a sqlDatabase through GPRS.
What I want to know is how do I use this long/lat positions to add a pushpin or any type of shape onto my map?
Im not using the webservice put the MappointControl object with a VB form.
10-05-2005, 11:58 AM
Here is a VB6 Funciton that will do what you want:
Public Function addpushpin(wk_lat As Double, wk_long As Double, wk_type As Integer, wk_name As String) As Integer
Dim this_loc As MapPoint.Location
Dim this_pin As MapPoint.Pushpin
'note myobj is a global definded as Dim myobj as MapPoint.Map
'Function: addpushpin returns +1 on success -1 on failure
myapp.Visible = True
On Error GoTo myErr:
wk_istat = 1
Set this_loc = myobj.GetLocation(wk_lat, wk_long, 0)
Set this_pin = myobj.addpushpin(this_loc, wk_name)
this_pin.Symbol = wk_type
If Err.Number <> 0 Then
On Error GoTo 0
Debug.Print Err.Number, Err.Description
wk_istat = -1
addpushpin = wk_istat
10-06-2005, 12:33 PM
Thanx it worked!!
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO