我正在使用 GPS,Sim548c
当Google map API
我将它连接到我的 C# 代码时,它给出了距出口位置约 1KM 的错误位置,但是当我使用以下时software
,它给出了 10m 内的出口位置我使用了以下gps cordinats 的一组代码并将其传递给网络浏览器。
if (s.Contains("$GPRMC"))
{
latlon = s.Split('*');
int i=0;
while (!latlon[i].Contains("GPRMC"))
{
i++;
}
//latlon = latlon[i].Split(',');
if (latlon[i].Contains(",A,"))
{
latlon = latlon[i].Split(',');
lat = latlon[3];
lon = latlon[5];
latt = double.Parse(lat.Substring(0,2));
latt += double.Parse(lat.Substring(2, 2)) / 60.0;
latt += double.Parse(lat.Substring(5)) / 3600.0/100.0;
lonn = double.Parse(lon.Substring(0,3));
lonn += double.Parse(lon.Substring(3, 2))/60.0;
lonn += double.Parse(lon.Substring(6))/3600.0/100.0;
//richTextBox1.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate() { richTextBox1.AppendText("Write\n"); }));
richTextBox2.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate()
{
richTextBox2.AppendText(lonn.ToString()+","+latt.ToString()+"\n");
}));
label1.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate()
{
label1.Content = lon;
}));
label2.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate()
{
label2.Content = lat;
}));
Thread.Sleep(1000);
webBrowser1.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate()
{
try
{
webBrowser1.InvokeScript("animate", latt.ToString(), lonn.ToString());
}
catch { }
})
);
}