Community of VE/MapPoint Users and Developers
This is a discussion on Linking Waypoints and Pushpins? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am placing Waypoints and Pushpins by iterating through a database that holds coords and a string (for the Pushpin ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Linking Waypoints and Pushpins? Since these are inherently linked in my database, what I really need to do is to detect the Waypoint move and update the database with its new coordinates (then re-plot the route from the database). I have tried the SelectionChange and MouseUp events, but the firing order of those two events always makes the update one step behind. Any suggestions to accomplish the "tracking" of a Pushpin so that it always follows the dragging of a Waypoint? Thanks. |
| |||
| Re: Linking Waypoints and Pushpins?
A lot of workarounds. I worked from the selection of a PushPin rather than its associated WayPoint. Creating the route: As mentioned originally, I have a database that contains the fields Route(string), Lat (double), Lon (double), StopName (string), and Seq (integer). The user can build the route by placing Pushpins from a context menu (I intercept right-click and pop up a menu). The table is filtered against the Route field. Upon the selection of a route, I clear any existing Routes and Pushpins, then iterate through the table and place Pushpins/Waypoints at the associated Lat and Lon values, as well as assign the Waypoint.ListPosition to the Seq field of the DB. When done, I call the Calculate method. Detecting a moved Pushpin: I used the SelectionChange event and QueryInterface method to test for a pushpin. Then, I set a global pushpin var to the NewSelection. In the MouseUp event, I re-queried to ensure that the selection was a pushpin (superfluous, but it didn't cost anything). If it was, then I started a 50ms timer. This is needed because the new position of the Pushpin isn't "set" until after the completion of the MouseUp event. The timer event self-disables, and tests the current selection for (you guessed it) a Pushpin. I created a function called CheckMove that iterates through the underlying database table and locates the proper record based on the Seq (ListPosition) field in the DB. When located, if either Lat or Lon has changed, then it returns true. If true, I call a procedure, RefreshMap that updates the change to the underlying database (using the Dataset.Locate method and the Seq/ListPosition). Finally (whew), I clear and recreate the map from the updated DB. The result: Any time that a Pushpin is moved, the Waypoint follows it and the route is updated. I allow only the selection/move of Pushpins; any selection of a Waypoint is transferred to its associated Pushpin. I hope that this rather long description is coherent. It would have been a trivial matter if only there were a few drag/drop or "symbol moved--oldposition/newposition" types of events. Alas, I was relegated to this rather klunky method. |
![]() |
| Tags |
| linking, pushpins, waypoints |
| ||||
| Posted By | For | Type | Date | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 03-27-2008 08: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 |
| Routes from Pushpins and do not show Waypoints | alister55 | MapPoint 2006/2009 Discussion | 1 | 01-03-2006 03:08 PM |
| linking points | starbuck | MapPoint 2006/2009 Discussion | 2 | 01-09-2005 11:56 AM |
| pushpins waypoints & showfinddialogue | Anonymous | MapPoint 2006/2009 Discussion | 0 | 03-15-2003 04:35 AM |
| Linking a map to a map | Anonymous | MapPoint 2006/2009 Discussion | 1 | 01-10-2003 11:21 AM |
| transfer waypoints and pushpins to your GPS | Evert | MapPoint 2006/2009 Discussion | 1 | 08-14-2002 01:51 PM |
Late Deal Ski Holidays
Book late deal ski holidays for great value at Holiday Hypermarket. Our ski holidays search makes it easy to find a late deal to suit you.
City Breaks
Book a city break with Travel Counsellors. A personal travel advisor will help you make the most of your city break.
Italy Holiday
An Italy Holiday is full of interesting stuff for the casual tourist and even more for the educated visitor. Check out the latest great deals at dealchecker.co.uk.
Holidays to Antigua
The Holiday Place has fantastic deals on holidays to Antigua. Visit our website to view special offers on holidays to the Caribbean.
Cheap Canaries Holidays
Are you hunting down cheap Canaries holidays? Well check out ulookubook.com to bag a great value holiday. There are numerous festivals taking place all year round. Why not book your holiday around one?
Travel Tickets
Travel tickets need not always be expensive. Check out your best travel comparison site, Travel.co.uk
Cheap Holidays in Lanzarote
Now's the time to get up and go visit the Canary Islands! View cheap holidays in Lanzarote only at On The Beach.