MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Nearest pushpins

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-04-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Nearest pushpins

Hi, I have imported 48 pushpins into a map. When I scroll over one of the pushpins, I want the map to highlight the nearest 10 (a variable number) pushpins, can anyboy give me any clues where to start.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 01-06-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 01-07-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
nearest, pushpins


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 02:03 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54