Community of VE/MapPoint Users and Developers
This is a discussion on delphi iterate pushpin dataset within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi to All, I've a mappoint map where we added all our customers. The pushpin name is equal to my ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| delphi iterate pushpin dataset I've a mappoint map where we added all our customers. The pushpin name is equal to my CustomerID From delphi I'm able to iterate into pushpin dataset and create a route but it's very very slow... I use this way: Code: var
i : Olevariant;
p : Pushpin;
begin
FMPApp.Visible := true;
FMPApp.OpenMap(AMapFileName, false );
i := 1;
FDs := FMPApp.ActiveMap.DataSets.Item[i];
FRs := FDs.QueryAllRecords;
FRs.MoveFirst;
while not FRs.EOF do
begin
p := FRs.Pushpin;
iff p.Name = trim(ACustID) then
FMPApp.ActiveMap.ActiveRoute.Waypoints.Add(location(p.Location), ACodice);
FRs.MoveNext;
end;
Becaus I need to create many routes I thought to add pushpin to a tlist the first time, and iterate TList all other times... but I'm not able to do that: I tried that: Code: FRs.MoveFirst;
while not FRs.EOF do
begin
p := FRs.Pushpin;
FList.Add(pointer(p));
FRs.MoveNext;
end;
I tried: Code: (IDispatch(FList.Items[i]) as Pushpin) and pushpin(FList.Items[i]) Is the first time that I work with IDispach and all, can someone help me? Thanks a lot Ciao Massimiliano |
| |||
| Closing problem
Just to let you know, that is not the right approach. Now I do that: take the map, iterate all pushpins and store coodinates to db. After search location by lat/lon and add location to ActiveRoute. It is very fast. But I've another problem. I'm not able to close mappoint, and all the times I get an errors when I close my program. I don't use olecontainer, I just create the application at runtime and destroy it when I finish, but I can't destroy it, is allway alive ... Can you help me? Thanks Massimiliano |
![]() |
| Tags |
| dataset, delphi, iterate, pushpin |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PushPin dataset is saved in .ptm? | PeppeM | MapPoint 2006/2009 Discussion | 1 | 05-06-2006 01:53 PM |
| Refresh After A Pushpin Has Been Deleted From the Dataset | Yazzy | MapPoint 2006/2009 Discussion | 3 | 09-15-2005 03:04 PM |
| Add a newly created Pushpin to Dataset | Yazzy | MapPoint 2006/2009 Discussion | 1 | 08-24-2005 02:46 PM |
| Find Nearby Pushpin in dataset | Dazzer | Products: Pushpin Tool, Single State Mapper | 1 | 10-16-2003 04:05 PM |
| Problems with Pushpin dataset | Sylvain | MapPoint 2006/2009 Discussion | 13 | 11-28-2002 08:08 AM |