Hi to All,
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:
Is there a faster way to do what I want?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:
but when I try to retrive the pushpin from the list I get an error.Code:FRs.MoveFirst; while not FRs.EOF do begin p := FRs.Pushpin; FList.Add(pointer(p)); FRs.MoveNext; end;
I tried:
all without results.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