public void GetCurerntLocation() { #if UNITY_EDITOR Vector2 currentGps = new Vector2(104.067304f, 30.597963f); #else String location = UnityHelper.GetBDGPSLocation(); // Debug.Log("GPS::::::::::" + location); JsonData zb = JsonMapper.ToObject(location); float x = float.Parse(zb["longitude"].ToString()); float y = float.Parse(zb["latitude"].ToString()); Vector2 currentGps = new Vector2(x, y); #endif GetNearEastPointList(currentGps); if (nearIndexList.Count != 0) { PushPointinformation(); } }
/// <summary> /// 页面加载完毕回调事件 /// </summary> private void WebView_OnPageFinished(UniWebView webView, int statusCode, string url) { Debug.Log("加载完毕" + statusCode + "***"); try { TrackUIManager.Instance.LoadComplete(); String location = UnityHelper.GetBDGPSLocation(); JsonData zb = JsonMapper.ToObject(location); string x = zb["longitude"].ToString(); string y = zb["latitude"].ToString(); string jsString = @"PanTo(" + x + "," + y + ");"; Debug.Log(jsString); webView.EvaluateJavaScript(jsString, CompletionHandler); } catch (System.Exception ex) { } SpawnPointToMap(); }