Community of MapPoint and Bing Maps Users and Developers
This is a discussion on MapPoint 2010 GPS API within the MapPoint Desktop Discussion forums, part of the Map Forums category; Apparently mappoint 2010 has new API features to toggle GPS tracking and navigation. Has anyone gotten these to work? I ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| MapPoint 2010 GPS API I try doing this: map.GPSNavigation.Tracking = true; And I get unauthorized access errors.... Any ideas guys? |
| |||
| Re: MapPoint 2010 GPS API
Ive managed to get it to open the GPSpane, where I can manually click start tracking. map.Application.PaneState = GeoPaneState.geoPaneGPS; Unfortunately I still can not get it to activate through code. Also, how do I get the current lat and long coordinates? Come on Microsoft, why is there so little support in such essential API features? |
| ||||
| Re: MapPoint 2010 GPS API
It's a bit of a hack, but Paul Larson wrote an article and posted some sample code a while back -- An API to Control MapPoint 2006 GPS Features - Part I of II - MapPoint Articles - MP2K Magazine Maybe that can help? Eric
__________________ |
| |||
| Re: MapPoint 2010 GPS API
Thanks for the reply, Ive taken a look at that and unfortunately it's written in VB which I have no experience in (I'm using c#). I though the 2010 API was supposed to have support for this... |
| |||
| Re: MapPoint 2010 GPS API
Hy! I have the same problem here. Code: map.ActiveMap.GPSNavigation.Navigation = True Showing the GPS pane crashes, so does GeoPaneState.geoPaneMapSettings I've got a "The parameter is incorrect". Is there something to do before using GPS navigation and tracking? I didn't see anything in MapPoint's Help (there is a programming section). And nothing on TechNet neither... |
| ||||
| Re: MapPoint 2010 GPS API
Works for me and I'm even indoors! Going by your error it sounds like you are referencing an older API. Make sure you set your COM interface to point to MapPoint 2010. For my quick little test sample I used MapPoint Europe 2010, but that was because the North American edition's COM server wasn't properly registered on my dev PC. Also note that the GPSNavigation object will throw a COM Exception if you try to do things with it (eg. switch tracking on) if you do not have a GPS device installed and configured (and recognised by MapPoint). Configure it manually with MapPoint first to make sure it is working. The exception's text makes it clear that MapPoint does not think there's a device attached. Here's the code (built as a command line C# program and run in debug mode, but this doesn't matter): Code: using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Win32;
using System.Runtime.InteropServices;
namespace MapPointGPSTest
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Starting...");
MapPoint.Application myApp = new MapPoint.Application();
myApp.Visible = true;
MapPoint.Map myMap = myApp.ActiveMap;
MapPoint.GPSNavigation nav = myMap.GPSNavigation;
Console.WriteLine("Got the nav object");
nav.Tracking = true;
Console.WriteLine("Press return to exit");
Console.ReadLine();
}
}
}
Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools See the Geoweb Guru for online mapping |
| ||||
| Re: MapPoint 2010 GPS API
And for the record, nav.Navigation=true also works but didn't do anything as I didn't have a route defined. Other gotchas in the documentation: The GPSNavigation object is disabled when the map is embedded in an OLE control (eg. inside MS Word or Access). Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools See the Geoweb Guru for online mapping Last edited by Winwaed; 04-02-2010 at 09:17 PM.. Reason: improved the English |
| |||
| Re: MapPoint 2010 GPS API
Hi! I got the GPSPane to work. But enabling Tracking and Navigation using code doesn't work. What do you mean by OLE stuffs? If I'm developing a Windows Form application, using the MapPoint OCX, will it work? Or not... Sorry but I'm not a pro developer... I prefer Network/System managing ^^ Btw... I'm using MapPoint North America 2010, but I'm in Europe. I get a valid position, even on the map. But I can't create any route because the soft doesn't know European roads. I wanted to install MapPoint Europe 2010 too but only the 2009 version is available on my MSDNAA account! |
| ||||
| Re: MapPoint 2010 GPS API
An OCX control might be restricted - I rarely use the MapPoint control, but some features are restricted (typically for practical or copyright/branding reasons). I know my installation of MapPoint Europe 2010 came from MSDN so you might want to check again or to check your subscription level. Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools See the Geoweb Guru for online mapping |
| |||
| Re: MapPoint 2010 GPS API
Hi Richard, Can you attempt this with the ocx control? If it is indeed restricted, how can I get this feature working embedded into my application? I have not tried out your code, but from the looks of it, it opens an instance of that mappoint application (similar to running the exe manually), and turns on the gps tracking, am I correct in assuming this? If this is the case, and there is no work around for the ocx control, do you think it would suffice to create a transparent panel with the mappoint application behind it? Simulating the appearance of a control. Let me know what you think, thank you. Matt |
![]() |
| Tags |
| 2010, api, gps, mappoint |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MapPoint 2010 Information | Eric Frost | MapPoint Desktop Discussion | 37 | 06-04-2010 10:11 AM |
| MapPoint 2010 Europe | LochyHood | MP2K Magazine Articles | 4 | 02-05-2010 02:53 AM |
| Mappoint 2010 | lacja | Development | 6 | 12-22-2009 12:16 PM |
| Mappoint 2010 / Streets and Trips 2010 | dpendell | MapPoint Desktop Discussion | 2 | 11-23-2009 12:34 PM |
| MapPoint 2010 Pushpins | xjack | Development | 0 | 10-04-2009 07:16 AM |