I am using a GoogleMapsLayers to draw two types of Google Maps basemaps and had some questions concerning the process that TG uses to get the tiles. We have noticed that 8 days into the month, we already had a huge amount of hits to our Google Maps account. We had a couple of users come online and start building their tile caches this past week, but we do not believe it is enough to justify our high numbers of requests.
We are looking to see if we can get an idea of how the GoogleMapsLayers works behind the scenes as we try to track down where our large request amounts are coming from. We share our API access account through our WPF application and a couple of web applications so we are trying to narrow down all possible sources of excess requests.
The code I am using to create the GoogleMapsLayers is below. It builds a tile cache for each of our users, and they are usually only in smaller areas so the cache generation should not be too great. We are only using the Hybrid and Terrain basemaps from Google. There is a toggle elsewhere in our program to switch them and the tile cache ID. It does everything very similar to what is below so I didn’t include it.
We are curious if each tile is requested individually or if TG requests an extent’s worth of tiles. Basically, we would like to know how many requests a typical map view will do. Also, we are assuming once there is a tile cache built for a particular view, there are not requests going to Google for tiles in that particular view.
Thanks for any info…
’ load in the google maps base layer
Dim
googleOverlay
As
New
LayerOverlay
googleOverlay.Name =
"GoogleMapsOverlay"
googleOverlay.DrawingExceptionMode = DrawingExceptionMode.DrawException
googleOverlay.TileCache =
New
FileBitmapTileCache(cacheDirectory)
googleOverlay.TileCache.CacheId =
“Terrain”
Dim
googleLayer
As
New
GoogleMapsLayer
googleLayer.DrawingExceptionMode = DrawingExceptionMode.DrawException
googleLayer.MapType = GoogleMapsMapType.TerraingoogleLayer.TileMode = GoogleMapsTileMode.SingleTile
googleLayer.TileCache =
New
FileBitmapTileCache(cacheDirectory)
'credentials for google account
googleLayer.PrivateKey =
"MYKEY"
googleLayer.ClientId =
“MYID”
'add the google layer to the overlay and the overlay to the map
googleOverlay.Layers.Add(
“GoogleMapsLayer”
, googleLayer)
WpfMap_Main.Overlays.Add(
“GoogleMapsOverlay”
, googleOverlay)