Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interactive Google maps on a C# winform

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?

like image 932
tsilb Avatar asked Aug 05 '14 22:08

tsilb


People also ask

How do I make Google Maps interactive?

Create a new map by signing into your Google account, clicking the Map icon. 3. Then click the hamburger menu (in the top left hand corner) and then click “Your Places” (about half way down) Page 2 2 4. Click the “Maps Tab” then click, “Create Map” down the bottom.

Can I connect Google Maps to my car?

For easy and reliable navigation, use the Google Maps app in your car. Maps will guide you with real-time traffic information to find the best route to your destination.

Is there a live Google Earth?

You can use Google Earth, the platform that enables you to view any place on Earth -- including terrain and buildings, galaxies in outer space and canyons of the ocean -- to view live images. To be able to view Google Earth live you need to install their client software.


1 Answers

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.

like image 193
Marcel N. Avatar answered Sep 28 '22 05:09

Marcel N.