Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 3 of 3

Adding a PushPin from a Long/Lat position

This is a discussion on Adding a PushPin from a Long/Lat position within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi all Background: I have vehicles in the field and they report their long,lat positions to a sqlDatabase through GPRS. ...

  1. #1
    zadic is offline Junior Member White Belt
    Join Date
    Oct 2005
    Posts
    2

    Adding a PushPin from a Long/Lat position

    Hi all

    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.

    Thanx

    Z

  2. #2
    calv1ns's Avatar
    calv1ns is offline Member Green Belt
    Join Date
    Mar 2005
    Posts
    91

    AddPushPin

    Zadic

    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

    myErr:
    If Err.Number <> 0 Then
    On Error GoTo 0
    Debug.Print Err.Number, Err.Description
    Err.Clear
    wk_istat = -1
    End If
    addpushpin = wk_istat
    End Function
    Ciao,
    Calv1ns

  3. #3
    zadic is offline Junior Member White Belt
    Join Date
    Oct 2005
    Posts
    2
    Thanx it worked!!

    Zadic

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Adding custom field to a Pushpin
    By marcocim in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 06-12-2005, 05:13 PM
  2. Adding Pushpin
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 03-11-2005, 08:23 AM
  3. Adding pushpins by lat/long or address using MPC in MSAccess
    By GM in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 11-01-2004, 01:00 PM
  4. Adding custom pushpin symbol
    By M.Vrolijk in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 09-20-2004, 07:55 AM
  5. Check error with VBA before adding pushpin
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 03-24-2004, 10:36 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96