MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




How to list the name of all group of pushpins ?

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-02-2006
Junior Member
Yellow Belt
 
Join Date: Mar 2006
Posts: 13
How to list the name of all group of pushpins ?

Hello

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:
object o = 1;


MapPoint.DataSet ds = app.ActiveMap.DataSets.get_Item(ref o);
MapPoint.Recordset rs = ds.QueryAllRecords();
rs.MoveFirst();
while (!rs.EOF)
{
MapPoint.Location loc = rs.Pushpin.Location;
MessageBox.Show(loc.Name);
rs.MoveNext();
}
thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 03-03-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,105
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();
    }
Showing a messagebox non modal should give the same result.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 03-04-2006
Junior Member
Yellow Belt
 
Join Date: Mar 2006
Posts: 13
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 03-04-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,105
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();
                }
            }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 03-06-2006
Junior Member
Yellow Belt
 
Join Date: Mar 2006
Posts: 13
Thanks it's ok

but now I want to retrieve adress, postalcode and city from the pushpin,

I use this code:

Quote:
string sParamPushpin;

//street name
sParamPushpin+=loc.StreetAddress.Street + ";";

//postalcode
sParamPushpin+=loc.StreetAddress.PostalCode +";";

//City
sParamPushpin+=loc.StreetAddress.City + ";";

//Country
sParamPushpin+=loc.StreetAddress.Country;
but this code doesn't work for some pushpin, for example for "postalcode" the value is incorrect ( 00014 instead of 44000 ), I don't understand

what is the correct syntax for retrieving the street adress, postalcode and city from a pushpin ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 03-06-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,105
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 03-06-2006
Junior Member
Yellow Belt
 
Join Date: Mar 2006
Posts: 13
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 )
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
group, list, pushpins


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 04:36 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

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!


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