I'm using the a TileLayer with BruTile and GoogleMaps / Bing / OSM Maps, but the rendering is synchronous.
I've made some modifications to draw each tile when they are loaded instead of waiting for all tiles to be retrieved and then draw all tiles.
This modification is not a simple modification and I'v need to change from MapBox -> Map -> TileLayer.
Now I want that someone can evaluate the modifications and if so incorporate in trunk.
the logic that I've implemented is the following:
1 - When a TileLayer is requested to Draw, instead of getting all the Tiles in View and then Draw, I exposed an event in TileLayer:
public delegate void MapNewTileAvaliabledHandler(TileLayer sender, SharpMap.Geometries.BoundingBox bbox, Bitmap bm, int sourceWidth, int sourceHeight, ImageAttributes imageAttributes);
public event MapNewTileAvaliabledHandler MapNewTileAvaliable;
2 - With this event, after adding a TileLayer to a Map, we associate the event from the TileLayer to a Public Method in Map that exposes the same Event
3 - With the event from Map, we associate the event to MapBox so the Static Image BitMap can be updated with the new TileAvailable
With all thes "Bubbling Events", each time a new Tile is available, the tile is "Event Bubbled" to the MapBox.
For me this is not the best solution but is working with MapBox.
The problems that I found:
- This doesn't work when we want Synchronous TileLayer, so the suggestion that I have is to create a new TileLayerAsync
- We need manually to wire the event from the tilelayer to the map and wire the event from the map to the mapbox
I don't know who normally works with TileLayer, so I need some help to improve this.
I can submit a patch, but for me this is not final yet.