Oscar
Oscar

Reputation: 1

Using Google Maps for work in C#

I'm trying to use Google maps API from a Desktop app (C#), for doing this we use a resource file that contains an HTML file from which we load the maps-api. What we do is load HTML in a WebBrowser Control from windows Forms, from which we use the google earth plugin for 3D visualization and also use the google maps API for geocoding, sometime we also load some KMZ's in that Control.

If we don't use a licensed API the app works, but when we try to use a licensed API, we must register an URL and sign it to be able to use the maps API for work, but it only can be done from a Internet URL.

Is there another way of using a "work" API for desktop apps?

Kind Regards

Upvotes: 0

Views: 288

Answers (1)

mensi
mensi

Reputation: 9826

The "authorized URL" you need to register depends a bit on the web browser control you are using. Local files for example usually get a referrer with a file:// URL (eg. file:///C:/somefile.html)

With an embedded resource, it highly depends on the implementation, but you should be able to use alert(window.location.href) or something similar inside a script block in your embedded HTML to get the proper URL.

Note that the support portal does not allow arbitrary protocols in URLs at the moment, so you might need to contact Google for Work Support if you require special protocols.

Upvotes: 1

Related Questions