MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Linking Waypoints and Pushpins?

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


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 03-25-2008
Junior Member
Yellow Belt
 
Join Date: Nov 2007
Posts: 12
Linking Waypoints and Pushpins?

I am placing Waypoints and Pushpins by iterating through a database that holds coords and a string (for the Pushpin name). I would like to detect whenever a Waypoint location is changed and move the corresponding Pushpin (since I can't label a Waypoint, I want the Pushpin for its label).

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.
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 03-28-2008
Junior Member
Yellow Belt
 
Join Date: Nov 2007
Posts: 12
Re: Linking Waypoints and Pushpins?

Never mind, I figured out a way to do it. Thanks for all the responses.
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 03-29-2008
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,382
Blog Entries: 1
Re: Linking Waypoints and Pushpins?

How did you do it?

Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
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 03-29-2008
Junior Member
Yellow Belt
 
Join Date: Nov 2007
Posts: 12
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.
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
linking, pushpins, waypoints


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/linking-waypoints-pushpins-7364.html

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

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


All times are GMT -5. The time now is 04:57 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

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.


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