ThinkGeo.com    |     Documentation    |     Premium Support

GoogleMapsOverlay Android

Hello, I’m using ThinkGeo for android, and would like to know an example to use the three parameters for the object:

GoogleMapsOverlay googleMapOverlay = new GoogleMapsOverlay (cacheDirectory string, clientId string, string privatekey)

Because I wanted to use the Google Maps offline, someone would have to show me an example?

Thank you.

Hi Elton,

The following is the description of the parameters:
cacheDirectory: cache folder path
clientId: GoogleMaps clientId, we should receive this value from Google Enterprise Support.
privatekey: GoogleMaps key, we should receive this value from Google Enterprise Support.

Following code shows how to create a tile cache:

    //The sdCardDataDictionary string is cache data path.
    string sdCardDataDictionary = @"mnt/sdcard/MapSuiteSampleData/GoogleMaps/App_Data";
    GoogleMapsOverlay googleMapOverlay = new GoogleMapsOverlay (sdCardDataDictionary, clientId, privatekey);

Thanks,
Peter

thank you, but how to use the Google Maps offline in android?

Hi Elton,

Please see the ticket you created. Any questions please update in that thread.

Thanks,
Peter

But I would like to know an example of how I create the ‘clientId’ and ‘privatekey’, you could show us how to create it in the Google Enterprise Support?

Thank you.

Hi Elton,

I think you can get more detail information from this page: https://developers.google.com/maps/premium/overview

What type of the key should be “Google Static Maps API”, wish that’s helpful.

Regards,

Don

I have some keys and it did not work to show the google map.

The key I created was ‘AIzaSyDxumB6x9NwCwraCDx2uSuzo9RHQzHQNp0’.

GoogleMapsOverlay gmSateliteOverlay = new GoogleMapsOverlay(fileCache, ClienteidGm, PrivatekeyGm);

Attached is an image of how to use the map above.

Hi Elton,

Please get the request url from some event like sendingrequest or Fiddler, and try to open the tile url in browser to make sure whether your key works well with Google’s static API.

If you can view the tile in your browser but in your APP it still shows the blank image please let us know.

Regards,

Don