Host a Google Maps control in your WinForms or WPF application
C# HTML
Switch branches/tags
Nothing to show
Clone or download
Latest commit c342615 Sep 5, 2017
Permalink
Failed to load latest commit information.
GoogleMapsApi street view demo May 28, 2015
GoogleMapsApiTester remove company name Aug 31, 2015
GoogleMapsApiWpfClient wpf client test May 28, 2015
.gitignore Initial commit May 28, 2015
GoogleMapsApi.sln wpf client test May 28, 2015
LICENSE Initial commit May 28, 2015
README.md Update README.md Sep 5, 2017

README.md

Google Maps Api

Host a Google Maps control in your WinForms or WPF application.

NOTE: The Google Maps Javascript API no longer supports the browsers in the samples, but the implementation is not tied to any specific browser. It will still work correctly with more recent browser controls.

Original

Usage

To use the wrapper, implement the IGoogleMapHost interface and then use the following code for use with a WPF browser:

public void RegisterScriptingObject(IGoogleMapRequired wrapper)
{
    Browser.ObjectForScripting = wrapper;
}

public void SetHostDocumentText(string text)
{
    Browser.NavigateToString(text);
}

public object InvokeScript(string methodName, params object[] parameters)
{
    return Browser.InvokeScript(methodName, parameters);
}

public bool HandleException(string message, string url, string line)
{
    //Log exceptions
    return true;
}

Or for a WinForms browser:

public void SetHostDocumentText(string text)
{
    browser.DocumentText = text;
}

public void RegisterScriptingObject(IGoogleMapRequired wrapper)
{
    browser.ObjectForScripting = wrapper;
}

public object InvokeScript(string methodName, params object[] parameters)
{
    return browser.Document.InvokeScript(methodName, parameters);
}

public bool HandleException(string message, string url, string line)
{
    //Log exceptions
    return true;
}

Then instantiate the wrapper with this line of code:

GoogleMapWrapper.Create(this);