I am creating an application that interfaces with Google's Maps API v3. My current approach is using a WebBrowser
control by WebBrowser.Navigate("Map.html")
. This is working correctly at the moment; however, I am also aware of WebBrowser.InvokeScript()
. I have seen this used to execute a javascript function, but I would like to have something like the following structure:
APICalls.js - Contains different functions that can be called, or even separated out into a file for each function if necessary.
MapInterface.cs
WebBrowser.InvokeScript("APICalls.js", args)
- Or control the javascript variables directly.
I have seen the InvokeScript
method used, but none of the examples gave any detail to the source of the function, so I'm not sure if it was calling it from an html file or js file. Is it possible to have a structure like this, or a similarly organized structure, rather than creating an html file with javascript in each one and using Navigate()
?
Additionally, are there any easier ways to use Google Maps with WPF. I checked around, but all of the resources I found were at least 2-3 years old, which I believe is older than the newest version of the maps API.