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 custom pushpin symbol

This is a discussion on Adding custom pushpin symbol within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hallo, We made some extra pushpins symbols (the train symbol, but with different colors). I want to use it in ...

  1. #1
    M.Vrolijk is offline Junior Member White Belt
    Join Date
    Sep 2004
    Posts
    2

    Adding custom pushpin symbol

    Hallo,

    We made some extra pushpins symbols (the train symbol, but with different colors). I want to use it in a VB6.0 project with the Mappoint control. I already made maps on which I added pushpins in VB (see example 1), but now I want to add the self made symbols. I've put them in a folder. I really don't know how to do this. I tried a path to the location of the pushpin symbol, but doesn't seem to work (example 2).

    Can you help me?

    Thanks
    Monique Vrolijk


    Example 1
    Code:
       For j = 1 To AantalInArray
          If X(j).KlantID = klant Then
             Set L = objMapZoom.GetLocation(X(j).Latitude, X(j).Longitude)
             Set ppin = objMapZoom.AddPushpin(L, X(j).Name)
             Select Case X(j).KleurID
                Case 1
                ppin.Symbol = objMapZoom.Symbols(31)
                Case 2
                ppin.Symbol = objMapZoom.Symbols(32)
                Case 3
                ppin.Symbol = objMapZoom.Symbols(33)
                End Select
           End If
        Next j
        objMapZoom.DataSets.Item(1).ZoomTo

    Example 2
    Code:
       ppin.Symbol = "C:\Documents and Settings\moon\Mijn documenten\MapPointPushpinsNew\257.bmp"
    Regards,

    Monique Vrolijk

  2. #2
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002
    Posts
    478
    Try this code in place of your example #2

    Code:
    Dim objSymbol As MapPoint.Symbol
    'or Dim objSymbol As MapPointctl.Symbol
    
    Set objSymbol = "C:\Documents and Settings\moon\Mijn documenten\MapPointPushpinsNew\257.bmp" 
    
    ppin.Symbol = objSymbol.ID

  3. #3
    M.Vrolijk is offline Junior Member White Belt
    Join Date
    Sep 2004
    Posts
    2

    It's working now

    Hallo John,

    What you suggested didn't work, but it helped me on the way to the answer.

    I have an array (arX) filled with data, like lat-lon and indexnumber of the pushpins which come with MapPoint. I gave my custom symbols numbers above 256. If a number over 256 is encountered in the for-next statement, then a symbol is added to the Symbols collection, with the Add method.

    Thanks!
    Monique Vrolijk

    Code:
       
    Dim j As Integer
    Dim L As Location, pPin As Pushpin
    Dim objMapNL As MapPointctl.Map
    Dim RecInMatrix As Integer '# records in matrix
    Dim objSym As MapPointctl.Symbol
    Dim objSymbols As MapPointctl.Symbols
    
       Set objSymbols = objMapNL.Symbols
    
       For j = 1 To RecInMatrix
          Set L = objMapNL.GetLocation(arX(j).Lat, arX(j).Lon)
          Set pPin = objMapNL.AddPushpin(L, arX(j).KlantID & ": " & arX(j).KlantNaam & "     " & arX(j).Status)
          If arX(j).Pin > 256 Then
             Set objSym = objSymbols.Add("L:\Mappoint\PushPinsNew\" & arX(j).Pin & ".bmp")
             pPin.Symbol = objSym.ID
          Else
             pPin.Symbol = objMapNL.Symbols(arX(j).Pin)
          End If
          pPin.BalloonState = geoDisplayNone
       Next j
    Regards,

    Monique Vrolijk

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help! Import Custom Symbol Array
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 03-24-2011, 10:45 AM
  2. Adding custom field to a Pushpin
    By marcocim in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 06-12-2005, 05:13 PM
  3. Adding new symbol to map
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-16-2005, 12:27 PM
  4. Adding custom pushpins to the pushpin selection
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-28-2003, 04:28 PM
  5. programmatically load a custom symbol
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-22-2002, 05:02 PM

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