0

I am creating a UWA and I need to interact with google maps. I have added Google maps at a webview and I am capable to add/remove markers via javascript and InvokeScriptAsync. Now I need to handle events on the opposite way. For example show at UWA the lon and lat of the mouse location or by selecting a marker to do some work at the UWA.

is that possible?

Reven
  • 609
  • 3
  • 9
  • 17

1 Answers1

1

If you are already using InvokeScriptAsync, then you know how to inject JavaScript code that tracks mouse position.

To send the tracked mouse locations back to your app, you can use the WebView.ScriptNotify event on the C# side to receive events from JavaScript via window.external.notify()

Note that you will need to add the Google Map page's URI to the ApplicationContentUriRules section of your app's manifest.

I haven't used Google Maps before, so I don't know this url.

Greg Thatcher
  • 1,303
  • 20
  • 29