I got the 8.0 DLLs this morning and was seeing how it would interact with my current project. I found something that is an issue, and I am not sure whose end it is on.
In 7.0, I was able to set up a GoogleMapsOverlay with tile caching. I have a button that allowed me to change the MapType of the GoogleMapsOverlay and refresh it. In 7.0, it would change my current view to the desired one. In my case, I am going between Terrain and Hybrid tiles. However, in 8.0, it does not change my current view and only loads the correct tiles when I pan to an area that does not already have tiles.
My question is what is the best way to set up cached tiles like this. It seemed like in 7.0, I did not need to worry about separate cache folders or anything else. The program handled it without issue. I created a simple project to go along with this. I am not including my GoogleMaps PrivateKey or ClientId as I am sure you can fill that out. But the general idea is that we start with the Terrain basemap, and if the user wants to switch over to the Hybrid view, the click a button. But we want to cache everything we see in case internet connection is lost.
Let me know if there is a better way to accomplish what I am doing or if something changed for the not so better in 8.0.
Map Suite 8.0 and Google Maps Tiles
Hi Brandon,
That’s a bit wired as when I try your codes on map suite 7.0, the map still didn’t change after I switch the map type. But then I found the CacheId seems be missing. would you try to add the below three lines on your sample:
googleOverlay.TileCache = New FileBitmapTileCache(cachedirectory)
'googleOverlay.TileCache.CacheId = “Terrain”
googleOverlay.MapType = GoogleMapsMapType.Terrain
'googleOverlay.TileCache.CacheId = “Terrain”
googleOverlay.MapType = GoogleMapsMapType.Hybrid
'googleOverlay.TileCache.CacheId = "Hybrid"
In the end, the map will generate two folder “Terrain” and “Hybrid” to cache difference map type tile images.
If the issue persists, please feel free to let us know.
Thanks,
Troy
Hi Troy.
I made the changes and assigned cache ids. We didn’t have it set up in 7.0, and it worked so I never thought of needing that now. I did notice some alignment issues when I set the TileType to either HybridTile or MultipleTile. I am including a screen shots showing the alignment issues I am receiving along with an updated version of my project. In SingleTile mode, there didn’t seem to be any issues.
I switched the basemap over to the Hybrid view for Google, but the alignment issues were present in the Terrain view as well.
What would possibly cause something like this? I would want the user benefit of multiple tiles while panning but would need to make sure my tiles line up correctly.
001_ThinkGeo8_GoogleTest.zip (20 KB)
Hi Brandon,
We can recreate your issue and seems this is a bug on FileBitmapTileCache with map suite 8.0. Now, we are working on it and here is a replacement solution for it:
Change
googleOverlay.TileCache = New FileBitmapTileCache(cachedirectory)
To
googleOverlay.TileCache = New EncryptedFileBitmapTileCache(cachedirectory)
Our development team is working on the FileBitmapTileCache issue now and i will update here if any progresses.
Thanks,
Troy
Hi Troy… I will give that a shot.
On a related topic, do you know if there is a tile cache generator for Google Maps layers? I have seen the CacheGenerator for shapefiles, but I was wondering if there is something built for Google Maps or other online services.
Hi Brandon,
About the original issue, I want to append another solution before we fix the bug. Instead of using GoogleMapsOverlay, we can use the LayerOverlay and then insert the GoogleMapsLayer into it. In this way, seems the FileBitmapTileCache works fine. Please let me know the result about the two solutions.
For the CacheGenerator Tool, yes, we can cache any layers like Google,Bing or other online layer like our WorldMapKitLayer. However, since all of them needs the network, the performance would be depends on the bandwidth. What’s more, the request limits also need to be consider for some layer in their service.
Any question please feel free to let me know.
Troy