Community of VE/MapPoint Users and Developers
This is a discussion on Using MP2004 with Delphi within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I need to use MP 2004 in our delivery managment software. I have got the type library installed so ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Using MP2004 with Delphi I need to use MP 2004 in our delivery managment software. I have got the type library installed so i have got the three controls Application, map and mappointUtilities. What I need to do is very basic, which is displaying a direction map, using two postcodes, the first one is the warehouse postcode and the second one is the customer postcode. Can any one show me some delphi code or direct me to the right place. I am using Delphi 6 and MapPoint 2004. Thanks |
| |||
|
This is an example of what I want to achieve. http://212.50.188.108/cgi-win/vebra..../VALEW/17775/1 Thanks |
| |||
|
Hi, Quote:
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Hi, Code: This is an example of what I want to achieve
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Hi, Choose 'Import Type Library', select 'Microsoft MapPoint 11.0 Object Library', tick 'Generate Component Wrapper' and then click 'Install'. This will compile and build a Delphi package and as a result three MapPoint components will appear on the ActiveX-tab of the Component Palette: TApplication, TMap and TMapPointUtilities. Regards |
| |||
|
Hi, Ok this works: Code: with OpenDialog1 do
if Execute then
Application1.OpenMap(FileName, False);
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Hi, I am new to MP, I managed to display the mep but not embaded within the form. this is the code procedure TForm1.FormShow(Sender: TObject); var MyMap: _Map; begin MyMap := MyApplication.ActiveMap; MyMap.Application.Visible := True; MyMap.GoToLatLong(43, -3, 100); end; you need to drop MP TApplication component on the form first. |
| |||
| Quote:
Thanks |
| |||
|
This code will embed it into a form, you need to drop a TOleContainer onto the form procedure TForm1.FormShow(Sender: TObject); var vGuid : TGuid; FMap:_map; begin OleContainer.CreateObject('MapPoint.Map.EU.11', False); OleContainer.DoVerb(1); OleContainer.OleObjectInterface.GetUserClassID(vGu id); FMap := IDispatch(OleContainer.OleObject) as _Map; end; |
| |||
|
Hi, This is VB code for geocoding: http://www.mp2kmag.com/articles.asp?...xtract.lat.lon This is the same one converted into C#: http://www.mp2kmag.com/mappoint/disc...pic.asp?t=3291 I have something similar in Delphi5 but cant find it at the moment. What you have to do is first get a Location object form the address information you get. Something similar like this: Code: FindResults AddrResults = MP.ActiveMap.FindAddressResults(street, city, othercity, region, zip, country);
foreach (object o in AddrResults) {
Location Loc = o as Location;
if (Loc != null) {
double Lat;
double Lon;
pos.CalcPos(Loc, out Lat, out Lon);
Console.WriteLine(Loc.Name + " " + Lat.ToString() + " " + Lon.ToString());
}
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| delphi, mp2004 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MP2004 and terminal services | SeanB | MapPoint 2006/2009 Discussion | 5 | 10-16-2006 12:16 PM |
| MP2004 - XYToLocation | AndyWood | MapPoint 2006/2009 Discussion | 2 | 06-05-2006 11:13 AM |
| Using S&T 2005 maps in MP2004 | Fleet | MapPoint 2006/2009 Discussion | 1 | 11-18-2004 01:54 PM |
| Coords to address MP2004 | Anonymous | MapPoint 2006/2009 Discussion | 1 | 04-23-2004 10:07 AM |
| voice commands in MP2004 | Anonymous | MapPoint 2006/2009 Discussion | 3 | 03-28-2004 06:33 AM |