Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 2 of 2

delphi iterate pushpin dataset

This is a discussion on delphi iterate pushpin dataset within the MapPoint Desktop 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 ...

  1. #1
    merlino is offline Junior Member White Belt
    Join Date
    Oct 2004
    Posts
    1

    delphi iterate pushpin dataset

    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:
    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;
    Is there a faster way to do what I want?
    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;
    but when I try to retrive the pushpin from the list I get an error.
    I tried:
    Code:
      (IDispatch(FList.Items[i]) as Pushpin)
    
      and 
     
      pushpin(FList.Items[i])
    all without results.
    Is the first time that I work with IDispach and all, can someone help me?

    Thanks a lot

    Ciao
    Massimiliano

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PushPin dataset is saved in .ptm?
    By PeppeM in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-06-2006, 01:53 PM
  2. Refresh After A Pushpin Has Been Deleted From the Dataset
    By Yazzy in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 09-15-2005, 03:04 PM
  3. Add a newly created Pushpin to Dataset
    By Yazzy in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-24-2005, 02:46 PM
  4. Find Nearby Pushpin in dataset
    By Dazzer in forum Products: Pushpin Tool, Single State Mapper
    Replies: 1
    Last Post: 10-16-2003, 04:05 PM
  5. Problems with Pushpin dataset
    By Sylvain in forum MapPoint Desktop Discussion
    Replies: 13
    Last Post: 11-28-2002, 08:08 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25