Hi,
Okay I am doing some research for my company into if MapPoint will do what we need.
Heres the deal, what we would need to do, is import into MapPoint a list of addresses (we would mainly be working on Post Codes / Zip Codes etc) and then generate a map with a route on it from these.
My original idea after reading through the technical info for MapPoint was to this:
Now it is at this point I got stuck, I was under the impression I could something like this:Code:Dim mpApplication As MapPoint.Application Dim mpDataSets As MapPoint.DataSets Dim mpDataSet As MapPoint.DataSet Dim mpRecordSet as MapPoint.Recordset Dim mpMap As MapPoint.Map Dim mpRoute As MapPoint.Route Dim mpFieldDefList(4,2) As Variant mpFieldDefList(1,1) = “ROUTENO” mpFieldDefList(1,2) = geoFieldData ‘//Non Geocoding Data mpFieldDefList(2,1) = “CLIENTNAME” mpFieldDefList(2,2) = geoFieldData mpFieldDefList(3,1) = “ADDRESSINFO” mpFieldDefList(3,2) = geoFieldData mpFieldDefList(4,1) = “POSTALCODE” mpFieldDefList(4,2) = geoFieldPostal1 ‘UK Post Code Data Type Set mpAplication = New MapPoint.Application mpApplication.Visible = False mpApplication.UserControl = False mpApplication.NewMap Set mpMap = mpApplication.ActiveMap Set mpRoute = mpMap.ActiveRoute Set mpDataSets = mpApplication.NewMap.DataSets Set mpDataSet = mpDataSets.ImportData(gblProgramDatabasePath & “!tblMapRouteData”, mpFieldDefList) Set mpRecordset = mpDataSet.QueryAllRecords
I know thats very crude, but its just an example of the idea I had. I thought I would probably need some kind of function to return perhaps a geographic co-ordinate based on the post code I am passing etc...Code:mpRecordset.MoveFirst Do Until mpRecordset.EOF mpRoute.WayPoints.Add(mpRecordset("POSTALCODE").Value) mpRecordset.MoveNext Loop
But I got stuck when I realised that a WayPoint object requires something called an "Anchor" which can either be a Locaton object or pushpin object.
Now I am totally confused after reading Microsofts documentation on how the hell Pushpins work. I read somewhere that an imported data set already has pushpins... but what do these pushpins represent, each record in the dataset? I know pushpins represent marks on the map, I get that, but how do they relate to all this.
How do I get from my post codes in my dataset, to a pushpin object which can be used as an achor for a waypoint object that I want to add to my route.
Basically any help you can offer or information to boost my understanding would be very welcome.
Thanks
- Paul