Select to view content in your preferred language

Really slow with lots (1500) custom MarkerSymbols, but not with SimpleMarkerSymbols

1809
11
07-30-2010 01:54 PM
MartenLiebster
Deactivated User
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 collection
3) assigning the custom symbol to the Symbol
4) 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.
0 Kudos
11 Replies
AliMirzabeigi
Emerging Contributor
With the default extent of your application I don't think FeatureLayers would be of any help, but your users will have a better navigation experience when they zoomed in.
Regarding your question you can assume FeatureLayer as a GraphicsLayer displaying features from a REST service.
0 Kudos
MartenLiebster
Deactivated User
With the default extent of your application I don't think FeatureLayers would be of any help, but your users will have a better navigation experience when they zoomed in.
Regarding your question you can assume FeatureLayer as a GraphicsLayer displaying features from a REST service.


Thanks for the info - I'll keep the FeatureLayer in mind.

Our clients typically have locations throughout the country (US), and some in other countries, so I keep the extent "full size".
0 Kudos