Anonymous
11-17-2003, 02:18 PM
I am trying to find a way to pass in our employees and their addresses, and have it return the 10 closest to a given customer address. I have come accross some functionality that is close, but I cannot find anything that does this exactly.
Any ideas?
Dazzer
11-19-2003, 04:59 AM
You can do something along these lines with VB, you could import all of your employees into a given dataset and then use QueryCircle to find all employees in within a set radius of the customer.
eg.
dim objRecords As MapPoint.Recordset
Set objRecords = objMap.DataSets.Item(1).QueryCircle(objPushPin.Loc ation, 2)
This would pull all of the employees in the dataset within in a 2 Mile (or kilometer depending on what unit your using) radius from objPushPin.Location (where objPushPin.Location in your customer) into the recordset objRecords.
You will need to programatically set objPushpin as your customer.
Dim objloc As MapPoint.Location
Dim onjPushPin As MapPoint.Pushpin
Dim GappMp As Mappoint.Application
DimObjMap As Mappoint.Map
Set gappmp = CreateObject("MapPoint.Application")
gappmp.Visible = True
Set objMap = gappmp.ActiveMap
Set objloc = objMap.FindAddressResults("StreetNo Street, Town, Village, County, PostCode")(1)
Set objPushPin = objMap.AddPushpin(objloc, Street)
objPushPin.Name = "PinName"
objPushPin.BalloonState = geoDisplayBalloon
objPushPin.Symbol = 77
objPushPin.Highlight = True
objPushPin.Select
I'm not sure i've explained this very well but these articles proved helpful to me.
http://www.mp2kmag.com/articles.asp?ArticleID=74
http://www.mp2kmag.com/a46--find.from.radius.mappoint.html
http://www.mp2kmag.com/a39--word.access.excel.mappoint.html