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?
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 ...
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?
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![]()
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
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?
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.
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
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
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
Mohamed
www.AtlasCouscous.com
Hi Mohamed,
You are a value to this forum
BTW: your English is beter and better ... Also mine![]()
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
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
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
Mohamed
www.AtlasCouscous.com
There are currently 1 users browsing this thread. (0 members and 1 guests)