diff --git a/MainForm.cs b/MainForm.cs index d40fb60..47d2948 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -694,7 +694,7 @@ private void FocusMapPoint(int hopNo) { try { - mapWebView.ExecuteScript(@"window.opentrace.focusHop(" + hopNo + ");"); + mapWebView.ExecuteScriptAsync(@"window.opentrace.focusHop(" + hopNo + ");"); } catch (Exception e) { @@ -709,13 +709,13 @@ private void ResetMap() switch (mapWebView.Url.Host) { case "geo-devrel-javascript-samples.web.app": - mapWebView.ExecuteScript(OpenTrace.Properties.Resources.googleMap); + mapWebView.ExecuteScriptAsync(OpenTrace.Properties.Resources.googleMap); break; case "lbs.baidu.com": - mapWebView.ExecuteScript(OpenTrace.Properties.Resources.baiduMap); + mapWebView.ExecuteScriptAsync(OpenTrace.Properties.Resources.baiduMap); break; } - mapWebView.ExecuteScript("window.opentrace.reset(" + UserSettings.hideMapPopup.ToString().ToLower() + ")"); + mapWebView.ExecuteScriptAsync("window.opentrace.reset(" + UserSettings.hideMapPopup.ToString().ToLower() + ")"); } catch (Exception e) { MessageBox.Show($"Message: ${e.Message} \nSource: ${e.Source} \nStackTrace: ${e.StackTrace}", "Exception Occurred");