How to improve Silverlight-WP Tilerenderer

Jan 8, 2012 at 10:57 AM

Hi,

first of all thanks for this great project, it's really powerful. I would like to use it in a app for Windows Phone 7. I have already tried the WP Sample with OsmTileSource. It's working pretty well but (at least in the emualtor) the performance is not the best. For example when panning the map around it's not very smooth even if all tiles should be already in cache. I feel like there is much more potential for this great control! The bing maps control for example performs much better.

Don't get me wrong, I don't want to criticize anything. I'm pretty good in Windows Mobile / Windows Forms but unfortunately I'm a beginner in Silverlight / WP7.

Does anybody have some hints on how to improve cutom map control tile rendering in WP7? I already searched the web for something like best practices in WP7 custom control rendering with images but didn't find anything useful so far. Are there any better solutions than using a canvas / Rectangles as it is now or is do we have to go for XNA to achive better performance?

 

Regards and thanks again for this great project!

By the way, I haven't tried vector rendering yet. Does it work in a useful way on WP7?

Jan 15, 2012 at 7:18 PM

Hi there,

I currently don't have a Windows Phone to develop for, so I can not test the performance. I would expect that a single tile layer would be fast, maybe this could be fixed.

I would expect a simple tile layer to be fast on WP7. Perhaps the number of tiles in memory is too big for WP7. 

In general I am not happy with the current rendering implementation. It is now using Silverlight controls to render maps. I think Silverlight's deferred rendering is well suited for the UI but not for graphics intensive apps like games and mappers. I had the intention to switch everything to XNA at some point but the situation for XNA does not look very good. Combining XNA and XAML is complicated in WP7 and in SL5 XNA has no great support.

If you intend to develop for WP7 only XNA rendering might still be a good option. If you look at this I would like to add this to the project. A version with only tiles and pointsymbols is sufficient for many scenarios.

An alternative is to use writeablebitmapex.codeplex.com as renderer. I hope to find time to investigate this.

cheers,

Paul

Jan 15, 2012 at 10:06 PM

I'm currently using WindowsAPI Code Pack for serverside feature rendering. Client recieves rendered tiles. I am planing on moving to SharpDX (http://code.google.com/p/sharpdx/) but that's about a month or two away. Feature editing is done on the clientside using WPF Shapes. As current use case is to edit up to 10 features at any one time the performance is good.

I was planing to see if I can use SharpDX to render features and tiles client-side as well so I'm quite interested in this thread.

Just to clarify, are we talking about:

1. DX rendering of features (vector data)

2. DX rendering of existing tiles (pixel data)

3. DX rendering of the whole control

Jan 16, 2012 at 10:08 AM

GoranSiska, I don't think that it is possible to use SharpDX on Windows Phone.

In the meantime I tried WriteableBitmapEx which works pretty good but still not perfect (in the emulator, I don't have a WP either). But I didn't use Mapsui but my own mapcontrol basic classes. I think I will give XNA a try in the next step.

 

 

Jan 16, 2012 at 5:37 PM
Edited Feb 7, 2012 at 4:59 PM

SharpDX will not work on Windows Phone but you may be able to reuse the code for both. There will probably be some differences but you may get it to work on both with some #if 's. I am very interested in any progress. It might also be usable for the MS Surface. We are working on a Surface 2 app right now. In that case we probably do need a WPF MapControl. 

Good to hear you tried WriteableBitmapEx, it has been on my list for a long time but never found time for it. Did you try tile rendering with WBX?

Paul

Feb 12, 2012 at 10:11 PM

Here an update that might relevant.

I have been playing around with WriteableBitmapEx. I added a sample that can be activated by setting wbxRendering to true in MapControl.cs. It renders tiles only, and could perform faster if the bitmaps are reused. For the short term I will now focus on general improvements in rendering, not a specific platform.

Also relevant for if you are working on XNA rendering is MonoGame: https://github.com/mono/MonoGame

Feb 15, 2012 at 7:59 AM

Another update. I removed the WbxRenderer from the MapControl for now. Eventually it needs to be inserted through IRenderer. If you want to play with it right now you need to create a WbxMapRenderer iso MapRenderer and add the references to the WbxRendering project. At the moment I am optimizing performance by caching the renderer specific geometry in IFeature.RenderedGeometry. This technique can be used for all geometry types on all render implementations.