Grid artifacts in silverlight sample

Jun 2, 2013 at 11:26 PM
I have tile border lines partially visible (~ 1px, sometimes not all sides), unpredictable, while running silverlight sample (during and persisted after zomming/panning). This was in older versions too. - hasn't this problem, Reflector shows that brutiledemo uses xaml images in renderer, but current version uses path and imagebrush fill. How can I fix this? TIA
Jun 3, 2013 at 8:14 AM
Edited Jun 3, 2013 at 8:15 AM
In the Silverlight sample I only see tile borders if the browser zoom is not 100%. This was a known issue for a very long time (years). I assumed that it was a Silverlight framework limitation.

You are right that these tile borders are not visible in brutiledemo. I was not aware of this. I am not sure why. The path+imagebrush solution also has been there for a very long time. I didn't think it made any difference when I changed that. Perhaps that causes the problem, but I think the xaml-image implemetation had this problem too.

Also in the first versions I cheated by drawing the tile slightly larger than they should to prevent tile borders. Perhaps this makes the difference. Perhaps Reflector could answer that too.

There are many possible causes of tile borders
  • browser zoom
  • platform limitations
  • fill method of imagebrush
  • draw method (in GDI there are ~8 ways to draw edge pixels)
  • error in calculation
  • pixel alignment of platform
To make sure we talk about the same problem: do you see the tile borders in the Silverlight sample also with the browser on 100%?
Jun 3, 2013 at 2:20 PM
Edited Jun 3, 2013 at 3:09 PM
Yes you are right - browser zoom was 'custom'. And Host.Settings.EnableAutoZoom = false; did the trick and borders have gone. But it is a workaround.
As I remember Esri silverlight control (as reflector shows) uses image, not imagebrush. So it may be the couse. Silverlight sample has one more little problem - map control clipping is incorrect - it occupies the whole page, overlaps gui overlay.
Could you suggest what to change to use Image? I tried to to make alt version of public static XamlShapes.Path RenderRaster(IRaster raster, IStyle style, IViewport viewport) in GeometryRenderer to return proper UIElement instead XamlShapes.Path. But it didn't work as expected. May be I do something wrong but maybe there some another place to change.
Jun 16, 2013 at 4:33 PM
I did't know about Host.Settings.EnableAutoZoom = false; Does this still allow zooming the map itself?

If you just replace the XamlShapes.Path with UIElement without other changes I expect it to just work. You could then replace the RenderRaster with an Image.

I don't expect this will fix the problem but its worth the try.