changing geometry won't update rendered features since last version of XamlRendering


For example, take a MemoryProvider with LineString geometry.
Add it to the map and let it render.
Then add a Point or change the coordinates of a existing in the linestring.
The rendered geometry won't update.
I guess the Problem probably lies within the MapRenderer (XamlRendering) in the RenderFeature method:
var renderedGeometry = feature.RenderedGeometry.ContainsKey(style) ? feature.RenderedGeometry[style] as UIElement : null;
                if (renderedGeometry == null)
                    renderedGeometry = RenderGeometry(viewport, style, feature);
                    feature.RenderedGeometry[style] = renderedGeometry;
                    PositionGeometry(renderedGeometry, viewport, style, feature);
If the rendered geometry is not null, you only update the Position, but not any given changed data.
This problem must be relatively new, it worked before updating to the latest sources recently.
Closed May 7, 2014 at 1:13 PM by pauldendulk
moved to github issue


pauldendulk wrote Mar 28, 2013 at 10:11 PM

thanks for reporting and for diagnosing the problem. RenderedGeometry is used as a performance optimization but I had not thought of this scenario.

A workaround could be to call feature.RenderedGeometry.Clear() after the geometry is edited. I have to think about a proper solution.

philjay wrote Apr 12, 2013 at 8:33 AM

There's another Problem with PositionGeometry.
When you zoom in, the Polygons get very blurry, when you zoom in too much, the polygon dissapears completely(this is even a Problem when using RenderGeometry). LineStrings won't be dsplayed at all using PositionGeometry.

pauldendulk wrote Apr 12, 2013 at 2:47 PM

I created a new issue for that. Perhaps you can clarify there:

Does the workaround work in your case?

philjay wrote Apr 12, 2013 at 7:38 PM

Yes, I remove the RenderedGeometry to get the LineStrings updated. But since it has those blur problems, I hacked the renderer to always re-render LineStrings.