Community of MapPoint and Bing Maps Users and Developers
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 ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Adding custom pushpin symbol 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 |
| ||||
|
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 |
| |||
| 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 |
![]() |
| Tags |
| adding, custom, pushpin, symbol |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding custom field to a Pushpin | marcocim | MapPoint Desktop Discussion | 1 | 06-12-2005 04:13 PM |
| Adding new symbol to map | Anonymous | MapPoint Desktop Discussion | 1 | 03-16-2005 11:27 AM |
| Help! Import Custom Symbol Array | Anonymous | MapPoint Desktop Discussion | 2 | 01-07-2005 03:29 PM |
| Adding custom pushpins to the pushpin selection | Anonymous | MapPoint Desktop Discussion | 1 | 11-28-2003 03:28 PM |
| programmatically load a custom symbol | Anonymous | MapPoint Desktop Discussion | 1 | 08-22-2002 04:02 PM |