MapPoint Forums

MapForums

Community of MapPoint and Bing Maps Users and Developers




Clear/Remove all Pushpins in Mappoint?

This is a discussion on Clear/Remove all Pushpins in Mappoint? within the MapPoint Desktop Discussion forums, part of the Map Forums category; Is there a way to remove all pushpins? How would you do it? I have tried 'objPin.delete()', where objPin is ...


Go Back   MapPoint Forums > Map Forums > MapPoint Desktop Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-04-2005
Junior Member
White Belt
 
Join Date: Oct 2005
Posts: 3
Clear/Remove all Pushpins in Mappoint?

Is there a way to remove all pushpins? How would you do it?
I have tried 'objPin.delete()', where objPin is 'Mappoint.Pushpin', but it only deletes the last Pushpin created. I need something such as 'objPin.deleteAllPushpin().

I am writing an application using Mappoint. I have only a week to write and test the program.

To give you a complete understanding, here is my semi pseudocode:

Code:
- Load Map
- Start Timer with 5 seconds interval (run code below every 5 seconds)
	- [b]Clear all 'Pushpins' and 'BalloonStates'[/b] 
	- Check SQL database for entries in the previous 5 Seconds
	- If entry found, 
		- For each record,
			- Place 'Pushpin' on location
			- Display 'BalloonState' for pushpin
	- Else (No records were found for the last 5 seconds)
		- Retrieve the 1st record
		- Place 'Pushpin' on location 
		- Display 'highlight' for Pushpin
      - Display 'Balloonstate' for Pushpin
Can you please point me to the right direction?
__________________
____________________________
Do you have any job opennings?
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 10-05-2005
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
The best way to delete all pushpins is to delete the dataset. You can loop thru the datasets to "get" the one you want to delete. You do not want to loop thru the pushpins and delete them one by one if you have alot of pins it could take a while. Hope this code snippit helps.

Code:
Dim objmap As MapPointCtl.Map
Set objmap = MappointControl1.ActiveMap
Dim objDataSet As MapPoint.DataSet

For Each objDataSet In objmap.DataSets
  If objDataSet.Name = "My Pushpins" Then
    objDataSet.Delete
     MsgBox "Deleted Dataset"
      Exit For
  End If
Next
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
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 10-05-2005
Junior Member
White Belt
 
Join Date: Oct 2005
Posts: 3
thanks!

John:

Thanks for the reply. I will try it and let you know if it solves my problem or not.

Thanks again.

I3bex
__________________
____________________________
Do you have any job opennings?
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 10-10-2005
Junior Member
White Belt
 
Join Date: Oct 2005
Posts: 3
John:

As I have promised, here I am ...

The solution you have provided me clears the pushpins and balloonstates If I open a Data Map that is created using mappoint 2004. However, If the dataset is created using programmatically imported data ('MapPoint.Map.DataSets.ImportData()' ), it does not delete it.

The second problem with my application is that it is too slow to process in less than 1 second time interval.

Does anybody know a better way of doing this:

Data Sources:
1) Access Database - > is updated frequently (in seconds)
Data it holds: Store, Salesman, Time, Item, Price

2) Excel spread Sheet - >
Data It holds: Store Name, address (location) of stores

Steps:

1) Clear all pushpin and BalloonState
2) Display pushpins for all locations in the Excel file

3) Retrieve data inserted in Access database for the last 5 seconds (SELECT * FROM xtable Where Time > DateTime.Now.Second - 5 )
4) When Store Name from Access Database is equal to Store Name from Excel File, display pushpin and balloon for those particular addresses
5) Repeat step 1, 2, 3, 4 & 5 ( Timer control with 1 min interval)

The bold steps are what I am having trouble with
I would really appreciate any help!

i3bex
__________________
____________________________
Do you have any job opennings?
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 10-12-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Location: Belgium
Posts: 2,318
Hi,

As far as I understeand you, you have no problem do the bold things, but you have a problem with the speed as several times a second there is update. Is this correct ?

How manu pushpins you have to delete / display, and in which interval ?
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
clear or remove, mappoint, 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
Clear previous itinerary Anonymous MapPoint Desktop Discussion 4 11-03-2004 10:36 AM
Connect pushpins and then remove the symbols? Anonymous MapPoint Desktop Discussion 4 08-03-2004 03:25 AM
How to clear unwanted area in map amrok MapPoint Desktop Discussion 1 03-08-2004 07:41 AM
Clear Push Pin joshnfay MapPoint Desktop Discussion 1 04-26-2003 10:07 PM
How can I remove the Microsoft MapPoint logo which.... Anonymous MapPoint Desktop Discussion 1 07-18-2001 10:39 PM


All times are GMT -5. The time now is 01:24 PM.


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



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 60 61 62 63 64 65 66 67