Alpha blending layers and displaying the same map in multiple views

Jun 23, 2011 at 6:10 PM

Hi first let me congratulate you on a great product .

i have a couple of quick questions.

1) I want to apply an alpha value to an entire layer - this is important to me as i have a requirement to blend 2 maps.  looking at the code i ; inside the Render methods its seems I have to change the opacity for every single rectangle/bitmap within a layer - however this seems clunky as i may have 100's of tiles in a layer but as the size of my control is a fixed size. 

Am i correct in the assumption that the architecture does not use 1 canvas / per layer? thus i cannot blit all tiles in a layer to a canvas apply a opacity to a transform?

2) I want to use one map but display it in multiple viewports - eg two render targets for the same map data.  Something like a moving map display - showing a map at level 1 with an overview map at level 3 for example.  Is this possible with the current architecture.  Again i have looked at the code but could not see how i would achieve this.





Jun 24, 2011 at 7:46 AM

Hi Steve,

In general I am not very happy with Silverlight rendering for maps and will investigate if I can replace it with XNA in Silverlight 5. There is a lot that can be improved in the current implementation of Silverlight rendering. For instance rendering polygons is very slow because the polygon is built again on every render iteration.

1) Yes, all tiles are now rendered in one canvas. If you want to change that you could replace the current tileCanvas in MapRenderer with a dictionary for each tileLayer. And then you need create a way to set the opacity of that canvas per layer.

2) You could make a second MapControl which shares the Map object with the first. Mapsui is different from SharpMap in that the view port is separated from the map. This was done with the intention to allow such multiple views. I never got around to actually use this in practice though.