I have loaded a very large (.shp = 45MB, .dbf = 130MB) shapefile set as PolyLine series and added it to the xamGeographicMap series list. It takes a significant amount of time to zoom in on the map, so I use a checkbox to flip the visibility property of the series from visible to hidden so the user can zoom in further before turning on this layer/series. If this series added to the xamGeoMap but set as hidden, it still takes about the same amount of time to zoom it. It seems the map is doing something behind the scenes with this series even though it will not be displayed.
Can you give me an idea of what I can to do increase the performance of the xamGeoMap when series are not visible?
Attached is the code I am using to test this without the shapefile set - in this example I just manually change the visibility of the series in the XAML code for testing.
Hi Gary,
The performance issues you are seeing are due to there being too many items in the WPF Visual Tree. You are probably zoomed all the way out when the application starts which means you see every polyline that the shapefile has to offer. There are a few ways you can deal with this though. First, instead of setting the Visibility to Hidden, use Collapsed. Hidden does not remove the elements from the Visual Tree but Collapsed does. Your next option is to set the VisibleFromScale property. This property allows you to determine when the series should be shown depending on the zoom level. For example, you may not want to show the series when you are fully zoomed out but after the user zooms in past a certain point, the series will pop into view. The geo map control performs culling on the polylines so any that are out of view will not be present in the Visual Tree. Since you already have the Checkbox setup to hide the series, I would first try setting it to Collapsed rather than Hidden. You should see an improvement.
Thanks Rob, setting the series to collapsed does speed up things. I had tried removing the series from the xamGeoMap instead of hiding it, and that worked to a degree but there were some side effects (I have posted another forum question on this). I have also set the VisibleFromScale property in the past but that did not particularly seem to improve performance, however, I had a lot going on at that point so I could have had another issue. I'll have to take a look at that later, but for now, this change works.
Thanks!