dbTalk Databases Forums  

MapPoint ActiveX control integration with Pdox 9

comp.databases.paradox comp.databases.paradox


Discuss MapPoint ActiveX control integration with Pdox 9 in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Moseley
 
Posts: n/a

Default MapPoint ActiveX control integration with Pdox 9 - 03-14-2008 , 12:15 PM







Greetings all. I had to integrate MapPoint into my Pdox 9 application. From
all the history here, it seems like others were having trouble with this,
so I thought I'd post a basic solution - it even works in Runtime.

I'm using MapPoint 2004. If someone has 2006, can you test this to see if
it still works?

First, add the MapPoint ActiveX Control to the ActiveX toolbar. From there,
add it to your form. Then, it's just a matter of controlling the control.
For some reason, you can't directly access the Map object. But, the OCX
has an ActiveMap property that returns the Map itself. The same applies
with the Route object - you use the ActiveRoute property to get the Route.


HTH,
Jim Moseley



method pushButton(var eventInfo Event)

var
oaMP1,
oaMap,
oaRoute,
oaStops,
oaLocation
oleAuto
dyn dynarray[] anytype
endVar
doDefault

MapPointOCX.NewMap(1)

;while not MapPointOCX.ReadyState = 4
; sleep(200)
;endWhile

if not oaMP1.attach(MapPointOCX) then
errorShow()
return
endif

oaMap = oaMP1.ActiveMap
oaRoute = oaMap.ActiveRoute
oaRoute^clear()
oaStops = oaRoute.WayPoints
oaLocation = oaMap^getLocation(30.299, -81.708)
oaStops^add(oaLocation, "Start")
oaLocation = oaMap^getLocation(33.321, -83.321)
oaStops^add(oaLocation, "Stop 1")
oaLocation = oaMap^getLocation(35.321, -82.321)
oaStops^add(oaLocation, "End")
oaRoute^calculate()

driveTime = round(oaRoute.DrivingTime * 24,2)

endMethod

Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.