Community of VE/MapPoint Users and Developers
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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| delete previous pushpin toadd new one. 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 |
| |||
| 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(); 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.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| 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:
|
| |||
| Re: delete previous pushpin toadd new one.
nasirgul, Try deleting the "My PushPins" dataset before adding a new pushpin. Mike Mattys |
| |||
| 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 |
| |||
| 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 |
| |||
| 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:
|
| |||
| Re: delete previous pushpin toadd new one.
Hi, I answered in other thread on how to delete all pushpins.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| 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();
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| delete, previous, pushpin, toadd |
| ||||
| 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 | |
| |
| ||||
| 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 |
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.