PDA

View Full Version : [C#] MappointControl - Pushpin symbol



suamikim
11-22-2005, 05:22 AM
Hi,

i need to show some individual symbols for my pushpins, but i can't find exactly how to do it. I'm adding the pushpin this way:



MapPoint.Location loc = map.GetLocation(latitude, longitude, altitude);
MapPoint.Pushpin pushpin = map.AddPushpin(loc, loc.Name);


The problem is, that i've seen the pushpin.Symbol-Member, but i don't know how to set a custon bitmap or jpg to it, cause it's a short-Value.

Is it somehow possible to use these Standard-Icons from MapPoint:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mappointsdk/html/TablesIcons.asp

Thanks, greets

mike

brianmcg
11-22-2005, 01:16 PM
Hi Mike,

While I'm not sure about C#, you can do it in VB by updating the Symbol property of the pushpin object you create in the AddPushPin method. I would expect that it would be similar in C#.



Dim oLoc As MapPointCtl.Location
Dim oPin As MapPointCtl.Pushpin

Set oLoc = map.ActiveMap.GetLocation(Latitude, Longitude)
Set oPin = map.ActiveMap.AddPushpin(oLoc, "Pin Name")
oPin.Note = "Balloon Note goes here"
oPin.BalloonState = geoDisplayName
oPin.Symbol = 87 ' Green Truck Symbol


Hope this helps.

Brian McGrath
CAD North Inc.
http://www.cadnorth.com

Wilfried
11-22-2005, 04:31 PM
Hi,

Check messages off yesterday or day before to add cstom bitmaps. I have no mappoint on this machine...

suamikim
11-23-2005, 12:33 AM
Hi Mike,

While I'm not sure about C#, you can do it in VB by updating the Symbol property of the pushpin object you create in the AddPushPin method. I would expect that it would be similar in C#.



Dim oLoc As MapPointCtl.Location
Dim oPin As MapPointCtl.Pushpin

Set oLoc = map.ActiveMap.GetLocation(Latitude, Longitude)
Set oPin = map.ActiveMap.AddPushpin(oLoc, "Pin Name")
oPin.Note = "Balloon Note goes here"
oPin.BalloonState = geoDisplayName
oPin.Symbol = 87 ' Green Truck Symbol



Ok, this helps, but how do you know witch symbol the nr. 87 is? On the page i've posted above the green truck is nr. 55?
I would like to use the simple blue car or one with an arrow, how do i find out, witch nr they have without trial and error?

Wilfried
11-23-2005, 02:02 AM
Hi,


how do i find out, witch nr they have without trial and error?

In the help of mappoint look at "symbol property". they are listed with number and symbol.