Interactive Google maps on a C# winform

20,160

Almost missed the part where you said you're willing to replace the web version with something else.

Have a look at Great Maps - for Windows Forms and WPF. It is a custom WinForms control you can drop on a form.

It supports a lot of map providers, Google Maps included. They have a demo with which you can play and see how it works and how it can be integrated.

From experience, I can say that it is possible (quite easily) to bind to map events (marker clicked, double clicked as well).

Something worth noting is that using Google Maps with it might violate Google's terms of use (you also get a warning in the demo app). You can always explore some of the free providers, like OpenStreetMap.

Share:
20,160
tsilb
Author by

tsilb

Updated on September 21, 2021

Comments

  • tsilb
    tsilb over 2 years

    I have an application with Google maps in it. Currently the maps are rendered in a WebBrowser via the Maps Javascript API.

    I have a requirement to make the map interact with the application. Specifically, I have placed markers on the map. The winform needs to register when one of them is clicked, double clicked, etc. and know which one it was. If the user right-clicks on a blank area on the map, I need some way of registering both where to draw the context menu and the lat/long that pixel represents geospatially.

    I don't care whether the map remains in a webbrowser control or is replaced with something else. If needed, I can tear the whole thing out and put a new map in there - but it should be Google (because we have the expensive enterprise API) and it absolutely has to remain inside the winform.

    How can I accomplish this interactivity?