Patric
Posts: 4
Joined: Sun Jul 19, 2009 4:30 am

Går inte att skapa flera iconer på map

Sun Jul 19, 2009 4:41 am

Hej,
Jag vill placera flera iconer på en map med positioner från en databas. Det blir bara den sist placerade som syns. De övriga blinkar bara till.
Går bra att klicka på map och placera flera iconer med exempelkod

Koden jag använder

Code: Select all

        
Dim objPosition As New GpsToolsNET.Position
Dim objIcon As GpsViewNET.Icon


            Do Until adoRS.EOF
                Try
                    objIcon = Map1.NewIcon(adoRS.Fields("KartObjektTyp").Value.ToString)
                    objIcon.ID = adoRS.Fields("ID").Value
                    objPosition.Northing = adoRS.Fields("Xkoord").Value
                    objPosition.Easting = adoRS.Fields("Ykoord").Value
                    objIcon.Position = objPosition
                    Map1.Update()
                Catch ex As Exception

                End Try

                adoRS.MoveNext()
            Loop
Mvh Patric

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Går inte att skapa flera iconer på map

Sun Jul 19, 2009 7:47 pm

Been a long time since I worked with GpsTools but maybe you need to create a Position object for each object. I'm not sure it's actually copied when you do objIcon.Position = objPosition.

Worth a try at least.

Regards,
Jonas

Patric
Posts: 4
Joined: Sun Jul 19, 2009 4:30 am

RE: Går inte att skapa flera iconer på map

Tue Jul 21, 2009 1:45 am

Originally posted by Jonas

Been a long time since I worked with GpsTools but maybe you need to create a Position object for each object. I'm not sure it's actually copied when you do objIcon.Position = objPosition.

Worth a try at least.

Regards,
Jonas


Det Funkade! Tack!

PE

Return to “GpsTools”