Tile Client Update: New Features and Fixes

As a result of my work on GL Maps, I made several fixes, feature enhancements, and extensions to the original Tile Client and the sample code. Pictures and captions for your viewing pleasure (download is at very bottom):

Composite

I updated the desktop sample to demonstrate how to use a MapOverlay to put pushpins on the map. It also demonstrates how to use CompositeMapSession to blend multiple sessions together. Such as:

  • Satellites + Roads
  • Streets + Traffic

Directions

The desktop sample has also been updated to show how to retrieve and use directions from either Google or Virtual Earth. 

TileRefresh

The samples also demonstrate how to provide a custom refresh bitmap for when the tile is being downloaded.

SmartTile SmartTile2

But, refresh bitmaps are tacky! So, the Tile client now uses parent and child tiles (tiles from other zoom levels) to render temporarily if the tile is missing! On the left you see can see the map using parent tiles to render while the tiles are being downloaded. On the right you see the map again, in full detail, when the tiles have completed downloading.

cftransparent

And a much requested feature: Tiles and overlays now support transparencies on Windows Mobile! Above you can see a MapOverlay that is using alpha blending.

 

Change Log:

  • Developers must now instantiate a GraphicsRenderer and use that to render the map, rather than passing a Graphics object directly. This change was made to allow abstraction of the rendering device to support the 3D rendering a la GL Maps.
  • Tiles are now cached to disk. They will be refreshed from server every 2 days.
  • Fixed Google Directions retrieval.
  • Implemented "smart" tile rendering. If a tile is being downloaded, the parent or child tiles are used to render its content.
  • Fixed bug where MapOverlays were not being affected by the Offset property.
  • Implemented transparencies on Windows Mobile. To retrieve and use a transparent bitmap, simply call GraphicsRenderer.LoadBitmap! See the Windows Mobile sample for more detail.
  • Windows Mobile now converts bitmaps to 16bpp automatically after retrieval. This is a huge performance improvement, because instead of doing the pixel format conversion per paint, it happens only once.
  • Updated both samples to demonstrate more features.
  • Added a TiledMapSession.ClearAgedTiles(N) method to clear the tile cache of tiles that haven't been used in N milliseconds. This is useful for Windows Mobile where memory is a constraint, but clearing all tiles is undesirable.

Full source to the Tile Client and sample applications.

2 comments:

Erik Bent said...

In TiledMapSession.cs the code GeocodeToCenterRelativePoint has an error:
myCenterTile.X << 8 + myCenterOffset.X is wrong because the + is evaluated first.

Koush said...

Correct, that has been fixed in the Github repository:

http://github.com/koush/TiledMaps/tree/master