I am suddenly having trouble getting SQL server Spatial features to display. The features are loaded into an Express database as geometry. They have been displaying properly, and I don't now what changed to cause them to stop. I have developed a simple app to test the problem and they still don't display. The application is a single form with the WinFormMaps control added. Code is as follows:
<code:lang="csharp">using System; Any help will be appreciated. Charles
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ThinkGeo.MapSuite.Core;
using ThinkGeo.MapSuite.DesktopEdition;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
OpenOverViewMap();
}
private void OpenOverViewMap()
{
winformsMap1.MapUnit = GeographyUnit.Feet;
winformsMap1.CurrentExtent = new RectangleShape(395000.1, 390000.1, 590000.1, 199000.1);
winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);
MsSql2008FeatureLayer worldLayer = new MsSql2008FeatureLayer(@"Server=CHARLESRLAPTOP\SQLEXPRESS;Database=Lakeland;Trusted_Connection=True;", "msiOverview", "ID");
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.OuterPen.Width = 1;
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.OuterPen.Color = GeoColor.StandardColors.Black;
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
LayerOverlay staticOverlay = new LayerOverlay();
staticOverlay.Layers.Add("WorldLayer", worldLayer);
winformsMap1.Overlays.Add(staticOverlay);
winformsMap1.Refresh();
}
}
}