I’m having a crash when doing the following:
I add a layer to the map (either a .shp or personalgeodatabasefeaturelayer).
I zoom into where that layer is.
Before that layer finishes refreshing on the map from the zoom, I draw a rectangle shape on the map with my mouse, which gets all the features contained in the rectangle that are also in the personalgeodatabase layer.
This throws an error:
An unhandled exception of type ‘System.InvalidOperationException’ occurred in ThinkGeo.MapSuite.Wpf.dll
The FeatureSource is not open. Please call the Open method before calling this method.
at ThinkGeo.MapSuite.Wpf.Tile.Draw(GeoCanvas geoCanvas)
Here’s some sample code of what I’m doing:
foreach (FeatureLayer layer in (MyMap.Overlays["mdboverlay"] as LayerOverlay).Layers) //loop through the layers in the overlay holding the personalgeodatabasefeaturelayers
{
if (layer.IsVisible) //only check the ones that are currently visible
{
layer.Open();
var features = layer.QueryTools.GetFeaturesWithin(e.TrackShape, ReturningColumnsType.AllColumns); //ERROR THROWN HERE //get the features within the rectangle shape I drew
layer.Close();
}
}
I attached a gif below to show what I mean. I just have a simple countries.shp loaded on the map.
Sorry it’s a little fast, but you get the gist of it.
I don’t get the error if I wait for the map to refresh after zooming in, but that’s not ideal.