Skip to content

Commit

Permalink
change executescript to async mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Archeb committed Nov 24, 2023
1 parent ae341a3 commit 58cd853
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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");
Expand Down

0 comments on commit 58cd853

Please sign in to comment.