MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




How to detect a particular pushpin

This is a discussion on How to detect a particular pushpin within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I want to hold a list of all MP-pushpins in memory. What criteria of the PushPin-Object I added with ...


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

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



Click here to register

Reply

 

LinkBack (2) Thread Tools Display Modes
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 05-05-2008
Junior Member
Yellow Belt
 
Join Date: Jan 2006
Posts: 13
How to detect a particular pushpin

Hi,
I want to hold a list of all MP-pushpins in memory. What criteria of the PushPin-Object I added with "AddPushPin" do I have to store in my list, so that I can find the right listentry in "OnSelectionChange"?
I dont' want to use some strings in "Name" or "Note" because the user can change this things.
I tried to store the address of the PushPin-Object, but this didn't work. In "OnSelectionChange" I didn't get the same address as in "AddObject".
greetings
Gerhard
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 05-05-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Re: How to detect a particular pushpin

Hi,

Store the address should be the right thing. Are you sure you get 2 different addresses? I try to do a test later today and come back
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 05-05-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Re: How to detect a particular pushpin

Hi,

I tryed the following code in a button click:

Code:
Location loc = MP.ActiveMap.GetLocation(lat, lon, alt);
Pushpin pp  = MP.ActiveMap.AddPushpin(loc, "Wilfried");
thePP = pp;
Then add a few more Pushpins. Then this code in selectionChange:

Code:
Pushpin pp = MP.ActiveMap.Selection as Pushpin;
if (pp != null)
    if (pp == thePP)
        Console.Beep();
It beeps when pp is the same one as the one assigned to thePP with AddPushpin, and it does not when I select others. So this comparistion works good.
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 05-06-2008
Junior Member
Yellow Belt
 
Join Date: Jan 2006
Posts: 13
Re: How to detect a particular pushpin

Hi Wilfried,
I stored the PushPin in a var with type "IDispache". Now I tried "MapPoint.PushPin" (wich is defiend as "Pushpin = interface(IDispatch)") and my first test was succesfull. (It's Delphi 2006)
At the moment I have to do some other work, so I can't do a complete test. I will come back when i have done this testing...
Thanks
Gerhard
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 05-08-2008
Junior Member
Yellow Belt
 
Join Date: Jan 2006
Posts: 13
Re: How to detect a particular pushpin

Hi Wilfried,
It works ok if I store the MP-Pbjects (PushPin, Shape) directly without a Typecast.
Thank you very much.
greetings
Gerhard
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 05-09-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Re: How to detect a particular pushpin

Hi Gerhard,

Glad it works. Thanks for feedback.
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
detect, pushpin


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/how-detect-particular-pushpin-7643.html

Posted By For Type Date
Latitude / Longitude DMS -> Decimal Converter - MP2K Magazine This thread Refback 05-05-2008 11:55 PM
The Magazine for MapPoint - MP2K Magazine This thread Refback 05-05-2008 08:09 AM

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
Really no way to detect a Pushpin drag, is there? aroberts MapPoint 2006/2009 Discussion 1 03-31-2008 06:03 AM
How to detect Shape Name on SelectionChange event tfmiltz MapPoint 2006/2009 Discussion 1 11-02-2007 01:49 PM
Detect presence of pushpin PMACAFEE MapPoint 2006/2009 Discussion 1 11-19-2006 01:48 PM
Detect a pushpin name change. Daniel MapPoint 2006/2009 Discussion 2 08-10-2004 06:27 AM
Finding Pushpin Name by clicking on the Pushpin?(MP 2002) NickSP MapPoint 2006/2009 Discussion 4 01-10-2003 12:11 PM


All times are GMT -5. The time now is 06:50 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Majorca Holiday
Enjoy a Majorca holiday at a good price when you check out the offers on UlookUbook for this popular destination!

Pubs London
Looking for pubs in London? Qype has all the anwsers!



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