If I use SQLGeospatialDataReader to populate my InformationLayer with data, the InformationLayer.GetBestView method does not work.
Even though I can see data from my InformationLayer on the map, when I debug, InformationLayer.Items is empty (has Count = 0). So when InformationLayer.Items gets passed to GetBestView method, the result is wrong.
Please help.
Here is a code snippet to illustrate.
Even though I can see data from my InformationLayer on the map, when I debug, InformationLayer.Items is empty (has Count = 0). So when InformationLayer.Items gets passed to GetBestView method, the result is wrong.
Please help.
Here is a code snippet to illustrate.
private
InformationLayer informationLayer =
new
InformationLayer();
public
InformationLayer IL
{
get
{
return
informationLayer;
}
set
{
informationLayer = value;
}
}
public
SqlGeospatialDataReader SQLR =
new
SqlGeospatialDataReader();
//Use SQLR to read geospatial data from SQL Server
ReadSQLGeospatialData();
IL.Reader = SQLR;
LocationRect BestViewRect = IL.GetBestView(IL.Items);