I've got an app which uses a custom MarkerSymbol defined within the XAML of the UserControl. The symbol has an ellipse to mark the point on the map and canvas with about 8 textblocks and 3 buttons. I've got 2 VisualStates defined for MouseOver and MouseIn. It's default state is just to show the ellipse, and when mouse enters, the canvas is displayed with ScaleTransforms. When the mouse leaves, it reverts back to it's default state.There's databinding using the ESRI DictionaryConverter going on as well for some of the textblocks and 1 of the button's text.To display this symbol, I do a database query via WCF RIA. When looping through these results, I essentially do this process:1) creating a Graphic() 2) populate the Attribute collection3) assigning the custom symbol to the Symbol4) add to the Map.Layer.Graphics collection.Here's a few snippets of the code:
_viewModel.Locations
.ToList()
.ForEach(rl => processDataPoint(rl));
void processDataPoint(Info MapInfo)
{
Graphic gr = new Graphic()
{
Geometry = new MapPoint(MapInfo.Lon, MapInfo.Lat)
};
gr.Attributes.Add("ButtonText", MapInfo.ButtonText);
gr.Attributes.Add("EllipseFill", MapInfo.EllipseFill);
// add some more attributes
gr.Symbol = MyMarkerSymbol; // defined on this UserControl's XAML
_mapLayer.Graphics.Add(gr);
}
One of my queries returns 1500 results, and perform the above, the map is really really slow.As a test, I changed the custom symbol out with a SimpleMarkerSymbol and the map is quick and responsive.So it's something that I am doing...Is it the VisualStateManager? Thanks for any help.