Community of VE/MapPoint Users and Developers
This is a discussion on How to list the name of all group of pushpins ? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hello I developp an add-in for MapPoint 2004 in C sharp and I want to list all the pushpin's name ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| How to list the name of all group of pushpins ? I developp an add-in for MapPoint 2004 in C sharp and I want to list all the pushpin's name that are in the map for example I load an excel file that have 5 groups of pushpins and I want to enumerate all of them in a listbox, how can I do this ? whith this code I can only access to the first pushpin, but not the others: Quote:
|
| |||
|
Hi, I just tryed exacly the same (check my code eventually), and it display's all pushpins currently on the map: Code: object o = 1;
MapPoint.DataSet ds = mp.ActiveMap.DataSets.get_Item(ref o);
Recordset rs = ds.QueryAllRecords();
rs.MoveFirst();
while (!rs.EOF) {
Location loc = rs.Pushpin.Location;
Console.WriteLine(rs.Pushpin.Name.ToString());
Console.WriteLine(loc.Name); // both are the same
rs.MoveNext();
}
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
But this code doesn't show all of the group of pushpin ( "clicks-infos" in my french version of MapPoint ), it show only the first group of "click info" for example you can see in this screenshot 7 "clicks-infos" ( group of pushpin ) : ![]() the source code in my first message shows only the first "click info" ( pushpin AGF in the screenshot ), But I want to list all of the pusphin in the map ( the 7 "clicks infos" ) do you have an idea to do this ? thanks |
| |||
|
Hi, I hope I understeand all now I think they are in different datasets. So you have to parse trough all datasets. Something like this should work. I did test it, but did not checked it with several datasets: Code: MapPoint.DataSets dataSets = mp.ActiveMap.DataSets;
foreach (MapPoint.DataSet ds in dataSets) {
Recordset rs = ds.QueryAllRecords();
rs.MoveFirst();
while (!rs.EOF) {
Location loc = rs.Pushpin.Location;
Console.WriteLine(loc.Name);
rs.MoveNext();
}
}
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Thanks it's ok but now I want to retrieve adress, postalcode and city from the pushpin, I use this code: Quote:
what is the correct syntax for retrieving the street adress, postalcode and city from a pushpin ? |
| |||
|
Hi, You do the correct code. But I recall other post that sometime the postcode is not the right one. Also you can get (I think) incorrect results if your pushpin is not on a known street.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
It's very strange, because when I export the data to Excel ( with a right click on the "clic-info" in the screenshot ) then I can see the correct adress in the excel file theses pushpins in my example come from an import data process ( file TXT or excel file ) |
![]() |
| Tags |
| group, list, pushpins |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Block group geographies | bcimapr | Wish List | 1 | 12-01-2004 01:05 PM |
| Printing a corresponding list of addresses from pushpins | Anonymous | MapPoint 2006/2009 Discussion | 0 | 10-26-2004 01:54 PM |
| Finding the center of a group of pushpins | Anonymous | MapPoint 2006/2009 Discussion | 3 | 04-07-2004 03:51 PM |
| Select pushpins list | tanguy_laverdure | MapPoint 2006/2009 Discussion | 0 | 02-20-2004 08:59 AM |
| Is it possible to group several pushpins together,.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 08-27-2001 12:03 PM |
Flight to Tenerife
Don't check in before you check out Holiday Hypermarket. Book a low cost flight to Tenerife and soak up some Canary Island sun.
Business Travel Agent
Leading Business Travel Agent. Personal service is at the heart of our business. Talk to one of our travel agents today.
Flights Canada
Our search results will show you a selection of airlines, travel agents and tour operators offering cheap flights to Canada. See for yourself who has the cheapest deals.
Holidays to Dominican Republic
Holidays to Dominican Republic offer a wealth of natural beauty and magnificent views. Come alive in the splendor of the Dominican Republic!
Balearics
Before booking to the Balearics Islands make sure you check out our travel guide online. The Balearics are renowned for their vibrant nightlife but there are also some stunning Gothic cathedrals, Stone Age ruins and fishing villages.
Compare Prices
Travel.co.uk makes it easy for you to compare prices from hundreds of UK based travel companies.
Holidays in Sharm el Sheikh
Need booking info on holidays in Sharm el Sheikh? Visit On The Beach for more information!