How to use the Google Maps API on a Windows Form in C #?

0

I'm having trouble on how to do this. My TCC has a tab where an address appears (Label), where, when clicking, I want the address to appear in Maps. I've already thought about using WebBrowser, but I do not want the user to navigate beyond that address.

I want this window to appear. But I do not know what to do.

    
asked by anonymous 17.07.2018 / 02:29

1 answer

0

You have not said whether these addresses will be static or not. If it's static, you can do this:

  • Search for each location on the google maps website and adjust the zoom level, terrain type, and so on.

  • >
  • Click Embed Map, make the necessary adjustments, and copy the generated code. Do this for each address.
  • Add to your form a WebView and every time you click on an address you call the function below passing as a parameter the code generated by each address in google.
  • In this way WebView will only display the portion of the map you have chosen Code:

    public void updateWebView(string codigoIncorporado)
    {
        webBrowser1.Refresh();
        var str = "<html><head></head><body>" + codigoIncorporado + "</body></html>";
        webBrowser1.DocumentText = str;
    }
    
        
    18.07.2018 / 23:07