ThinkGeo.com    |     Documentation    |     Premium Support

googleMapsOverlay Credentials

Hello team,
My organization just purchased thinkgeo map suite desktop recently. I’m trying to use GoogleMapsOverlay in my WPF application. GoogleMapsOverlay needs ClientId and PrivateKey as follows:

GoogleMapsOverlay googleMapsOverlay = new GoogleMapsOverlay();
googleMapsOverlay.MapType = GoogleMapsMapType.Satellite;
googleMapsOverlay.Name = “Google Maps Satellite”;
googleMapsOverlay.ClientId = " ";
googleMapsOverlay.PrivateKey = " ";

I looked at this link:
https://developers.google.com/maps/documentation/directions/get-api-key#premium-auth.
From this link, I can see this lines:
Your client ID and signature
Upon purchasing your Google Maps APIs Premium Plan license, you will receive a welcome email from Google that contains your client ID and your private cryptographic key.
From my understanding, I have to get a Google Maps APIs Premium Plan license. But I contact google sales, they said google doesn’t sell Google Maps APIs Premium Plan any more. Google changed it to enterprise customers account which is for large scale enterprises https://cloud.google.com/maps-platform/pricing/. It is not suitable to my organization.

I also try using my google account to create credentials as following screenshot:

I can get the client id and secret key from OAuth 2.0 credential.


But after I input those information to my application, it doesn’t work. I’m just wondering any other solution for our case?

Many thanks for your help.

Min

Hi Min,

Our Google map is for get map via Maps Static API, so you should want to get your client id and private key about the static api.

You should want to learn more here:

https://developers.google.com/maps/documentation/maps-static/get-api-key

Any question please let us know.

Regards,

Ethan

Thanks for your response, Ethan.
But I’m still confused. From the link you posted, Premium plan customers can get client Id and digital signature. As what I said in my last post, we couldn’t get Premium plan. For standard API users, we must use an API key or include a digital signature. My question is if we can use API key and digital signature in our WPF application? If yes, how to use them?

The following lines are from the link you posted:
Standard API users: If you’re using the API under the standard plan, you must use an API key. In addition, we recommend that you include a digital signature. The digital signature is required under certain circumstances. See more about API keys and digital signatures for the standard API.

Premium Plan customers: For production-ready apps, you must use a browser-restricted API key that is set up in the Google Maps APIs Premium Plan project created for you when you purchased the Premium Plan, as well as a digital signature. Alternatively, you can authenticate your application using use a client ID and digital signature (instead of an API key).

Thanks
Min

Hi Min,

If you only have Key please try this code:

   private void map_Loaded(object sender, RoutedEventArgs e)
    {
        map.MapUnit = GeographyUnit.Meter;

        GoogleMapsOverlay overlay = new GoogleMapsOverlay();
        overlay.SendingWebRequest += Overlay_SendingWebRequest;
        map.Overlays.Add(overlay);


        map.CurrentExtent = new ThinkGeo.MapSuite.Shapes.RectangleShape(-20000000, 20000000, 20000000, -20000000);
        map.Refresh();
    }

    private void Overlay_SendingWebRequest(object sender, SendingWebRequestEventArgs e)
    {
        e.WebRequest = WebRequest.Create(e.WebRequest.RequestUri + "&key=YourKey");
    }

Replace the YourKey with your key here:

It should works.

Regards,

Ethan

Many thanks, Ethan.
It works! But I got marks: imagery @2018 TerraMetrics on the map. Do you know how to remove them?

Hi Min,

It’s not allowed to remove the mark from Google.

But you can use bigger tile size to reduce the marker number.

Regards,

Ethan

Thank you for your answer, Ethan

Hi Min,

Any update please let us know.

Regards,

Ethan