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 3 of 3

pushpins with delphi

This is a discussion on pushpins with delphi within the MapPoint Desktop Discussion forums, part of the Map Forums category; I'm very new to mappoint so please forgive me if this has been answered before. i want to display the ...

  1. #1
    ian
    ian is offline Junior Member White Belt
    Join Date
    Jun 2003
    Posts
    2

    pushpins with delphi

    I'm very new to mappoint so please forgive me if this has been answered before. i want to display the results of a databse query on a map. the language is delphi. here is my code.

    var vGuid : TGuid;
    curLat, CurLong, CurScore:real;
    objLocTst:location;
    ObjPin:Pushpin;
    i:integer;
    begin
    i:=0;
    OleContainer.CreateObject('MapPoint.Map.NA.9', False);
    OleContainer.DoVerb(1);
    OleContainer.OleObjectInterface.GetUserClassID(vGu id);
    FMap := IDispatch(OleContainer.OleObject) as _Map;
    FMap.DataSets.AddPushpinSet('70 plus');

    with DM.ADOQ do
    begin
    First;
    // while not Eof do
    for i:=0 to 100 do //just do a subset for debugging
    begin
    CurLong := DM.ADOQ.FieldByName('longitude_x').AsFloat; //longitude
    CurLat := DM.ADOQ.FieldByName('latitude_y').AsFloat;//latitude
    CurScore := DM.ADOQ.FieldByName('homogeneity_score').Value; //what needs to be plotted as a function of lat, long
    objLocTst := FMap.GetLocation(curLat, CurLong,1) ;
    objPin := FMap.AddPushpin(objLocTst, floattostr(CurScore));
    objPin.BalloonState := geoDisplayNone ;
    objPin.Cut ;

    Next;

    end;
    end;

    // FMap.
    end;


    this runs fine but i never get anything displayed. i think i'm missing something fundamental. can anyone help? thanks

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Seems youre deleting your pushpins with ObjPin.Cut

    Greetings, Jack.

  3. #3
    ian
    ian is offline Junior Member White Belt
    Join Date
    Jun 2003
    Posts
    2
    yes, i caught that later on. thank you. how would i go about adding a second dataset to this? i want to be able to overlay pushpins of different colours, each one corresponding to the results of a different database query. i think i'm missing the link between a dataset and a pushpin..

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Delphi class
    By terrastudios in forum MapPoint Desktop Discussion
    Replies: 9
    Last Post: 12-02-2005, 04:01 AM
  2. example in Delphi to route
    By tontaegu in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 08-23-2005, 02:42 AM
  3. Creating a subset of Pushpins from a set of pushpins
    By paf33 in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 08-09-2005, 04:54 AM
  4. Delphi
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 12-18-2003, 11:11 AM
  5. 'AddCommand' + Delphi
    By stuarth in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-09-2003, 09:18 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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83