Community of VE/MapPoint Users and Developers
This is a discussion on Nearest pushpins within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I have imported 48 pushpins into a map. When I scroll over one of the pushpins, I want the ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Nearest pushpins |
| |||
| Use MouseMove event
Hi, Write a MouseMove event handler, from this you can get lat.long from that you can query your pushpins and from there you could change symbols for the nearest 10 therfore highlighting them Hope this helps. Scarr |
| |||
|
Try something like: Function HighlightClosest(oDataset As MapPoint.DataSet, oCentre As MapPoint.Location, rlngCount As Long) Dim rs As MapPoint.Recordset Dim lngRecordCount As Long Dim Radius As Double Const INCREMENT = 0.1 Const MAX_RADIUS = 1 On Error GoTo HC_Error Radius = 0 Do Radius = Radius + INCREMENT Set rs = oDataset.QueryCircle(oCentre, Radius) lngRecordCount = 0 rs.MoveFirst If Not rs.EOF Then Do rs.Pushpin.Highlight = True lngRecordCount = lngRecordCount + 1 rs.MoveNext Loop While Not rs.EOF End If Set rs = Nothing Loop While Radius < MAX_RADIUS And lngRecordCount < rlngCount HC_Exit: Exit Function HC_Error: Debug.Print Err.Description Resume HC_Exit End Function You will also need something to whizz round and remove the highlights when you no longer want them. You will also need to adjust the MAX_RADIUS and INCREMENT to suit your data BTW wouldn't recommend using MouseMove event, especially if you are using large datasets. HTH M. |
![]() |
| Tags |
| nearest, pushpins |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Finding nearest pushpins in dataset | Dazzer | MapPoint 2006/2009 Discussion | 3 | 10-17-2003 09:38 AM |
| find nearest locality | Anonymous | MapPoint 2006/2009 Discussion | 0 | 07-09-2003 04:26 AM |
| nearest city of a point | Anonymous | MapPoint 2006/2009 Discussion | 0 | 04-07-2003 07:46 AM |
| How to find nearest city? | Petr Brant | MapPoint 2006/2009 Discussion | 3 | 08-23-2002 02:49 PM |
| how is the possibility to know the nearest route (.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 08-20-2001 04:30 AM |