public static void OnGetGPSInfo(LBSModel args) { if (LBS.GetGPSInfoEvent != null) { LBS.GetGPSInfoEvent.Invoke(null, args); } }
void getGPSInfo_ActualMethod(LBSModel args) { if (args.IsComplete == false) { string msg = "{0}".FormatWith(args.ExceptionInfo); System.Diagnostics.Debug.WriteLine(msg); this.ErrorMsg = msg; this.CurrentLBSModel = null; return; } if (args.IsSuccess == false) { string msg = "{0}".FormatWith(args.BusinessExceptionInfo); System.Diagnostics.Debug.WriteLine(msg); this.ErrorMsg = msg; this.CurrentLBSModel = null; return; } this.ErrorMsg = string.Empty; //if (args.Address.IsNullOrWhiteSpace() == false && args.Address!="未知") // 对于地址有业务要求, 可以开启 if 注释 { string paramStr = $"lng={args.Longitude}&lat={args.Latitude}&address={args.Address}"; if (args.GPSInfoType.Contains("离线") == false) { if (Url.IsNullOrWhiteSpace()) { string UrlBase = @"http://116.255.187.86:18888/TestByHowe/index.html"; // TODO urlbase 改为全局参数 Url = $"{UrlBase}?{paramStr}"; } else { string jsScript = $"update('{paramStr}')"; mWebView.EvaluateJavaScriptAsync(jsScript); } } this.CurrentLBSModel = args; } }
private void OnGetGPSInfoHandler(object o, LBSModel args) { Device.BeginInvokeOnMainThread(() => getGPSInfo_ActualMethod(args)); }