cant create a Puspin-Object

OverSchranzer
03-10-2005, 05:57 AM
Hello,

i am using the mappoint control of mappoint european 2004 to create an application


I want to use pushpins to show data on the map
in some exsamples i saw code like:

Dim myPushpins(1) As Pushpin
myPushpins(0) = New Pushpin()
myPushpins(0).IconDataSource = "MapPoint.Icons"
myPushpins(0).IconName = "31"
myPushpins(0).Label = "Start"


But it doesnt work!
Here is my Code


Dim pinCounter As Integer
pinCounter = 0

objRecordSet.MoveFirst()

Dim myPushpins(pinCounter.MaxValue - 1) As MapPoint.Pushpin
Do While Not objRecordSet.EOF

myPushpins(pinCounter) = New MapPoint.Pushpin '<<--- ? "New cannot be used with an Interface..." ?

objRecordSet.MoveNext()
pinCounter += 1

Loop


plz help me, what sould i do?

John Meyer
03-10-2005, 08:48 AM
What language are you programming in?

OverSchranzer
03-10-2005, 09:10 AM
VB.NET

John Meyer
03-10-2005, 09:42 AM
Give this a try

Try
Dim omap As MapPoint.Map
Dim oloc As MapPoint.Location
Dim opin As MapPoint.Pushpin

omap = AxMappointControl1.ActiveMap
oloc = omap.GetLocation(51.577141, 0.291178, 250)
opin = omap.AddPushpin(oloc, "Pushpin1")
opin.BalloonState = MapPoint.GeoBalloonState.geoDisplayBalloon
opin.Location.GoTo()

Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

OverSchranzer
03-11-2005, 01:48 AM
thx
thats the way i tried first,

but i want to set an own icon and a Label wich shows the data on the map

is it possible somehow?

Wilfried
03-11-2005, 07:51 AM
Hi,

Symbol NewSymbol = MP.ActiveMap.Symbols.Add("c:\\test.bmp");
PP.Symbol = NewSymbol;

 
Web mp2kmag.com
mapforums.com