View Full Version : how many pushpin are in the zone

12-23-2002, 05:04 AM
I use mappoint within VB.

I have drawn a zone around a route with the method FindNearby().
I have imported data from a file (xls and txt), and placed on the map like pushpins. A place category has been created which describes pushpins which own to this zone.

But now, I would like to recover the pushpins which own to this zone.

Can you give me a way, please ?
I am desperate ... :-(



John Meyer
12-23-2002, 09:01 PM
This sample assumes you have a map loaded with an active route and some pushpins nearby. I show loading my sample map in the form_load event.

Private Sub Form_Load()
Set objmap = MappointControl1.OpenMap("c:\testroute.ptm")
End Sub

Private Sub Command1_Click()
Dim objmap As MapPointCtl.Map
Set objmap = MappointControl1.ActiveMap
Dim oResults As MapPointCtl.FindResults
Set oRoute = objmap.ActiveRoute

Set oResults = oRoute.Directions.FindNearby(20)

For i = 1 To oResults.Count
If TypeOf oResults.Item(i) Is Pushpin Then
strTest = strTest + oResults.Item(i).Name & vbCrLf
i = i + 1
End If

MappointControl1.PaneState = geoPaneNearbyPlaces

MsgBox strTest