I load layer from mssql by AddLayerFromSQL() method .It's ok.
How to display road name from custom column "text" ?
public void AddLayerFromSQL(string tableName)
{
string connectString = ConfigurationManager.ConnectionStrings["WebGISConnectionString"].ConnectionString;
MsSql2008FeatureLayer myLayer = new MsSql2008FeatureLayer(connectString, tableName, "ID");
myLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.LocalRoad1;
myLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
myLayer.DrawingMarginPercentage = 10;
Proj4Projection proj4 = new Proj4Projection();
proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(32648);//UTM 48N = 32648
proj4.ExternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(3405);//EPSG = 3405
myLayer.FeatureSource.Projection = proj4;
myLayer.Open();
Map1.CurrentExtent = myLayer.GetBoundingBox();
myLayer.Close();
//
LayerOverlay staticOverlay = new LayerOverlay();
staticOverlay.IsBaseOverlay = false;
staticOverlay.Layers.Add(myLayer);
Map1.CustomOverlays.Add(staticOverlay);
}
db.jpg (7.57 KB)
view.jpg (13.9 KB)