Discover how a universal Windows application utilizes webview to access Google Maps events

In the process of developing a Universal Windows App (UWA), I have integrated Google Maps using a webview. Using JavaScript and InvokeScriptAsync, I am able to add and remove markers on the map. Now, I am looking to handle events in the opposite direction - such as displaying the longitude and latitude of the mouse location in the UWA or performing specific actions when a marker is selected.

Is it feasible to achieve this functionality?

Answer №1

If you have experience with InvokeScriptAsync, then injecting JavaScript code to track mouse position is already familiar to you here.

To return the tracked mouse coordinates to your application, utilize the C# side's WebView.ScriptNotify event to receive JavaScript events through window.external.notify()

Remember to include the Google Maps page's URI in the ApplicationContentUriRules section of your app's manifest.

I am not acquainted with Google Maps and therefore don't know the URL for it.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Optimal approach for reutilizing Javascript functions

After creating a simple quiz question using jQuery, involving show/hide, addClass, and tracking attempts, I am now considering how to replicate the same code for multiple questions. Would it be best practice to modify all variables in both HTML and jQuery, ...

Leap over in a similar fashion to the provided demonstration

In my attempt to create a unique project, I have created this CodePen example. The goal is to have one ball on the circle that remains in a fixed position, while another rotating main ball must avoid touching it at all costs. Points are awarded for success ...

Elements animated using intersection observer are inconsistently functioning on the current page

My current challenge involves animating elements with the intersection observer, but I am encountering strange behavior with elements that are already on the screen when the page loads. These elements sometimes animate correctly and other times they do no ...

transferring data through hyperlink tags

In PHP, I am currently developing a module that enables me to view and access all the users on my website. To achieve this, I am retrieving all the user names from the database and creating anchor links for them simultaneously. Now, I want to associate dat ...

The data labels in the main chart of a Highcharts column with drilldown appear blurry, with the exception of the columns that have been drilled

When setting up a Column Chart with Drilldown: The main chart displayed data labels in a blurred black color. However, when clicked, the next columns that appear (the drilled down columns) are clear and easy to read (white color, no blur). I discovered a ...

"Enhance user experience with a real-time autocomplete feature in React that triggers an API call whenever

Currently, I am facing a problem while working with React and the autocomplete component of Material-UI. I need assistance in resolving this issue. In the examples of autocomplete that I have come across, it seems like you need to preload all the elements ...

What is the best way to incorporate a mute/unmute button into this automatically playing audio?

Seeking assistance in adding a mute button for the background sound on my website. Can anyone provide guidance on how to achieve this? Below is the HTML code responsible for playing the sound: <audio id="sound" autoplay="autoplay" ...

Struggling to iterate through the children of a variable with the help of express-handlebars?

Currently, I am in the process of developing an application using Javascript along with express, express-handlebars, and MySQL. One of my main tasks is to establish a route that follows the pattern '/viewowner/:ID/scoreboards/:year' where ID sig ...

The best way to efficiently search a JavaScript object or an array of objects is by utilizing the most

In my JavaScript code, I am working with an array of objects like this: var arrayObjs = [ { id:abc123, radius:5.0}, { id:def235, radius:2.5},...] I have been using a for loop to search for a specific object with the id 'def235'. I'm curiou ...

Navigate back to the previous route within the Vue router hierarchy

In my Vue application, I have a Settings page with child routes such as settings/user, settings/addUser, etc. I am looking to implement a back button that when pressed, takes the user back to the specific page they visited within the Settings section. Usin ...

Failing to hide a div on hover: Hoverintent's shortcomings

When I hover over the div with the unique identifier id="navbar", it doesn't seem to trigger any actions. I have included the following script in my document head: <script type="text/javascript" src="https://ajax.googleapi ...

JavaScript API for Tableau

Could you please clarify the functions described below? newViz = createTableauViz(containerDiv, url, options); function listenForMarkSelection() { newViz.addEventListener(tableau.TableauEventName.MARKS_SELECTION, handleMarksSelection); } funct ...

Combining the chosen value from a combo box to display in a label using ExtJs 3.4

In my form panel, I have an Ext combo box set up like this: new Ext.form.ComboBox({ store : routeStore, displayField : 'rName', valueField : 'rName', fieldLabel : 'Select Fixed Route', id : 'routeComb ...

Hidden input fields do not get populated by Angular submit prior to submission

I am in the process of implementing a login feature in Angular that supports multiple providers. However, I have encountered an issue with submitting the form as the loginProvider value is not being sent to the server. Below is the structure of my form: &l ...

Guide in activating popup notification upon form submission in React with the help of React Router navigate hook

I'm facing a challenge in triggering a success pop-up notification after submitting a form in React. The issue arises when the page redirects to a different location using React Router's useNavigate() hook, as there is no direct connection betwee ...

Retrieving an array from a nested JSON structure using $http.get in combination with mongoose and Node.js

In my possession is a JSON representation of an apartment listing: { "_id": { "$oid": "5673d1dcf93fe452d80c2c2c" }, "street": "myStreet", "buildingNumber": 1, "apartmentNumber": 1, "UsersAndQuestions": [ { ...

Execute a Node.JS query using an HTML select dropdown

My goal is to customize queries to a mySQL database based on the user's selection from select options on my website. Here is the HTML code: <select id = "year"> <option value = "yr" selected>Choose a Year</option> <option id = " ...

Experiencing a problem with my JavaScript code in Node.js due to an asynchronous issue arising when using a timeout

My goal with this code is to retrieve JSON questions and present them to the user through the terminal. The user has 5 seconds to respond to each question before the next one appears. However, I encountered an issue where the next question times out automa ...

Troubleshooting EasyZoom: Problems stemming from CSS and markup structure

Despite following the documentation correctly, I seem to be encountering an issue. There are no JavaScript errors and the DOM changes reflect my interactions. However, when I hover over the thumbnail, the larger image remains fixed at 0, 0. Removing the ea ...

Guide on preventing Nunit from closing the browser after each test with Selenium WebDriver in C#

While implementing Nunit for testing Selenium WebDriver in Visual Studio, I have observed that the browser closes after each method annotated with [Test]. Is there a way to avoid this behavior? Is it possible to run multiple tests on the same browser inst ...