Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 5 of 5

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

  1. #1
    i3bex is offline 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?

  2. #2
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002
    Posts
    478
    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

  3. #3
    i3bex is offline 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?

  4. #4
    i3bex is offline 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?

  5. #5
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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 ?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Clear previous itinerary
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 11-03-2004, 10:36 AM
  2. Connect pushpins and then remove the symbols?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 08-03-2004, 03:25 AM
  3. How to clear unwanted area in map
    By amrok in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-08-2004, 07:41 AM
  4. Clear Push Pin
    By joshnfay in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 04-26-2003, 10:07 PM
  5. How can I remove the Microsoft MapPoint logo which....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-18-2001, 10:39 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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