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 9 of 9

Prevent Pushpin/Waypoint deletion

This is a discussion on Prevent Pushpin/Waypoint deletion within the MapPoint Desktop Discussion forums, part of the Map Forums category; I use a list to manage my routes. I want the user to be able to interact with the map ...

  1. #1
    EdB
    EdB is offline Member Green Belt
    Join Date
    Aug 2002
    Posts
    56

    Prevent Pushpin/Waypoint deletion

    I use a list to manage my routes. I want the user to be able to interact with the map (click on pushpins, zoom, etc...) But I do not want the user to be able to delete pushpins or waypoints. Is there any way to do that?

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    Yes you can do a lot of things but the most easy one is I think to prevent the user to select an objedt (or select a particular object). I hr cannot selelt he cannot delete eh

  3. #3
    EdB
    EdB is offline Member Green Belt
    Join Date
    Aug 2002
    Posts
    56
    The won't work for me. In another ? that I believe you answered for me, I needed to be able to respond to them selecting a pushpin and subsequently, identifying the entry in my list.

    I need the interactive ability.

    However, what I need does not seem to be there, and that would be a "BeforeDelete" event capture. Any other suggestions?

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    I do not underateand. Is it a problem to prevent a user to select the object that you wants to prevent from deleting ? Please explsin again so that I understeand more clearly.

  5. #5
    EdB
    EdB is offline Member Green Belt
    Join Date
    Aug 2002
    Posts
    56
    I have a tree control that represents the stops on the route. If they remove the item from the routes via the tree control, everything is fine. However, if they delete the pushpin directly, my tree control no longer accurately represents the route. I can capture that they have selected a pushpin on the map, but I do not see any way of determining if they:

    A) Delete the pushpin
    B) Move the pushpin
    C) Add a pushpin

    I want to prevent these actions while continuing to allow them to select a pushpin (this makes it MUCH easier to find the item in the tree control) and zoom in and out on the map.

    Does that clarify it?

    Thanks in advance. Ed

  6. #6
    Mohamed is offline Member Green Belt
    Join Date
    Mar 2005
    Posts
    97
    Hi,

    What I did concerning that:

    1° - Create 2 Public variables in your application representing the Lat and Lon where the user is clicking in the Control ( xCoord, yCoord )

    - In the initilalization of your Control, add a BeforeClick function ( Just_Get_X_Y_Coordinates ) to save always the xCoord and yCoord variables

    //************************************************
    PROCEDURE Just_Get_X_Y_Coordonnees(Button, Shift, X, Y,bCancel=Vrai)
    xCoordonnee = X
    yCoordonnee = Y
    //info("Coordonnées du clic : " + x + "," + y)

    RENVOYER Null
    //************************************************

    2° Use some function of ReverseGeocoding to get the Lat and Lon of xCoord and yCoord ( a large litterature about that exists in this forum )

    2° For each PushPin Added, you had to save his Lat/Lon somewhere
    ( for instance in a string in PushPin Note Property where you do a concatenation of Latitude and Longitude;- so each PushPin has a unique value concerning that- and you have to save this information in a file or in a List that the user cannot see directly)

    3° When somebody clicks on a PushPin, you have to test if it's a PushPin Object. If Ok, compare the Latitude an Longitude of xCoord+yCoord of clicking with the the Lat an Lon saved in the pushpin Note Property or in the file created and decide what to do ( give a message to the user that deleting or moving is forbidden ) .

    It's what I did, and it works very well, not to prevent deleting or moving Pushpins but to prevent creating a New PushPin with the same Lat and Lon. But it's the same mechanism.

    Basically, the idea is to know what are the cooridates where the user in clicking ( to delete, to move or to do something else ), and to compare those coordinates with the ones saved somewhere concerning your objects.



    Regards

  7. #7
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi Mohamed,

    You are a value to this forum
    BTW: your English is beter and better ... Also mine

  8. #8
    EdB
    EdB is offline Member Green Belt
    Join Date
    Aug 2002
    Posts
    56
    Mohamed,

    I follow the logic of storing what I had for pushpins and coordinates.

    I think the problem I have with that is that if Select a pushpin, it obviously triggers the selection change event. But, if I then press the delete button, it does not. I need something to trigger the fact that that has occurred.

    Ed

  9. #9
    Mohamed is offline Member Green Belt
    Join Date
    Mar 2005
    Posts
    97
    Hi,

    If you precise more the question, I will see that tonight.
    How do you parameter Button, Shift, and bCancel
    in your Beforeclick function ?
    You know that you can play with that parameters?

    Regards

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. can't prevent MP from optimizing stops ???
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 12-02-2003, 12:10 AM
  2. Check if a waypoint and a pushpin exist
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 08-19-2003, 10:27 AM
  3. Pause MapPoint Display (prevent close)
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 10-29-2002, 06:56 PM
  4. How to prevent Save map dialog appearing?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-21-2002, 08:05 PM
  5. How do I prevent old/previous entries that I typed....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-11-2002, 01:10 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