Hi,
I'll need some support regarding the
"MsSql2008FeatureLayer" function. It's not showing anything on
the map.
Below are the details.
- SQL Server
- Visual Studio 2013
- WPF, C#
- ThinkGEO MapSuite 9.0 (Full license)
From the DB side
- I have a table with a field defined as
"geometry" type named "geometrylocation".
From the code side
- Here's how I wrote the data into the database
rampCondition.geometrylocation =
DbGeometry.FromText(selectedCurbramp.GetWellKnownText(), 4326);
- Here's how I used the MsSql2008FeatureLayer class to draw
on the map
var connString = @"data
source=(localdb)\MSSQLLocalDb;attachdbfilename=|DataDirectory|\Denver_CurbRamp.mdf;integrated
security=True;connect timeout=30;MultipleActiveResultSets=True;";
MsSql2008FeatureLayer curbrampcollectedLayer = new
MsSql2008FeatureLayer(connString, "Curb_Ramp_Condition",
"ID", 4326);
curbrampcollectedLayer.CustomGeometryColumnName =
"geometrylocation";
curbrampcollectedLayer.IsVisible = true;
curbrampcollectedLayer.Name =
"curbrampscollected";
curbrampcollectedLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle
= new PointStyle(PointSymbolType.Star, new
GeoSolidBrush(GeoColor.StandardColors.Red), 100000);
curbrampcollectedLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle
= AreaStyles.Country1;
curbrampcollectedLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle
= LineStyles.Railway2;
curbrampcollectedLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel
= ApplyUntilZoomLevel.Level20;
curbrampcollectedLayer.Open();
shpOverlay.Layers.Add("curbrampscollected",
curbrampcollectedLayer);
curbrampcollectedLayer.FeatureSource.Open();
Collection<Feature> fs =
curbrampcollectedLayer.FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns);
collectedRectangle = curbrampcollectedLayer.GetBoundingBox();
curbrampcollectedLayer.FeatureSource.Close();
theMap.Refresh();
Please advise.
Thanks in advance!
Vincent