/// <summary> /// 获取gps /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gps1_GotLocation(object sender, GPSResultArgs e) { try { if ((e.isError).Equals(false)) { if (e.Longitude != 0 & e.Latitude != 0) { ATemplate.AT_Longitude = (decimal)e.Longitude; ATemplate.AT_Latitude = (decimal)e.Latitude; ATemplate.AT_Positions = e.Location; lblAddress.Text = ATemplate.AT_Positions; } else { throw new Exception("定位失败!"); } } else { throw new Exception("定位失败!"); } } catch (Exception ex) { Toast(ex.Message, ToastLength.SHORT); } }
private void gps1_GotLocation(object sender, GPSResultArgs e) { lb_Latitude.Text = e.Latitude.ToString(); lb_Longitude.Text = e.Longitude.ToString(); lb_Location.Text = e.Location.ToString(); BD09_Latitude.Text = e.ToBD09().Latitude.ToString(); BD09_Longitude.Text = e.ToBD09().Longitude.ToString(); GCJ02_Latitude.Text = e.ToGCJ02().Latitude.ToString(); GCJ02_Longitude.Text = e.ToGCJ02().Longitude.ToString(); }