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 6 of 6

Adding Pushpin

This is a discussion on Adding Pushpin within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hello Everybody, I am new to mappoint. I have an existing VB6 application and trying to integrate mappoint with it ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Adding Pushpin

    Hello Everybody,
    I am new to mappoint. I have an existing VB6 application and trying to integrate mappoint with it so that user can have an option of viewing the structures in mappoint. So if user click on View map button, a map should popup with some pushpins on specified latitude and longitude. Each pushpin should display information regarding the structure pushpin is representing. Also I want to control the zoom option so that it dont expand beyond florida state.

    I have installed mappoint on my machine and run few simple examples from mappoint help. I would really appreciate if you can point me to some good resources.

    Thanks

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    You dont ask a question, so it is difficult to answer. Please ask what you need help for.

  3. #3
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Thanks Wilfried for responding to my post. I was just going through the sample example of mappoint uptil now and was tryign to figure out how to use it for my application. So far everything worked as supposed.

    But now I am having a doubt. What I am trying to do is plotting pushpins on north america map for different lattitude and longitude which is based on users input. the problem is if I am plotting only one pushpins everythign is working fine but when I am trying to iterate through a collection and addign the pushpins i dont know somehow its adding the pushpin in atlantic ocean but it shuld ass somewhere in florida state.

    Here is the code I am using:
    Option Explicit
    Public mColStructure As colStructures
    Dim objStruct As CStructure
    Public oMap As mappointctl.Map
    Dim objLoc As MapPoint.Location
    Dim objPin As MapPoint.Pushpin
    Dim strPushpinSetName As String
    Dim objDS As MapPoint.DataSet
    Dim objDataSet As MapPoint.DataSet
    Dim strNote As String

    Private Sub Command1_Click()
    Unload Me
    Set frmPlotStructures = Nothing
    End Sub

    Private Sub Form_Load()

    MappointControl1.NewMap (geoMapNorthAmerica)
    Set oMap = MappointControl1.ActiveMap

    'Get rid of any previous results, but not my reference pushpin.
    For Each objDataSet In oMap.DataSets
    If Not objDataSet.Name = "My Pushpins" Then
    objDataSet.Delete
    End If
    Next

    'Create a new pushpin set.
    strPushpinSetName = "test"

    oMap.DataSets.AddPushpinSet strPushpinSetName
    Set objDS = oMap.DataSets(strPushpinSetName)
    objDS.Select


    For Each objStruct In mColStructure

    'Get the location of the structure based on its latitude and longitude.
    Set objLoc = oMap.GetLocation(objStruct.Latitude, objStruct.Longitude)
    'Set objLoc = oMap.GetLocation(30.4015891666667, -83.361247777777

    'Add a Pushpin to the map at this location
    Set objPin = oMap.AddPushpin(objLoc, objStruct.ID)

    objPin.BalloonState = geoDisplayNone
    objPin.Symbol = 110
    strNote = "one" & vbCrLf & _
    "two" & vbCrLf & _
    "three" & vbCrLf & _
    "four"
    objPin.Note = strNote
    objPin.Cut
    objDS.Paste

    Next


    'Zoom to the newly created Pushpin set
    oMap.DataSets.ZoomTo
    End Sub


    I'll appreciate any kind of input.
    Thanks

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    there is no difference in adding 1 pushpin or adding one thousand of it. So you must have a problem in your code. Your listing does not give me a direct probllem but I'm not used to VB. Go carefully troiugh the debugger to find the line where the position is in the ocean..Sorry cannot give more advice...

  5. #5
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Thanks for quick reply Wilfried. I realized the latitude and longitude value in structure was null because of which it was plotting pushpins in the atlantic ocean.

    I have one more quoestion is it possible to control the zoom level i.e I dont want the map to zoo beyond florida map.

    Also I am adding information relating to each structure in the pushpins note object. Is there any way to disable the editing of that note from map.

    Thanks in advance

  6. #6
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    with these you control zoom and zoom + position:

    Code:
    MP.ActiveMap.Altitude = Alt;
    MP.ActiveMap.GotoLatLong(Lat, Lon, Alt);
    I dont think you can prevent the user to edit the note. But as always there are workarounds. In BeforeClick event you can disable popup menu from Mappoint, but of course the user cannot do mutch other. Instead you can there display your own popup menu with the functions you want. However not all functions are accesible. A workaround for this is to send keystrokes to the map. Very receint there was a post about that. I think subject was 'undocumented things' or something.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Adding a PushPin from a Long/Lat position
    By zadic in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 10-06-2005, 01:33 PM
  2. Adding a permanent Pushpin/Landmark
    By cexpjared in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-25-2005, 10:25 AM
  3. Adding custom field to a Pushpin
    By marcocim in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 06-12-2005, 05:13 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. Type Mismatch adding pushpin....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 11-22-2003, 11:53 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