MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




problem in GetLocation();

This is a discussion on problem in GetLocation(); within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hello, I am having a problem while interfacing mine software with GPS Locater. I am getting Lat & Long in ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 04-21-2008
Member
Yellow Belt
 
Join Date: Mar 2008
Posts: 37
problem in GetLocation();

Hello,
I am having a problem while interfacing mine software with GPS Locater. I am getting Lat & Long in text box correctly with mine GPS Locator. But having problem with Lat & Long ... When I click button to find Map.Its give me error ...............at getlocation();
Code:
loc = axMappointControl1.ActiveMap.GetLocation(Lat,Long,Altitute);
Error is:
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: Input string was not in a correct format....


It is giving error as GetLocation(); accepts in double format. I tried this
Code:
string Lat;
string Lon;
/////as I am using some other string varaibles to get NMEA data...
txtLat.Text = Lat;
txtLon.Text = Lon;

double lat = Convert.ToDouble(this.txtLat.Text as string);

double lon = Convert.ToDouble(this.txtLong.Text as string);
Hope to hear from you guys.
Regards.
Nasir
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 04-21-2008
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 217
Re: problem in GetLocation();

Maybe you spelled Altitude wrong (Altitute)?

Mike Mattys
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 04-22-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Re: problem in GetLocation();

Hi,

Quote:
as I am using some other string varaibles to get NMEA data
Do you mean that you use Convert.ToDouble() to convert an NMEA formatted string to a double? NMEA format is not same as a double, it is (d)ddmm.fff(f)
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 04-22-2008
Member
Yellow Belt
 
Join Date: Mar 2008
Posts: 37
Re: problem in GetLocation();

Hello,
Thanks actually I was adding NMEA "GPGGA" data and i converted all in string. But as getlocation(); accepts double format, so I removed N & W from the array of GPGGA and now it works fine. Thanks you vey much once again.................
Nasir
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 04-24-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Re: problem in GetLocation();

Hi,

Just removing the N and W does not make it the right number. Nmea format for latitude is ddmm.fff(f) and for longitude dddmm.fff(f), where (d)dd is degrees, mm is minutes and fff(f) are the fractions of the minutes.

for example latitude: 5030.000 is 50.5 degree witch is what GetLocation wants.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 04-24-2008
Member
Yellow Belt
 
Join Date: Mar 2008
Posts: 37
Re: problem in GetLocation();

Hello,
Thanks. I already did this conversion from DMS to DD & I am getting mine exact location where I am.
Regards.
Nasir
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


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/problem-getlocation-7541.html

Posted By For Type Date
The Magazine for MapPoint - MP2K Magazine This thread Refback 04-22-2008 07:46 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
AddPolyLine dilemma - is it GetLocation here that's problematic ? tfmiltz MapPoint 2006/2009 Discussion 4 11-02-2007 02:40 AM
Speeding up Getlocation queries? Help! Solo4357 MapPoint Web Service and Virtual Earth 0 10-13-2005 02:34 PM
Getlocation in VB .net wallacech MapPoint 2006/2009 Discussion 1 12-11-2003 02:27 PM


All times are GMT -5. The time now is 01:24 PM.


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

Ski Resort in Italy
For a superb value skiing destination look no further than Italy. Book in at a ski resort in Italy to combine great skiing with great cuisine. Holiday Hypermarket offers value for money.

Luxury Holidays
Luxury holidays, family holidays, ski holidays, cruises. Whatever your holiday needs your personal Travel Counsellor can help.

Cape Town Flights
Book Cape Town flights through dealchecker.co.uk to get a great deal. Cape Town has fantastic weather and a wide range of activities to keep you busy.

Holidays in Egypt
A holiday in Egypt will stimulate your mind, captivate your heart and spark your senses. Visit this exceptional country, book today!

Cheap Morocco Holidays
Cheap Morocco holidays may be the answer to your cheap holiday search. With sunshine throughout most of the year it can be great value if you avoid the peak season. Why not include a trip to the small tranquil town of Chefchaouen Tangier in your visit?

Cheap Travel
Travel.co.uk is a travel comparison service which makes it easy to search and find your cheap travel options.

Holidays to Fuerteventura
Come on; jump on the plane to the Canary Islands. Get information on cheap holidays to Fuerteventura 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