Hi...
I have to develop an Delphi application using MapPoint.
The situation is: There are several branches, each branch has several customers.
First, I use ImportData() method to get the pushpins of the customers.
Then, I use Map.AddPushpin() method to display a pushpin for each branch itself.
But although I add the Pushpins for the branches AFTER importing the customers' pushpins, the symbols of the branch pushpins (stored in "My Pushpins") will be displayed in the background.
See attached image ("Meine Pins" is "My Pushpins" in German). The green circles are the customers' pushpins imported via ImportData, the blue flag is the branch pushpin.
Has someone an idea how to get the DataSet "My Pushpins" in foreground??
Greetings,
Dietmar
Here a piece of code:
Code:// First, import the Customers' pushpins adoQuery.Open; try SetLength(arrDataSets, adoQuery.RecordCount); while not adoQuery.Eof do begin BranchID := adoQuery.FieldByName('BranchID').AsString; // get BranchID from Query (necessary to get the right View from SQL Server) arrDataSets[adoQuery.RecNo-1] := SMap.DataSets.ImportData(ExtractFilePath(Application.Exename) + 'serverlink.udl!V_Mappoint_'+BranchID, arrFields, geoCountryDefault, geoDelimiterDefault, 0); arrDataSets[adoQuery.RecNo-1].Symbol := ArrCustomerSymbols[adoQuery.RecNo-1].ID; // array of Symbols, for the customer group of each branch an extra symbol arrDataSets[adoQuery.RecNo-1].Name := BranchID; // give the DataSet a name adoQuery.Next; end; finally adoQuery.Close; end; // Then, create the Branch pushpins, but they will appear in background... adoQuery.SQL.Clear; adoQuery.SQL.Add('SELECT Longitude, '); adoQuery.SQL.Add(' Latitude, '); adoQuery.SQL.Add(' BranchID, '); adoQuery.SQL.Add(' BranchName '); adoQuery.SQL.Add(' FROM Branches'); adoQuery.Open; try while not adoQuery.Eof do begin BranchLocation := SMap.GetLocation(adoQuery.FieldByName('Latitude').AsFloat, adoQuery.FieldByName('Longitude').AsFloat, 0); B_Name := adoQuery.FieldByName('BranchName').AsString; B_ID := adoQuery.FieldByName('BranchID').AsString; adoQuery.Next; // insert a Branch pushpin tmpPushpin := SMap.AddPushpin(BranchLocation, 'Branch location' + B_ID); tmpPushpin.Note := B_Name; tmpPushpin.Symbol := symbol_ID; // an ID of the symbol... end; finally adoQuery.Close; end;