MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Adding custom pushpin symbol

This is a discussion on Adding custom pushpin symbol within the MapPoint 2006/2009 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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-17-2004
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 09-17-2004
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
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
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 09-20-2004
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
adding, custom, pushpin, symbol


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Adding custom field to a Pushpin marcocim MapPoint 2006/2009 Discussion 1 06-12-2005 04:13 PM
Adding new symbol to map Anonymous MapPoint 2006/2009 Discussion 1 03-16-2005 11:27 AM
Help! Import Custom Symbol Array Anonymous MapPoint 2006/2009 Discussion 2 01-07-2005 03:29 PM
Adding custom pushpins to the pushpin selection Anonymous MapPoint 2006/2009 Discussion 1 11-28-2003 03:28 PM
programmatically load a custom symbol Anonymous MapPoint 2006/2009 Discussion 1 08-22-2002 04:02 PM


All times are GMT -5. The time now is 02:07 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Luxor Holiday
Book your Luxor holiday through UlookUbook and visit this destination stooped in history.



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