spacer1
spacer2 1_1 1_2
2_1
 Subscribe
 The MP2K Update!
 
 
 
 Magazine
Front Cover
What's New
Articles
Toolbar
News
Sample Data
Gallery
Advertise
About
 Features
MapPoint 2006
Press Releases
MapPoint Forums
Companies
Link to MP2Kmag
Wish List
MapPoint Trial
Authors
 Sponsors
 Order

MapPoint 2006

Programming MapPoint in .NET

MapPoint Book

  Spatial Community
ViaVirtualEarth
SVG Tutorials
MapPoint

Map Visitors

 Direct Media

Computer support
Get pro-active monitoring software that identifies problems before they happen and fixes them before you even know they exist!

print cartridges
Need ink cartridges for your printer? With us you can print away without worrying. Ring our freephone before 4pm for same day dispatch!

Cheap flights to Majorca
Majorca has got a little something for everyone. As well as the legendary nightlife there are historical areas to explore. Check it out!

Holidays to Tenerife
When you book with On The Beach, holidays to Tenerife are value for money. We won't be beaten on price! Check us out online.

bulgaria Property
Visit us online for details on how to buy picturesque Bulgarian property in mountain ski resorts or seaside beach resorts.

Goa Flights
Are you searching for flights to Goa? Use dealchecker.co.uk to compare airfare prices and find the best deal available! See online!

Rhodes
Rhodes is one of the most visited of the choice of Greek islands. Why not take your next vacation to this warm and welcoming destination.

  ARTICLES  


Automating MapPoint in C++ With Built In GPS Features Enabled

Jonathan Oppelaar shows how he used techniques to overcome limitations in the MapPoint API to make MapPoint a better navigation platform for Project54, a in-car law enforcement system currently in use in over 1,000 vehicles.

Project54 is currently developing a GPS Navigation application to be used in police cruisers. This navigation application is using MapPoint 2006 as its routing and mapping engine. MapPoint 2006 has an SDK which gives developers software control of MapPoint. With this SDK Project54 developers are able to integrate MapPoint into the Project54 system. However, there are a few limitations to MapPoint’s SDK that need to be resolved before MapPoint can be installed in a car. The first limitation is that there are no API calls to turn GPS Tracking on or off. GPS Tracking is a MapPoint feature that reads data from a GPS receiver and displays your current position on the map. This feature also has the ability to rotate the map, which cannot be done via APIs.

Driving Guidance is another MapPoint feature that cannot be controlled by the SDK. Driving Guidance displays turn by turn directions while a user is driving along a route. These directions are also presented to the user through speech. A status bar is shown to keep the user up to date with progress on a certain road segment.

These limitations must be overcome if we want to use MapPoint as the navigation backbone in the Project54 system. This article is about my workaround to MapPoint’s SDK that allows developers to enable MapPoint’s GPS Tracking and Driving Guidance.

I chose to develop a solution in C++ because I am most familiar with that language and Project54 applications are written using C++. Unfortunately for C++ developers, almost all resources for MapPoint are given in C# and VB. Since Project54 is COM based it would have been possible to write an application using C# or VB and incorporate it into Project54 but, that is not as clean of a solution and would require more work.

After researching my problem on the Internet I was able to find an article (1) that discusses how to use Windows messages to control MapPoint. In this article Paul Larson describes his API that can control MapPoint’s window panes as well as the check boxes in the panes which enables the GPS Tracking and Driver Guidance. I also found an article (2) that gives an example on how to automate MapPoint in C++.

With the combination of these two articles and other resources (3, 4, 5) I was able to write an application that integrates MapPoint into Project54. Unfortunately, even after enabling the Driving Guidance by help of Paul Larson’s code, the turn by turn directions would not update. The only message given by the guidance was "Proceed to Route". This seemed odd to me because the turn by turn direction update perfectly when I would run MapPoint.exe outside of Project54.

This led me to try something different than what is the suggested way to start MapPoint. Every example I have come across initializes MapPoint using the CreateInstance (LPSTR clsid) (in C++) function call. This returns a COM pointer to the MapPoint application. You need this pointer in order to call any of MapPoint’s APIs. My approach was to use CreateProcess (LPSTR path) to open MapPoint.exe and then get a pointer to the application that is already running. I am able to do this by calling the GetActiveObject (LPSTR clsid) function. This function returns the application pointer to an active COM object.

Now that MapPoint is initialized differently, the Driving Guidance works perfectly. Also, no other code has to be altered. I cannot tell you why the driving directions did not work with the original solution but, I can tell you that when the new method is applied there are no issues enabling the GPS Tracking and Driving Guidance by windows messages. Figure 1 shows a screenshot of my application running with turn by turn direction working.


Figure 1. Screenshot of working GPS Tracking and Driving Guidance

My MapPt class Initialization Code:

This topic originally appeared as a post on ECEBlogger.

Resources:
1. An API to Control MapPoint 2006 GPS Features - Part I of II by Paul Larson
2. Map Forums - http://www.mapforums.com
3. Thota, Chandu, Programming MapPoint in .NET. O’Reilly Media, Inc 2006
4. MapPoint on MSDN - http://msdn2.microsoft.com/en-us/library/aa286510.aspx
5. GetActiveObject Support - http://support.microsoft.com/kb/238610
6. Project54

Discuss this story in the forum.

Author: Jon Oppelaar
Email: jonathan.opp(AT)gmail(DOT)com
URL: pubpages.unh.edu/~jeo/webpage/index.htm
Jon Oppelaar attends the University of New Hampshire where he is a research assistant in the Project54 lab. He received his B.S. in computer engineering in 2006 and is currently pursuing his M.S. in electrical engineering. He has developed a car navigation system using MapPoint 2006 and he is currently studying human interaction with today's GPS navigation systems and ways to enhance the safety of the user experience with navigation systems.



Google
 
MP2Kmag Internet


 Recent Discussion
-T-mobile UK
-Virtual Earth and OpenLayers
-Reminder: Microsoft Virtual Earth Partner Webinar and Offer for Free Training
-Virtual Earth Quarterly Technical Briefing
-Customize User Page
-Information about area
-Territory information
-Gps task pane in ActiveX
-Worldwide Telescope Now Available!
-c++ - setting the color of a line
-Initial Costa Rica MapServer map is up & running!
-Satellite Images of Myanmar Cyclone Damage
-Virtual Earth Loyalist: Aerial View
-Leaving messages on the Virtual Earth for Government blog site
-Virtual Earth Webcast: Adding Mapping Capabilities to your Applications with Virtual Earth
-Get new Lat & Lon from speed
-Integrating Virtual Earth Maps and Excel 2007
-Zillow.com
-ADODB Recordset to MapPoint.DataSet
-Why my new phone isn't an iPhone
-Version 6.0 to 6.1 Auto-Upgrade Alert & V 3-5 Deprecation Reminder
-Accessing MultiMap in the UK. Plus a comparison of UK mapping sites.
-Duplicate double-clicking State name in code?
-Multi-multi-core AMD chips
-Graticule Grids in Virtual Earth
 Resources
Browse GIS books and periodicals
Best Car Contract Hire Lease Save
Find a MapPoint Partner or Consultant
Real Estate Columbia, MO


Want Your Site To Appear Here?

   © 1999-2008 MP2K. Questions and comments to: website@mp2kmag.com
  Microsoft and MapPoint 2002/2004/2006 are either trademarks or registered trademarks of Microsoft.

• Replacement Cordless Phone Batteries from DSMiller
Improve your career with a computer degree LocalEDU.com
• Tim Cohn's Marketing Strategy Consultancy
• Buy Toner, Ink Cartridges & Drums at Marquee Office Solutions
• Looking for Dry Erase Boards? See Dry Erase Boards
• 5339 - We Know Bikes: Road Bikes / Triathlon Bikes / Mountain Bikes / BMX Bikes
• Buy Your Car Used Cars, Car Lease and Contract Hire