MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




delete previous pushpin toadd new one.

This is a discussion on delete previous pushpin toadd new one. within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hello, I am new to Mappoint. I want to know how to delete continuous pushpin. Like if I will insert ...


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 (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 04-13-2008
Member
Yellow Belt
 
Join Date: Mar 2008
Posts: 37
delete previous pushpin toadd new one.

Hello,
I am new to Mappoint. I want to know how to delete continuous pushpin. Like if I will insert lat & lon and when I will insert next time I want mine previous pushpin be deleted. I tried but it keep on deleting my new add pushpin. Please let me know how to overcome this problem. I am using C#.
Hope to hear from you people.
Gul
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 04-14-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,094
Re: delete previous pushpin toadd new one.

Hi,

a Pushpin has a Delete method. So if you have somewhere:
Code:
PushPin pp = MP.ActiveMap.AddPushpin(location, name);
pp.Delete();
you can also hold an array of your pushpins. Or you can find a specific pushpin to delete with FindPushpin() method.

If you want to move a pushpin or replace it then you can also change the Location property of it to move it to a next location on the map. Less resources and it saves time.
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 04-14-2008
Member
Yellow Belt
 
Join Date: Mar 2008
Posts: 37
Re: delete previous pushpin toadd new one.

Hello,
Thanks Wilfried. Well with find pushpin I cant able to delete all previous pushpins generated by GPS and only plot pushpin that is in the visible area. I want to keep mine exact position pushpin and delete the previous pushpins. With PP.Delete(); i can able to delete but I am interested to keep my location pushpin and delete others.
Nasir


Quote:
Originally Posted by Wilfried View Post
Hi,

a Pushpin has a Delete method. So if you have somewhere:
Code:
PushPin pp = MP.ActiveMap.AddPushpin(location, name);
pp.Delete();
you can also hold an array of your pushpins. Or you can find a specific pushpin to delete with FindPushpin() method.

If you want to move a pushpin or replace it then you can also change the Location property of it to move it to a next location on the map. Less resources and it saves time.
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 04-14-2008
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 237
Re: delete previous pushpin toadd new one.

nasirgul,

Try deleting the "My PushPins" dataset before adding a new pushpin.

Mike Mattys
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 04-14-2008
Member
Yellow Belt
 
Join Date: Mar 2008
Posts: 37
Re: delete previous pushpin toadd new one.

Hello,
I tried with the below code but pushpin appears and invisible within second.

if (radioButton1.Checked)
{
MapPoint.Location loc = axMappointControl1.ActiveMap.Location;

double Lat = Convert.ToDouble(this.textBox1.Text as string);
double Lon = Convert.ToDouble(this.textBox2.Text as string);
loc = axMappointControl1.ActiveMap.GetLocation(Lat, Lon, Altitude);
loc.GoTo();
// MapPoint.Pushpin currPushpin = null;

//currPushpin = axMappointControl1.ActiveMap.AddPushpin(loc, "mylocation");


// currPushpin = axMappointControl1.ActiveMap.AddPushpin(loc, "hi");

//MapPoint.DataSets ds = axMappointControl1.ActiveMap.DataSets;

object o = "My Pushpins";
try
{
MapPoint.Pushpin hi = null;
hi = axMappointControl1.ActiveMap.AddPushpin(loc, "hi");

MapPoint.DataSet myPushpins = axMappointControl1.ActiveMap.DataSets.get_Item(ref o);
MapPoint.Recordset rs = axMappointControl1.ActiveMap.DataSets.get_Item(ref o).QueryAllRecords();


rs.MoveFirst();
//rs.MoveNext();

while (!rs.EOF)
{
//rs.Pushpin.GoTo();
rs.Pushpin.Delete();
rs.MoveNext();
}



}
catch
{


}


}

Nasir

Quote:
Originally Posted by Mattys Consulting View Post
nasirgul,

Try deleting the "My PushPins" dataset before adding a new pushpin.

Mike Mattys
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 04-14-2008
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 237
Re: delete previous pushpin toadd new one.

I don't speak .Net yet.

Concept is:
Default dataset is My Pushpins, so delete the dataset
When unassigned pin is added, MapPoint must recreate My Pushpins
to add the new pin.

You might also assign a more visible pushpin symbol.

Mike Mattys
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 04-15-2008
Member
Yellow Belt
 
Join Date: Mar 2008
Posts: 37
Re: delete previous pushpin toadd new one.

Hi,
I cant able to resolve the problem of deleting previous pushpin and get mine visible pushpin only. Iam intrested to delete all previous pushpins generated by GPS and only want to show pushpin that is in the visible area.I tried for deleting PP dataset and then add new one but not able to get control on program. ....please let me help to come out of this problem.
Code:
 object o = "Pushpins";
               Pushpin a =null;
               a= axMappointControl1.ActiveMap.AddPushpin(loc, "hi");
                try
                {
                   
//MapPoint.DataSet Pushpins = axMappointControl1.ActiveMap.DataSets.get_Item(ref o);
MapPoint.Recordset rs = axMappointControl1.ActiveMap.DataSets.get_Item(ref o).QueryAllRecords();
MapPoint.DataSet pushpin = axMappointControl1.ActiveMap.DataSets.AddPushpinSet("new");
a.Delete();
                    rs.MoveFirst();
                    while (!rs.EOF)
                    {
                        axMappointControl1.ActiveMap.DataSets.ZoomTo();                        
                        rs.Pushpin.MoveTo(pushpin);
                        rs.MoveNext();
                    }

                }
                catch {  }
            }

Quote:
Originally Posted by Wilfried View Post
Hi,

a Pushpin has a Delete method. So if you have somewhere:
Code:
PushPin pp = MP.ActiveMap.AddPushpin(location, name);
pp.Delete();
you can also hold an array of your pushpins. Or you can find a specific pushpin to delete with FindPushpin() method.

If you want to move a pushpin or replace it then you can also change the Location property of it to move it to a next location on the map. Less resources and it saves time.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 04-16-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,094
Re: delete previous pushpin toadd new one.

Hi,

I answered in other thread on how to delete all pushpins.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 08-22-2008
Junior Member
White Belt
 
Join Date: Aug 2008
Posts: 9
Re: delete previous pushpin toadd new one.

Where is the other thread? Looking to delete My Pushpins...cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 08-25-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,094
Re: delete previous pushpin toadd new one.

Hi,

I don't know because it is a while ago. But this will delete the dataset:

Code:
object o = "My Pushpins";
MP.ActiveMap.DataSets.get_Item(ref o).Delete();
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
delete, previous, pushpin, toadd


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/delete-previous-pushpin-toadd-new-one-7482.html

Posted By For Type Date
The Magazine for MapPoint - MP2K Magazine This thread Refback 04-16-2008 07:42 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
don't delete pushpin sdonta MapPoint 2006/2009 Discussion 1 03-03-2005 12:57 PM
Delete Pushpin from PushpinSet (or DataSet) prior to moving SeanMcGinty MapPoint 2006/2009 Discussion 2 12-20-2004 10:37 AM
Clear previous itinerary Anonymous MapPoint 2006/2009 Discussion 4 11-03-2004 09:36 AM
How do I prevent old/previous entries that I typed.... Anonymous MapPoint 2006/2009 Discussion 1 07-11-2002 12:10 PM
27/10/01 Thanks for your previous answer but the .... Anonymous MapPoint 2006/2009 Discussion 1 10-26-2001 11:42 PM


All times are GMT -5. The time now is 07:18 PM.


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

Late Ski Holidays
Hoping to book a ski holiday at the last minute? Well for late ski holidays visit Holiday Hypermarket and you can find the latest great deals for you.

Business Travel Agent
Leading Business Travel Agent. Personal service is at the heart of our business. Talk to one of our travel agents today.

Holiday to Thailand
Want to go somewhere new? Book a low cost holiday to Thailand at dealchecker.co.uk. See the stunning national parks and uninhabited islands.

Cuba Holidays
Cuba holidays offer an exciting cultural and wonderful culinary experience. Book with The Holiday Place for a great deal.

Cheap Balearics Holidays
Cheap Balearics holidays are available if you know when to book and who to book with. The Balearics have many fascinating places to visit all year round. The partying never stops.

Holiday Packages
Spoil yourself and your loved ones with one of the great Holiday Packages from Travel.co.uk.

Holidays in Portugal
Find the perfect Algarve holiday. Book holidays in Portugal now at On The Beach.


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