protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { Button4.Visible = false; txtScaleLevel.Attributes.CssStyle.Add("visibility", GetControlStatus.ScaleIndicator == 1 ? "visible" : "hidden"); if (Session.IsNewSession == true) { dsAppConfig = (DataSet)Session["dsAppConfig"]; dsAttribConfig = (DataSet)Session["dsAttribConfig"]; string s = Session["SessionId"].ToString(); FillAttribSearchData(); Cache["ddlTables"] = ddlTables; Cache["ddlColumns"] = ddlColumns; } else { FillAttribSearchData(); //ddlTables.Items.Clear(); //ddlOpr = (DropDownList)Cache.Get("ddlTables"); } Tabs.ActiveTabIndex = 0; //Set Map properties and values #region Set Map Properties and values string sUnit = "Meter"; Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#B3C6D4")); Map1.CurrentExtent = new RectangleShape(-13939426.6371, 6701997.4056, -7812401.86, 2626987.386962); Map1.MapTools.PanZoom.Enabled = false; Map1.MapTools.PanZoomBar.Enabled = true; Map1.MapUnit = (GeographyUnit)Enum.Parse(typeof(GeographyUnit), sUnit); //Map1.MapTools.LoadingImage.Enabled = true; //Map1.MapTools.LoadingImage.Width = 32; //Map1.MapTools.LoadingImage.Height = 32; //Map1.MapTools.LoadingImage.ImageUri = new Uri(new Uri(Request.Url.AbsoluteUri), "ajax-loader-3.gif"); layerOverLay = new LayerOverlay("OSPFM Layers"); layerOverLay.IsBaseOverlay = false; layerOverLay.ClientCache.CacheId = "OSPFM_Layers"; layerOverLay.TransitionEffect = TransitionEffect.None; layerOverLay.TileType = TileType.SingleTile; layerOverLay.Layers.Clear(); //# end of Map properties #endregion //Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#B3C6D4")); //Map1.CurrentExtent = new RectangleShape(-13939426.6371, 6701997.4056, -7812401.86, 2626987.386962); //Map1.MapUnit = GeographyUnit.Meter; ////Create 3 shapelayers (2 point and 1 line layer) //ShapeFileFeatureLayer lyr_points_Access_Point = new ShapeFileFeatureLayer(MapPath("~/Data/Access_Points.shp")); //lyr_points_Access_Point.ZoomLevelSet.ZoomLevel18.DefaultPointStyle = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.SimpleColors.Blue, 12f); //lyr_points_Access_Point.ZoomLevelSet.ZoomLevel18.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; //lyr_points_Access_Point.DrawingMarginPercentage = 50; //lyr_points_Access_Point.IsVisible = true; ////******************* This is label layer mapping to same shape file as Access point //ShapeFileFeatureLayer lbl_Access_Point = new ShapeFileFeatureLayer(MapPath("~/Data/Access_Points.shp")); //lbl_Access_Point.ZoomLevelSet.ZoomLevel19.DefaultPointStyle = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.SimpleColors.Blue, 12f); //lbl_Access_Point.ZoomLevelSet.ZoomLevel19.DefaultTextStyle = TextStyles.City1("Type_Name"); //lbl_Access_Point.ZoomLevelSet.ZoomLevel19.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; //lbl_Access_Point.DrawingMarginPercentage = 50; //lbl_Access_Point.IsVisible = true; //ShapeFileFeatureLayer lyr_lines_FS_LD = new ShapeFileFeatureLayer(Server.MapPath("~/Data/FS_LD.shp")); //lyr_lines_FS_LD.ZoomLevelSet.ZoomLevel05.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.Blue, 1.5f, true); //lyr_lines_FS_LD.ZoomLevelSet.ZoomLevel05.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; //lyr_lines_FS_LD.DrawingMarginPercentage = 50; //lyr_lines_FS_LD.IsVisible = true; ////Set projection for all 3 layers (2 point and 1 line layer) //Proj4Projection proj4_points_Access_Points_lbl = new Proj4Projection(); //proj4_points_Access_Points_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); //proj4_points_Access_Points_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); //lbl_Access_Point.FeatureSource.Projection = proj4_points_Access_Points_lbl; //Proj4Projection proj4_points_Access_Points = new Proj4Projection(); //proj4_points_Access_Points.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); //proj4_points_Access_Points.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); //lyr_points_Access_Point.FeatureSource.Projection = proj4_points_Access_Points; //Proj4Projection proj4_lines_FS_LD = new Proj4Projection(); //proj4_lines_FS_LD.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); //proj4_lines_FS_LD.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); //lyr_lines_FS_LD.FeatureSource.Projection = proj4_lines_FS_LD; #endregion //Prepare and load data for line and point layers dsAppConfig.Tables[1].DefaultView.RowFilter = ""; // =========== Load All lines/point type .shp layers based on group and set properites here =============== #region All group layers (8 Layers) #region 1. Fiber Security dsAppConfig.Tables[0].DefaultView.RowFilter = "ID = 1"; //Fiber Security if (dsAppConfig.Tables[0].DefaultView.Count > 0) { if (Convert.ToBoolean(dsAppConfig.Tables[0].DefaultView[0]["visible"]) == true) //At Parent level { #region FS_LD Line feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'line' and id = 1 and lid = 1"; //FS_LD if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; flineSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //4; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; color = GetGeoColor(sColor); linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, true); //------------Layer FS_LD sl.lyr_line_FS_LD = GetShapeFileFeatureLayer(sShapeFilePath); color = GetGeoColor(sColor); linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, true); applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); zoomLevelSet = sl.lyr_line_FS_LD.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultLineStyle = linestyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_line_FS_LD.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_FS_LD = new Proj4Projection(); proj4_lines_FS_LD.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_FS_LD.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_FS_LD.FeatureSource.Projection = proj4_lines_FS_LD; layerOverLay.Layers.Add("Lyr_FS_LD", sl.lyr_line_FS_LD); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_line_FS_LD.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_line_FS_LD.IsVisible = false; } //------------Layer FS_LD Lable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { //currently in xml this layer has no lable Parameters //Write label code here (similar to others layers that has lable para..) when parameters added to xml config file } } } #endregion ## End of FS_LD Line Point ## #region FS_GNS Line feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'line' and id = 1 and lid = 2"; //FS_GNS if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; flineSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //4; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; color = GetGeoColor(sColor); linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, true); //------------Layer FS_GNS sl.lyr_line_FS_GNS = GetShapeFileFeatureLayer(sShapeFilePath); applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); zoomLevelSet = sl.lyr_line_FS_GNS.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultLineStyle = linestyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_line_FS_GNS.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_FS_GNS = new Proj4Projection(); proj4_lines_FS_GNS.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_FS_GNS.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_FS_GNS.FeatureSource.Projection = proj4_lines_FS_GNS; layerOverLay.Layers.Add("Lyr_FS_GNS", sl.lyr_line_FS_GNS); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_line_FS_GNS.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_line_FS_GNS.IsVisible = false; } //------------Layer FS_GNS Lable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { //currently in xml this layer has no lable Parameters //Write label code here (similar to others layers that has lable para..) when parameters added to xml config file } } } #endregion ## End of FS_GNS Line Point ## #region FS_Local Line feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'line' and id = 1 and lid = 3"; //FS_Local if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; flineSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //4; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; color = GetGeoColor(sColor); linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, true); //------------Layer FS_Local sl.lyr_line_FS_Local = GetShapeFileFeatureLayer(sShapeFilePath); applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); zoomLevelSet = sl.lyr_line_FS_Local.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultLineStyle = linestyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_line_FS_Local.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_FS_Local = new Proj4Projection(); proj4_lines_FS_Local.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_FS_Local.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_FS_Local.FeatureSource.Projection = proj4_lines_FS_Local; layerOverLay.Layers.Add("Lyr_FS_Local", sl.lyr_line_FS_Local); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_line_FS_Local.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_line_FS_Local.IsVisible = false; } //------------Layer FS_Local Cable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { //currently in xml this layer has no lable Parameters //Write label code here (similar to others layers that has lable para..) when parameters added to xml config file } } } #endregion ## End of FS_Local Line Point ## } } #endregion #region 6. Span dsAppConfig.Tables[0].DefaultView.RowFilter = "ID = 6"; //Span if (dsAppConfig.Tables[0].DefaultView.Count > 0) { if (Convert.ToBoolean(dsAppConfig.Tables[0].DefaultView[0]["visible"]) == true) //At Parent level { #region Span Line feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'line' and id = 6 and lid = 1"; //Span if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; flineSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //4; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; slabelfontfamilyname = dsAppConfig.Tables[1].DefaultView[0]["labelfontfamilyname"].ToString(); flabelfontsize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelfontsize"].ToString()); slabelfontcolor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelfontcolor"].ToString(); slabeldrawingfontstyles = sDrawingFontStyle + dsAppConfig.Tables[1].DefaultView[0]["labeldrawingfontstyles"].ToString(); flabelxoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelxoffset"].ToString()); flabelyoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelyoffset"].ToString()); sInnerLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["innerlinecolor"].ToString(); sOutLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["outlinecolor"].ToString(); fInnerLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["innerlinewidth"].ToString()); fOutLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["outlinewidth"].ToString()); sColorHaloPen = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelhalopencolor"].ToString(); fHaloPenWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelhalopenwidth"].ToString()); colorHalopen = GetGeoColor(sColorHaloPen); color = GetGeoColor(sColor); if (sInnerLineColor != "GeoColor.StandardColors.NA") { colorInnerLine = GetGeoColor(sInnerLineColor); } //Not used, needs value in xml } if (sOutLineColor != "GeoColor.StandardColors.NA") { colorOuterLine = GetGeoColor(sOutLineColor); }//Not used, needs value in xml //Following code is not applicable as Span requires to present in double lines with light gray color // so LineStyles.Canal1 gives grey color with black out line on top and below. //linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, true); //linestyle = LineStyles.Canal1; //linestyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.Blue, 2, GeoColor.StandardColors.Gray, 10, GeoColor.StandardColors.Gray, 10, true); //linestyle = LineStyles.CreateSimpleLineStyle(color, 2, color, 10, color, 10, true); if (sInnerLineColor != "GeoColor.StandardColors.NA" && sOutLineColor != "GeoColor.StandardColors.NA") { linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, colorInnerLine, fInnerLineWidth, colorOuterLine, fOutLineWidth, true); } else { linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, true); LineStyle ls = new LineStyle(); } //------------Layer Span sl.lyr_line_Span = GetShapeFileFeatureLayer(sShapeFilePath); applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); zoomLevelSet = sl.lyr_line_Span.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultLineStyle = linestyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_line_Span.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_Span = new Proj4Projection(); proj4_lines_Span.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_Span.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_Span.FeatureSource.Projection = proj4_lines_Span; layerOverLay.Layers.Add("Lyr_Span", sl.lyr_line_Span); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_line_Span.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_line_Span.IsVisible = false; } //------------Layer Span Lable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { sl.lyr_line_Span_lbl = GetShapeFileFeatureLayer(sShapeFilePath); iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // Create text style by column name. //Following code is not applicable as Span requires to present in double lines with light gray color // so LineStyles.Canal1 gives grey color with black out line on top and below. color = GetGeoColor(slabelfontcolor); drawingfontstyles = GetDrawingFontStyles(slabeldrawingfontstyles); //textStyle = TextStyles.City1(sDisplayColName); //textStyle = GetTextStyle("City1", sDisplayColName); //textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, "Aerial", 20, drawingfontstyles, GeoColor.SimpleColors.Black); textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, slabelfontfamilyname, flabelfontsize, drawingfontstyles, color,colorHalopen,fHaloPenWidth, flabelxoffset,flabelyoffset); textStyle.AllowLineCarriage = true; textStyle.BestPlacement = true; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; textStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels; //textStyle.XOffsetInPixel = XOffsetInPixel; //textStyle.YOffsetInPixel = YOffsetInPixel; applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); zoomLevelSet_lbl = sl.lyr_line_Span_lbl.ZoomLevelSet; startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; startZoomLevel_lbl.DefaultLineStyle = linestyle; startZoomLevel_lbl.DefaultTextStyle = textStyle; startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; sl.lyr_line_Span_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_Span_lbl = new Proj4Projection(); proj4_lines_Span_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_Span_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_Span_lbl.FeatureSource.Projection = proj4_lines_Span_lbl; layerOverLay.Layers.Add("Lbl_Span", sl.lyr_line_Span_lbl); sl.lyr_line_Span_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; //Over write label visibility if, parent layer initflag is false if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) { sl.lyr_line_Span_lbl.IsVisible = false; } } } } #endregion ## End of Span Line Point ## } } #endregion #region 2. Trans Media dsAppConfig.Tables[0].DefaultView.RowFilter = "ID = 2"; //Trans Media if (dsAppConfig.Tables[0].DefaultView.Count > 0) { if (Convert.ToBoolean(dsAppConfig.Tables[0].DefaultView[0]["visible"]) == true) //At Parent level { #region Buried_Cable Line feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'line' and id = 2 and lid = 1"; //Buried_Cable if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; flineSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //4; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; slabelfontfamilyname = dsAppConfig.Tables[1].DefaultView[0]["labelfontfamilyname"].ToString(); flabelfontsize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelfontsize"].ToString()); slabelfontcolor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelfontcolor"].ToString(); slabeldrawingfontstyles = sDrawingFontStyle + dsAppConfig.Tables[1].DefaultView[0]["labeldrawingfontstyles"].ToString(); flabelxoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelxoffset"].ToString()); flabelyoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelyoffset"].ToString()); sInnerLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["innerlinecolor"].ToString(); sOutLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["outlinecolor"].ToString(); fInnerLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["innerlinewidth"].ToString()); fOutLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["outlinewidth"].ToString()); sColorHaloPen = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelhalopencolor"].ToString(); fHaloPenWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelhalopenwidth"].ToString()); colorHalopen = GetGeoColor(sColorHaloPen); color = GetGeoColor(sColor); if (sInnerLineColor != "GeoColor.StandardColors.NA") { colorInnerLine = GetGeoColor(sInnerLineColor); }//Not used, needs value in xml } if (sOutLineColor != "GeoColor.StandardColors.NA") { colorOuterLine = GetGeoColor(sOutLineColor); }//Not used, needs value in xml if (sInnerLineColor != "GeoColor.StandardColors.NA" && sOutLineColor != "GeoColor.StandardColors.NA") { linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, colorInnerLine, fInnerLineWidth, colorOuterLine, fOutLineWidth, true); } else { linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, true); } //------------Layer Burried_Cable sl.lyr_line_Buried_Cable = GetShapeFileFeatureLayer(sShapeFilePath); applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); zoomLevelSet = sl.lyr_line_Buried_Cable.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultLineStyle = linestyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_line_Buried_Cable.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_Buried_Cable = new Proj4Projection(); proj4_lines_Buried_Cable.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_Buried_Cable.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_Buried_Cable.FeatureSource.Projection = proj4_lines_Buried_Cable; layerOverLay.Layers.Add("Lyr_Buried_Cable", sl.lyr_line_Buried_Cable); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_line_Buried_Cable.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_line_Buried_Cable.IsVisible = false; } //------------Layer Burried_Cable Label if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { sl.lyr_line_Buried_Cable_lbl = GetShapeFileFeatureLayer(sShapeFilePath); iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // Create text style by column name. //textStyle = TextStyles.City1(sDisplayColName); color = GetGeoColor(slabelfontcolor); drawingfontstyles = GetDrawingFontStyles(slabeldrawingfontstyles); textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, slabelfontfamilyname, flabelfontsize, drawingfontstyles, color,colorHalopen,fHaloPenWidth, flabelxoffset, flabelyoffset); textStyle.AllowLineCarriage = true; textStyle.BestPlacement = true; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; textStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels; //textStyle.XOffsetInPixel = XOffsetInPixel; //textStyle.YOffsetInPixel = YOffsetInPixel; applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); zoomLevelSet_lbl = sl.lyr_line_Buried_Cable_lbl.ZoomLevelSet; startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; startZoomLevel_lbl.DefaultLineStyle = linestyle; startZoomLevel_lbl.DefaultTextStyle = textStyle; startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; sl.lyr_line_Buried_Cable_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_Buried_Cable_lbl = new Proj4Projection(); proj4_lines_Buried_Cable_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_Buried_Cable_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_Buried_Cable_lbl.FeatureSource.Projection = proj4_lines_Buried_Cable_lbl; layerOverLay.Layers.Add("Lbl_Buried_Cable", sl.lyr_line_Buried_Cable_lbl); sl.lyr_line_Buried_Cable_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; //Over write label visibility if, parent layer initflag is false if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) { sl.lyr_line_Buried_Cable_lbl.IsVisible = false; } } } } #endregion ## End of Buried_Cable Line Point ## #region Aerial_Fiber Line feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'line' and id = 2 and lid = 2"; //Aerial_Fiber if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; flineSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //4; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; slabelfontfamilyname = dsAppConfig.Tables[1].DefaultView[0]["labelfontfamilyname"].ToString(); flabelfontsize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelfontsize"].ToString()); slabelfontcolor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelfontcolor"].ToString(); slabeldrawingfontstyles = sDrawingFontStyle + dsAppConfig.Tables[1].DefaultView[0]["labeldrawingfontstyles"].ToString(); flabelxoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelxoffset"].ToString()); flabelyoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelyoffset"].ToString()); sInnerLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["innerlinecolor"].ToString(); sOutLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["outlinecolor"].ToString(); fInnerLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["innerlinewidth"].ToString()); fOutLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["outlinewidth"].ToString()); sColorHaloPen = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelhalopencolor"].ToString(); fHaloPenWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelhalopenwidth"].ToString()); colorHalopen = GetGeoColor(sColorHaloPen); color = GetGeoColor(sColor); if (sInnerLineColor != "GeoColor.StandardColors.NA") { colorInnerLine = GetGeoColor(sInnerLineColor); }//Not used, needs value in xml } if (sOutLineColor != "GeoColor.StandardColors.NA") { colorOuterLine = GetGeoColor(sOutLineColor); }//Not used, needs value in xml if (sInnerLineColor != "GeoColor.StandardColors.NA" && sOutLineColor != "GeoColor.StandardColors.NA") { linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, colorInnerLine, fInnerLineWidth, colorOuterLine, fOutLineWidth, true); } else { linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, true); } //------------Layer Aerial_Fiber sl.lyr_line_Aerial_Fiber = GetShapeFileFeatureLayer(sShapeFilePath); applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); zoomLevelSet = sl.lyr_line_Aerial_Fiber.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultLineStyle = linestyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_line_Aerial_Fiber.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_Aerial_Fiber = new Proj4Projection(); proj4_lines_Aerial_Fiber.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_Aerial_Fiber.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_Aerial_Fiber.FeatureSource.Projection = proj4_lines_Aerial_Fiber; layerOverLay.Layers.Add("Lyr_Aerial_Fiber", sl.lyr_line_Aerial_Fiber); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_line_Aerial_Fiber.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_line_Aerial_Fiber.IsVisible = false; } //------------Layer Aerial_Fiber Lable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { sl.lyr_line_Aerial_Fiber_lbl = GetShapeFileFeatureLayer(sShapeFilePath); iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // Create text style by column name. //textStyle = TextStyles.City1(sDisplayColName); color = GetGeoColor(slabelfontcolor); drawingfontstyles = GetDrawingFontStyles(slabeldrawingfontstyles); textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, slabelfontfamilyname, flabelfontsize, drawingfontstyles, color,colorHalopen,fHaloPenWidth, flabelxoffset, flabelyoffset); textStyle.AllowLineCarriage = true; textStyle.BestPlacement = true; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; textStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels; //textStyle.XOffsetInPixel = XOffsetInPixel; //textStyle.YOffsetInPixel = YOffsetInPixel; applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); zoomLevelSet_lbl = sl.lyr_line_Aerial_Fiber_lbl.ZoomLevelSet; startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; startZoomLevel_lbl.DefaultLineStyle = linestyle; startZoomLevel_lbl.DefaultTextStyle = textStyle; startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; sl.lyr_line_Aerial_Fiber_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_Aerial_Fiber_lbl = new Proj4Projection(); proj4_lines_Aerial_Fiber_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_Aerial_Fiber_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_Aerial_Fiber_lbl.FeatureSource.Projection = proj4_lines_Aerial_Fiber_lbl; layerOverLay.Layers.Add("Lbl_Aerial_Fiber", sl.lyr_line_Aerial_Fiber_lbl); sl.lyr_line_Aerial_Fiber_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; //Over write label visibility if, parent layer initflag is false if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) { sl.lyr_line_Aerial_Fiber_lbl.IsVisible = false; } } } } #endregion ## End of Aerial_Fiber Line Point ## #region Copper_Cable Line feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'line' and id = 2 and lid = 3"; //Copper_Cable if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; flineSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //4; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; slabelfontfamilyname = dsAppConfig.Tables[1].DefaultView[0]["labelfontfamilyname"].ToString(); flabelfontsize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelfontsize"].ToString()); slabelfontcolor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelfontcolor"].ToString(); slabeldrawingfontstyles = sDrawingFontStyle + dsAppConfig.Tables[1].DefaultView[0]["labeldrawingfontstyles"].ToString(); flabelxoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelxoffset"].ToString()); flabelyoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelyoffset"].ToString()); sInnerLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["innerlinecolor"].ToString(); sOutLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["outlinecolor"].ToString(); fInnerLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["innerlinewidth"].ToString()); fOutLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["outlinewidth"].ToString()); sColorHaloPen = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelhalopencolor"].ToString(); fHaloPenWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelhalopenwidth"].ToString()); colorHalopen = GetGeoColor(sColorHaloPen); color = GetGeoColor(sColor); if (sInnerLineColor != "GeoColor.StandardColors.NA") { colorInnerLine = GetGeoColor(sInnerLineColor); }//Not used, needs value in xml } if (sOutLineColor != "GeoColor.StandardColors.NA") { colorOuterLine = GetGeoColor(sOutLineColor); }//Not used, needs value in xml if (sInnerLineColor != "GeoColor.StandardColors.NA" && sOutLineColor != "GeoColor.StandardColors.NA") { linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, colorInnerLine, fInnerLineWidth, colorOuterLine, fOutLineWidth, true); } else { linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, true); } //------------Layer Copper_Cable sl.lyr_line_Copper_Cable = GetShapeFileFeatureLayer(sShapeFilePath); applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); zoomLevelSet = sl.lyr_line_Copper_Cable.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultLineStyle = linestyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_line_Copper_Cable.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_Copper_Cable = new Proj4Projection(); proj4_lines_Copper_Cable.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_Copper_Cable.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_Copper_Cable.FeatureSource.Projection = proj4_lines_Copper_Cable; layerOverLay.Layers.Add("Lyr_Copper_Cable", sl.lyr_line_Copper_Cable); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_line_Copper_Cable.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_line_Copper_Cable.IsVisible = false; } //------------Layer Copper_Cable Lable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { sl.lyr_line_Copper_Cable_lbl = GetShapeFileFeatureLayer(sShapeFilePath); iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // Create text style by column name. //textStyle = TextStyles.City1(sDisplayColName); color = GetGeoColor(slabelfontcolor); drawingfontstyles = GetDrawingFontStyles(slabeldrawingfontstyles); textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, slabelfontfamilyname, flabelfontsize, drawingfontstyles, color,colorHalopen,fHaloPenWidth, flabelxoffset, flabelyoffset); textStyle.AllowLineCarriage = true; textStyle.BestPlacement = true; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; textStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels; //textStyle.XOffsetInPixel = XOffsetInPixel; //textStyle.YOffsetInPixel = YOffsetInPixel; applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); zoomLevelSet_lbl = sl.lyr_line_Copper_Cable_lbl.ZoomLevelSet; startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; startZoomLevel_lbl.DefaultLineStyle = linestyle; startZoomLevel_lbl.DefaultTextStyle = textStyle; startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; sl.lyr_line_Copper_Cable_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_Copper_Cable_lbl = new Proj4Projection(); proj4_lines_Copper_Cable_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_Copper_Cable_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_Copper_Cable_lbl.FeatureSource.Projection = proj4_lines_Copper_Cable_lbl; layerOverLay.Layers.Add("Lbl_Copper_Cable", sl.lyr_line_Copper_Cable_lbl); sl.lyr_line_Copper_Cable_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; //Over write label visibility if, parent layer initflag is false if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) { sl.lyr_line_Copper_Cable_lbl.IsVisible = false; } } } } #endregion ## End of Copper_Cable Line Point ## #region Leased_Cable Line feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'line' and id = 2 and lid = 4"; //Leased_Cable if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; flineSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //4; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; slabelfontfamilyname = dsAppConfig.Tables[1].DefaultView[0]["labelfontfamilyname"].ToString(); flabelfontsize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelfontsize"].ToString()); slabelfontcolor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelfontcolor"].ToString(); slabeldrawingfontstyles = sDrawingFontStyle + dsAppConfig.Tables[1].DefaultView[0]["labeldrawingfontstyles"].ToString(); flabelxoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelxoffset"].ToString()); flabelyoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelyoffset"].ToString()); sInnerLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["innerlinecolor"].ToString(); sOutLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["outlinecolor"].ToString(); fInnerLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["innerlinewidth"].ToString()); fOutLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["outlinewidth"].ToString()); sColorHaloPen = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelhalopencolor"].ToString(); fHaloPenWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelhalopenwidth"].ToString()); colorHalopen = GetGeoColor(sColorHaloPen); color = GetGeoColor(sColor); if (sInnerLineColor != "GeoColor.StandardColors.NA") { colorInnerLine = GetGeoColor(sInnerLineColor); }//Not used, needs value in xml } if (sOutLineColor != "GeoColor.StandardColors.NA") { colorOuterLine = GetGeoColor(sOutLineColor); }//Not used, needs value in xml if (sInnerLineColor != "GeoColor.StandardColors.NA" && sOutLineColor != "GeoColor.StandardColors.NA") { linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, colorInnerLine, fInnerLineWidth, colorOuterLine, fOutLineWidth, true); } else { linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, true); } //------------Layer Leased_Cable sl.lyr_line_Leased_Cable = GetShapeFileFeatureLayer(sShapeFilePath); applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); zoomLevelSet = sl.lyr_line_Leased_Cable.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultLineStyle = linestyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_line_Leased_Cable.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_Leased_Cable = new Proj4Projection(); proj4_lines_Leased_Cable.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_Leased_Cable.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_Leased_Cable.FeatureSource.Projection = proj4_lines_Leased_Cable; layerOverLay.Layers.Add("Lyr_Leased_Cable", sl.lyr_line_Leased_Cable); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_line_Leased_Cable.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_line_Leased_Cable.IsVisible = false; } //------------Layer Leased_Cable Lable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { sl.lyr_line_Leased_Cable_lbl = GetShapeFileFeatureLayer(sShapeFilePath); iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // Create text style by column name. //textStyle = TextStyles.City1(sDisplayColName); color = GetGeoColor(slabelfontcolor); drawingfontstyles = GetDrawingFontStyles(slabeldrawingfontstyles); textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, slabelfontfamilyname, flabelfontsize, drawingfontstyles, color, colorHalopen,fHaloPenWidth, flabelxoffset, flabelyoffset); textStyle.AllowLineCarriage = true; textStyle.BestPlacement = true; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; textStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels; //textStyle.XOffsetInPixel = XOffsetInPixel; //textStyle.YOffsetInPixel = YOffsetInPixel; applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); zoomLevelSet_lbl = sl.lyr_line_Leased_Cable_lbl.ZoomLevelSet; startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; startZoomLevel_lbl.DefaultLineStyle = linestyle; startZoomLevel_lbl.DefaultTextStyle = textStyle; startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; sl.lyr_line_Leased_Cable_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_Leased_Cable_lbl = new Proj4Projection(); proj4_lines_Leased_Cable_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_Leased_Cable_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_Leased_Cable_lbl.FeatureSource.Projection = proj4_lines_Leased_Cable_lbl; layerOverLay.Layers.Add("Lbl_Leased_Cable", sl.lyr_line_Leased_Cable_lbl); sl.lyr_line_Leased_Cable_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; //Over write label visibility if, parent layer initflag is false if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) { sl.lyr_line_Leased_Cable_lbl.IsVisible = false; } } } } #endregion ## End of Leased_Cable Line Point ## ////initialize variables //dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'line' and lid = 10"; //Submarine_Cable //if (dsAppConfig.Tables[1].DefaultView.Count > 0) //{ // if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level // { // sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); // sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; // flineSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); // sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); // iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //4; // sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; // color = GetGeoColor(sColor); // linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, true); // //------------Layer Submarine_Cable // sl.lyr_line_Submarine_Cable = GetShapeFileFeatureLayer(sShapeFilePath); // applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); // zoomLevelSet = sl.lyr_line_Submarine_Cable.ZoomLevelSet; // startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; // startZoomLevel.DefaultLineStyle = linestyle; // startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; // sl.lyr_line_Submarine_Cable.DrawingMarginPercentage = fDrawingMarginPercentage; // Proj4Projection proj4_lines_Submarine_Cable = new Proj4Projection(); // proj4_lines_Submarine_Cable.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); // proj4_lines_Submarine_Cable.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); // sl.lyr_line_Submarine_Cable.FeatureSource.Projection = proj4_lines_Submarine_Cable; // layerOverLay.Layers.Add("Lyr_Submarine_Cable", sl.lyr_line_Submarine_Cable); // if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) // { // //Set default setting // sl.lyr_line_Submarine_Cable.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); // } // else // { // sl.lyr_line_Submarine_Cable.IsVisible = false; // } // //------------Layer Submarine_Cable Lable // if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level // { // sl.lyr_line_Submarine_Cable_lbl = GetShapeFileFeatureLayer(sShapeFilePath); // iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; // sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // // Create text style by column name. // textstyle = TextStyles.City1(sDisplayColName); // applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); // zoomLevelSet_lbl = sl.lyr_line_Submarine_Cable_lbl.ZoomLevelSet; // startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; // startZoomLevel_lbl.DefaultLineStyle = linestyle; // startZoomLevel_lbl.DefaultTextStyle = textStyle; // startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; // sl.lyr_line_Submarine_Cable_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; // Proj4Projection proj4_lines_Submarine_Cable_lbl = new Proj4Projection(); // proj4_lines_Submarine_Cable_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); // proj4_lines_Submarine_Cable_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); // sl.lyr_line_Submarine_Cable_lbl.FeatureSource.Projection = proj4_lines_Submarine_Cable_lbl; // layerOverLay.Layers.Add("Lbl_Submarine_Cable", sl.lyr_line_Submarine_Cable_lbl); // sl.lyr_line_Submarine_Cable_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; // //Over write label visibility if, parent layer initflag is false // if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) // { // sl.lyr_line_Submarine_Cable_lbl.IsVisible = false; // } // } // } //} #endregion ## End of Submarine_Cable Line Point ## } } #endregion #region 3. Attachment //User asked to remove attachement layers form the map.. //I set xml flag=false and commented lagend table code dsAppConfig.Tables[0].DefaultView.RowFilter = "ID = 3"; //Attachment if (dsAppConfig.Tables[0].DefaultView.Count > 0) { if (Convert.ToBoolean(dsAppConfig.Tables[0].DefaultView[0]["visible"]) == true) //At Parent level { #region Aerial_Slack Point feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'point' and id = 3 and lid = 1"; //Aerial_Slack if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); strPointSymbolType = sPointSymbolType + dsAppConfig.Tables[1].DefaultView[0]["PointSymbol"].ToString(); //"PointSymbolType.Diamond"; sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; fpointSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); //"15"; sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); //"TYPE_NAME"; iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //17; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; slabelfontfamilyname = dsAppConfig.Tables[1].DefaultView[0]["labelfontfamilyname"].ToString(); flabelfontsize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelfontsize"].ToString()); slabelfontcolor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelfontcolor"].ToString(); slabeldrawingfontstyles = sDrawingFontStyle + dsAppConfig.Tables[1].DefaultView[0]["labeldrawingfontstyles"].ToString(); flabelxoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelxoffset"].ToString()); flabelyoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelyoffset"].ToString()); sInnerLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["innerlinecolor"].ToString(); sOutLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["outlinecolor"].ToString(); fInnerLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["innerlinewidth"].ToString()); fOutLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["outlinewidth"].ToString()); sColorHaloPen = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelhalopencolor"].ToString(); fHaloPenWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelhalopenwidth"].ToString()); colorHalopen = GetGeoColor(sColorHaloPen); color = GetGeoColor(sColor); if (sInnerLineColor != "GeoColor.StandardColors.NA") { colorInnerLine = GetGeoColor(sInnerLineColor); }//Not used, needs value in xml } if (sOutLineColor != "GeoColor.StandardColors.NA") { colorOuterLine = GetGeoColor(sOutLineColor); }//Not used, needs value in xml pointSymbolType = GetPointSymbolType(strPointSymbolType); //PointSymbolType.Diamond; if (sOutLineColor != "GeoColor.StandardColors.NA") { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, colorOuterLine, fOutLineWidth, fpointSize); } else { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, fpointSize); } //------------Layer Access Point sl.lyr_point_Aerial_Slack = GetShapeFileFeatureLayer(sShapeFilePath); // Create ApplyUntilZoomLevel from String. applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); // Get Start Zoom Level Index. zoomLevelSet = sl.lyr_point_Aerial_Slack.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultPointStyle = pointStyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_point_Aerial_Slack.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lyr_point_Aerial_Slack = new Proj4Projection(); proj4_lyr_point_Aerial_Slack.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lyr_point_Aerial_Slack.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Aerial_Slack.FeatureSource.Projection = proj4_lyr_point_Aerial_Slack; layerOverLay.Layers.Add("Lyr_Aerial_Slack", sl.lyr_point_Aerial_Slack); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_point_Aerial_Slack.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_point_Aerial_Slack.IsVisible = false; } //------------ //------------Layer Aerial Slack Lable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { sl.lyr_point_Aerial_Slack_lbl = GetShapeFileFeatureLayer(sShapeFilePath); iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // Create text style by column name. //textStyle = TextStyles.City1(sDisplayColName); color = GetGeoColor(slabelfontcolor); drawingfontstyles = GetDrawingFontStyles(slabeldrawingfontstyles); textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, slabelfontfamilyname, flabelfontsize, drawingfontstyles, color,colorHalopen,fHaloPenWidth, flabelxoffset, flabelyoffset); textStyle.AllowLineCarriage = true; textStyle.BestPlacement = true; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; //textStyle.XOffsetInPixel = XOffsetInPixel; //textStyle.YOffsetInPixel = YOffsetInPixel; applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); zoomLevelSet_lbl = sl.lyr_point_Aerial_Slack_lbl.ZoomLevelSet; startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; startZoomLevel_lbl.DefaultPointStyle = pointStyle; startZoomLevel_lbl.DefaultTextStyle = textStyle; startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; sl.lyr_point_Aerial_Slack_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lyr_point_Aerial_Slack_lbl = new Proj4Projection(); proj4_lyr_point_Aerial_Slack_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lyr_point_Aerial_Slack_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Aerial_Slack_lbl.FeatureSource.Projection = proj4_lyr_point_Aerial_Slack_lbl; layerOverLay.Layers.Add("Lbl_Aerial_Slack", sl.lyr_point_Aerial_Slack_lbl); sl.lyr_point_Aerial_Slack_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; //Over write label visibility if, parent layer initflag is false if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) { sl.lyr_point_Aerial_Slack_lbl.IsVisible = false; } } //------------ } } #endregion ## End of Aerial_Slack Point ## #region Underground_Slack Point feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'point' and id = 3 and lid = 2"; //Underground_Slack if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); strPointSymbolType = sPointSymbolType + dsAppConfig.Tables[1].DefaultView[0]["PointSymbol"].ToString(); //"PointSymbolType.Diamond"; sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; fpointSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); //"15"; sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); //"TYPE_NAME"; iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //17; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; slabelfontfamilyname = dsAppConfig.Tables[1].DefaultView[0]["labelfontfamilyname"].ToString(); flabelfontsize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelfontsize"].ToString()); slabelfontcolor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelfontcolor"].ToString(); slabeldrawingfontstyles = sDrawingFontStyle + dsAppConfig.Tables[1].DefaultView[0]["labeldrawingfontstyles"].ToString(); flabelxoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelxoffset"].ToString()); flabelyoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelyoffset"].ToString()); sInnerLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["innerlinecolor"].ToString(); sOutLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["outlinecolor"].ToString(); fInnerLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["innerlinewidth"].ToString()); fOutLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["outlinewidth"].ToString()); sColorHaloPen = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelhalopencolor"].ToString(); fHaloPenWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelhalopenwidth"].ToString()); colorHalopen = GetGeoColor(sColorHaloPen); color = GetGeoColor(sColor); if (sInnerLineColor != "GeoColor.StandardColors.NA") { colorInnerLine = GetGeoColor(sInnerLineColor); }//Not used, needs value in xml } if (sOutLineColor != "GeoColor.StandardColors.NA") { colorOuterLine = GetGeoColor(sOutLineColor); }//Not used, needs value in xml pointSymbolType = GetPointSymbolType(strPointSymbolType); //PointSymbolType.Diamond; if (sOutLineColor != "GeoColor.StandardColors.NA") { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, colorOuterLine, fOutLineWidth, fpointSize); } else { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, fpointSize); } //------------Layer Access Point sl.lyr_point_Underground_Slack = GetShapeFileFeatureLayer(sShapeFilePath); // Create ApplyUntilZoomLevel from String. applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); // Get Start Zoom Level Index. zoomLevelSet = sl.lyr_point_Underground_Slack.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultPointStyle = pointStyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_point_Underground_Slack.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lyr_point_Underground_Slack = new Proj4Projection(); proj4_lyr_point_Underground_Slack.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lyr_point_Underground_Slack.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Underground_Slack.FeatureSource.Projection = proj4_lyr_point_Underground_Slack; layerOverLay.Layers.Add("Lyr_Underground_Slack", sl.lyr_point_Underground_Slack); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_point_Underground_Slack.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_point_Underground_Slack.IsVisible = false; } //------------ //------------Layer Underground Slack Lable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { sl.lyr_point_Underground_Slack_lbl = GetShapeFileFeatureLayer(sShapeFilePath); iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // Create text style by column name. //textStyle = TextStyles.City1(sDisplayColName); color = GetGeoColor(slabelfontcolor); drawingfontstyles = GetDrawingFontStyles(slabeldrawingfontstyles); textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, slabelfontfamilyname, flabelfontsize, drawingfontstyles, color,colorHalopen,fHaloPenWidth, flabelxoffset, flabelyoffset); textStyle.AllowLineCarriage = true; textStyle.BestPlacement = true; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; //textStyle.XOffsetInPixel = XOffsetInPixel; //textStyle.YOffsetInPixel = YOffsetInPixel; applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); zoomLevelSet_lbl = sl.lyr_point_Underground_Slack_lbl.ZoomLevelSet; startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; startZoomLevel_lbl.DefaultPointStyle = pointStyle; startZoomLevel_lbl.DefaultTextStyle = textStyle; startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; sl.lyr_point_Underground_Slack_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lyr_point_Underground_Slack_lbl = new Proj4Projection(); proj4_lyr_point_Underground_Slack_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lyr_point_Underground_Slack_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Underground_Slack_lbl.FeatureSource.Projection = proj4_lyr_point_Underground_Slack_lbl; layerOverLay.Layers.Add("Lbl_Underground_Slack", sl.lyr_point_Underground_Slack_lbl); sl.lyr_point_Underground_Slack_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; //Over write label visibility if, parent layer initflag is false if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) { sl.lyr_point_Underground_Slack_lbl.IsVisible = false; } } //------------ } } #endregion ## End of Underground_Slack Point ## } } #endregion #region 4. Structure dsAppConfig.Tables[0].DefaultView.RowFilter = "ID = 4"; //Structure if (dsAppConfig.Tables[0].DefaultView.Count > 0) { if (Convert.ToBoolean(dsAppConfig.Tables[0].DefaultView[0]["visible"]) == true) //At Parent level { #region Site Line feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'line' and id = 4 and lid = 1"; //Site if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; flineSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //4; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; slabelfontfamilyname = dsAppConfig.Tables[1].DefaultView[0]["labelfontfamilyname"].ToString(); flabelfontsize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelfontsize"].ToString()); slabelfontcolor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelfontcolor"].ToString(); slabeldrawingfontstyles = sDrawingFontStyle + dsAppConfig.Tables[1].DefaultView[0]["labeldrawingfontstyles"].ToString(); flabelxoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelxoffset"].ToString()); flabelyoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelyoffset"].ToString()); sInnerLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["innerlinecolor"].ToString(); sOutLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["outlinecolor"].ToString(); fInnerLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["innerlinewidth"].ToString()); fOutLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["outlinewidth"].ToString()); color = GetGeoColor(sColor); if (sInnerLineColor != "GeoColor.StandardColors.NA") { colorInnerLine = GetGeoColor(sInnerLineColor); }//Not used, needs value in xml } if (sOutLineColor != "GeoColor.StandardColors.NA") { colorOuterLine = GetGeoColor(sOutLineColor); }//Not used, needs value in xml if (sInnerLineColor != "GeoColor.StandardColors.NA" && sOutLineColor != "GeoColor.StandardColors.NA") { linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, colorInnerLine, fInnerLineWidth, colorOuterLine, fOutLineWidth, true); } else { linestyle = LineStyles.CreateSimpleLineStyle(color, flineSize, true); } //------------Layer Site sl.lyr_line_Site = GetShapeFileFeatureLayer(sShapeFilePath); applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); zoomLevelSet = sl.lyr_line_Site.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultLineStyle = linestyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_line_Site.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_Site = new Proj4Projection(); proj4_lines_Site.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_Site.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_Site.FeatureSource.Projection = proj4_lines_Site; layerOverLay.Layers.Add("Lyr_Site", sl.lyr_line_Site); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_line_Site.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_line_Site.IsVisible = false; } //------------Layer Site Lable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { sl.lyr_line_Site_lbl = GetShapeFileFeatureLayer(sShapeFilePath); iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // Create text style by column name. //textStyle = TextStyles.City1(sDisplayColName); sColorHaloPen = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelhalopencolor"].ToString(); fHaloPenWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelhalopenwidth"].ToString()); colorHalopen = GetGeoColor(sColorHaloPen); color = GetGeoColor(sColor); drawingfontstyles = GetDrawingFontStyles(slabeldrawingfontstyles); textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, slabelfontfamilyname, flabelfontsize, drawingfontstyles, color,colorHalopen,fHaloPenWidth, flabelxoffset, flabelyoffset); textStyle.AllowLineCarriage = true; textStyle.BestPlacement = true; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; textStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels; //textStyle.XOffsetInPixel = XOffsetInPixel; //textStyle.YOffsetInPixel = YOffsetInPixel; applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); zoomLevelSet_lbl = sl.lyr_line_Site_lbl.ZoomLevelSet; startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; startZoomLevel_lbl.DefaultLineStyle = linestyle; startZoomLevel_lbl.DefaultTextStyle = textStyle; startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; sl.lyr_line_Site_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_lines_Site_lbl = new Proj4Projection(); proj4_lines_Site_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_lines_Site_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_line_Site_lbl.FeatureSource.Projection = proj4_lines_Site_lbl; layerOverLay.Layers.Add("Lbl_Site", sl.lyr_line_Site_lbl); sl.lyr_line_Site_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; //Over write label visibility if, parent layer initflag is false if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) { sl.lyr_line_Site_lbl.IsVisible = false; } } } } #endregion ## End of Site Line Point ## #region Building Point feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'point' and id = 4 and lid = 2"; //Building if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); strPointSymbolType = sPointSymbolType + dsAppConfig.Tables[1].DefaultView[0]["PointSymbol"].ToString(); //"PointSymbolType.Circle"; sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; fpointSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); //"15"; sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); //"Address"; iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //12; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; slabelfontfamilyname = dsAppConfig.Tables[1].DefaultView[0]["labelfontfamilyname"].ToString(); flabelfontsize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelfontsize"].ToString()); slabelfontcolor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelfontcolor"].ToString(); slabeldrawingfontstyles = sDrawingFontStyle + dsAppConfig.Tables[1].DefaultView[0]["labeldrawingfontstyles"].ToString(); flabelxoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelxoffset"].ToString()); flabelyoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelyoffset"].ToString()); sInnerLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["innerlinecolor"].ToString(); sOutLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["outlinecolor"].ToString(); fInnerLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["innerlinewidth"].ToString()); fOutLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["outlinewidth"].ToString()); sColorHaloPen = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelhalopencolor"].ToString(); fHaloPenWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelhalopenwidth"].ToString()); colorHalopen = GetGeoColor(sColorHaloPen); color = GetGeoColor(sColor); if (sInnerLineColor != "GeoColor.StandardColors.NA") { colorInnerLine = GetGeoColor(sInnerLineColor); }//Not used, needs value in xml } if (sOutLineColor != "GeoColor.StandardColors.NA") { colorOuterLine = GetGeoColor(sOutLineColor); }//Not used, needs value in xml pointSymbolType = GetPointSymbolType(strPointSymbolType); //PointSymbolType.Circle; if (sOutLineColor != "GeoColor.StandardColors.NA") { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, colorOuterLine, fOutLineWidth, fpointSize); } else { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, fpointSize); } //------------Layer Access Point sl.lyr_point_Building = GetShapeFileFeatureLayer(sShapeFilePath); // Create ApplyUntilZoomLevel from String. applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); // Get Start Zoom Level Index. zoomLevelSet = sl.lyr_point_Building.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultPointStyle = pointStyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_point_Building.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_points_Building = new Proj4Projection(); proj4_points_Building.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_points_Building.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Building.FeatureSource.Projection = proj4_points_Building; layerOverLay.Layers.Add("Lyr_Building", sl.lyr_point_Building); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_point_Building.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_point_Building.IsVisible = false; } //------------ //------------Layer Access Point Lable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { sl.lyr_point_Building_lbl = GetShapeFileFeatureLayer(sShapeFilePath); iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // Create text style by column name. //textStyle = TextStyles.City1(sDisplayColName); color = GetGeoColor(slabelfontcolor); drawingfontstyles = GetDrawingFontStyles(slabeldrawingfontstyles); textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, slabelfontfamilyname, flabelfontsize, drawingfontstyles, color,colorHalopen,fHaloPenWidth, flabelxoffset, flabelyoffset); textStyle.AllowLineCarriage = true; textStyle.BestPlacement = true; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; textStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels; //textStyle.XOffsetInPixel = XOffsetInPixel; //textStyle.YOffsetInPixel = YOffsetInPixel; applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); zoomLevelSet_lbl = sl.lyr_point_Building_lbl.ZoomLevelSet; startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; startZoomLevel_lbl.DefaultPointStyle = pointStyle; startZoomLevel_lbl.DefaultTextStyle = textStyle; startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; sl.lyr_point_Building_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_points_Building_lbl = new Proj4Projection(); proj4_points_Building_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_points_Building_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Building_lbl.FeatureSource.Projection = proj4_points_Building_lbl; layerOverLay.Layers.Add("Lbl_Building", sl.lyr_point_Building_lbl); sl.lyr_point_Building_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; //Over write label visibility if, parent layer initflag is false if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) { sl.lyr_point_Building_lbl.IsVisible = false; } } //------------ } } #endregion ## End of Building Point ## #region Pole Point feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'point' and id = 4 and lid = 3"; //Pole if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); strPointSymbolType = sPointSymbolType + dsAppConfig.Tables[1].DefaultView[0]["PointSymbol"].ToString(); //"PointSymbolType.Circle"; sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; fpointSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); //"15"; sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); //"TYPE_NAME"; iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //17; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; slabelfontfamilyname = dsAppConfig.Tables[1].DefaultView[0]["labelfontfamilyname"].ToString(); flabelfontsize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelfontsize"].ToString()); slabelfontcolor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelfontcolor"].ToString(); slabeldrawingfontstyles = sDrawingFontStyle + dsAppConfig.Tables[1].DefaultView[0]["labeldrawingfontstyles"].ToString(); flabelxoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelxoffset"].ToString()); flabelyoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelyoffset"].ToString()); sInnerLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["innerlinecolor"].ToString(); sOutLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["outlinecolor"].ToString(); fInnerLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["innerlinewidth"].ToString()); fOutLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["outlinewidth"].ToString()); sColorHaloPen = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelhalopencolor"].ToString(); fHaloPenWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelhalopenwidth"].ToString()); colorHalopen = GetGeoColor(sColorHaloPen); color = GetGeoColor(sColor); if (sInnerLineColor != "GeoColor.StandardColors.NA") { colorInnerLine = GetGeoColor(sInnerLineColor); }//Not used, needs value in xml } if (sOutLineColor != "GeoColor.StandardColors.NA") { colorOuterLine = GetGeoColor(sOutLineColor); }//Not used, needs value in xml pointSymbolType = GetPointSymbolType(strPointSymbolType); //PointSymbolType.Circle; if (sOutLineColor != "GeoColor.StandardColors.NA") { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, colorOuterLine, fOutLineWidth, fpointSize); } else { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, fpointSize); } //------------Layer Access Point sl.lyr_point_Pole = GetShapeFileFeatureLayer(sShapeFilePath); // Create ApplyUntilZoomLevel from String. applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); // Get Start Zoom Level Index. zoomLevelSet = sl.lyr_point_Pole.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultPointStyle = pointStyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_point_Pole.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_points_Pole = new Proj4Projection(); proj4_points_Pole.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_points_Pole.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Pole.FeatureSource.Projection = proj4_points_Pole; layerOverLay.Layers.Add("Lyr_Pole", sl.lyr_point_Pole); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_point_Pole.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_point_Pole.IsVisible = false; } //------------ //------------Layer Access Point Lable //if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["labelvisible"]) == true) //At label level if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { sl.lyr_point_Pole_lbl = GetShapeFileFeatureLayer(sShapeFilePath); iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // Create text style by column name. //textStyle = TextStyles.City1(sDisplayColName); color = GetGeoColor(slabelfontcolor); drawingfontstyles = GetDrawingFontStyles(slabeldrawingfontstyles); textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, slabelfontfamilyname, flabelfontsize, drawingfontstyles, color,colorHalopen,fHaloPenWidth, flabelxoffset, flabelyoffset); textStyle.AllowLineCarriage = true; textStyle.BestPlacement = true; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; textStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels; //textStyle.XOffsetInPixel = XOffsetInPixel; //textStyle.YOffsetInPixel = YOffsetInPixel; applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); zoomLevelSet_lbl = sl.lyr_point_Pole_lbl.ZoomLevelSet; startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; startZoomLevel_lbl.DefaultPointStyle = pointStyle; startZoomLevel_lbl.DefaultTextStyle = textStyle; startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; sl.lyr_point_Pole_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_points_Pole_lbl = new Proj4Projection(); proj4_points_Pole_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_points_Pole_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Pole_lbl.FeatureSource.Projection = proj4_points_Pole_lbl; layerOverLay.Layers.Add("Lbl_Pole", sl.lyr_point_Pole_lbl); sl.lyr_point_Pole_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; //Over write label visibility if, parent layer initflag is false if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) { sl.lyr_point_Pole_lbl.IsVisible = false; } } //------------ } } #endregion ## End of Pole Point ## #region Tower Point feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'point' and id = 4 and lid = 4"; //Tower if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); strPointSymbolType = sPointSymbolType + dsAppConfig.Tables[1].DefaultView[0]["PointSymbol"].ToString(); //"PointSymbolType.Diamond"; sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; fpointSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); //"15"; sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); //"TYPE_NAME"; iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //17; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; slabelfontfamilyname = dsAppConfig.Tables[1].DefaultView[0]["labelfontfamilyname"].ToString(); flabelfontsize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelfontsize"].ToString()); slabelfontcolor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelfontcolor"].ToString(); slabeldrawingfontstyles = sDrawingFontStyle + dsAppConfig.Tables[1].DefaultView[0]["labeldrawingfontstyles"].ToString(); flabelxoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelxoffset"].ToString()); flabelyoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelyoffset"].ToString()); sInnerLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["innerlinecolor"].ToString(); sOutLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["outlinecolor"].ToString(); fInnerLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["innerlinewidth"].ToString()); fOutLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["outlinewidth"].ToString()); sColorHaloPen = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelhalopencolor"].ToString(); fHaloPenWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelhalopenwidth"].ToString()); colorHalopen = GetGeoColor(sColorHaloPen); color = GetGeoColor(sColor); if (sInnerLineColor != "GeoColor.StandardColors.NA") { colorInnerLine = GetGeoColor(sInnerLineColor); }//Not used, needs value in xml } if (sOutLineColor != "GeoColor.StandardColors.NA") { colorOuterLine = GetGeoColor(sOutLineColor); }//Not used, needs value in xml pointSymbolType = GetPointSymbolType(strPointSymbolType); //PointSymbolType.Diamond; if (sOutLineColor != "GeoColor.StandardColors.NA") { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, colorOuterLine, fOutLineWidth, fpointSize); } else { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, fpointSize); } //------------Layer Access Point sl.lyr_point_Tower = GetShapeFileFeatureLayer(sShapeFilePath); // Create ApplyUntilZoomLevel from String. applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); // Get Start Zoom Level Index. zoomLevelSet = sl.lyr_point_Tower.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultPointStyle = pointStyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_point_Tower.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_points_Tower = new Proj4Projection(); proj4_points_Tower.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_points_Tower.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Tower.FeatureSource.Projection = proj4_points_Tower; layerOverLay.Layers.Add("Lyr_Tower", sl.lyr_point_Tower); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_point_Tower.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_point_Tower.IsVisible = false; } //------------ //------------Layer Access Point Lable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { sl.lyr_point_Tower_lbl = GetShapeFileFeatureLayer(sShapeFilePath); iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // Create text style by column name. //textStyle = TextStyles.City1(sDisplayColName); color = GetGeoColor(slabelfontcolor); drawingfontstyles = GetDrawingFontStyles(slabeldrawingfontstyles); textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, slabelfontfamilyname, flabelfontsize, drawingfontstyles, color,colorHalopen,fHaloPenWidth, flabelxoffset, flabelyoffset); textStyle.AllowLineCarriage = true; textStyle.BestPlacement = true; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; textStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels; //textStyle.XOffsetInPixel = XOffsetInPixel; //textStyle.YOffsetInPixel = YOffsetInPixel; applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); zoomLevelSet_lbl = sl.lyr_point_Tower_lbl.ZoomLevelSet; startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; startZoomLevel_lbl.DefaultPointStyle = pointStyle; startZoomLevel_lbl.DefaultTextStyle = textStyle; startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; sl.lyr_point_Tower_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_points_Tower_lbl = new Proj4Projection(); proj4_points_Tower_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_points_Tower_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Tower_lbl.FeatureSource.Projection = proj4_points_Tower_lbl; layerOverLay.Layers.Add("Lbl_Tower", sl.lyr_point_Tower_lbl); sl.lyr_point_Tower_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; //Over write label visibility if, parent layer initflag is false if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) { sl.lyr_point_Tower_lbl.IsVisible = false; } } //------------ } } #endregion ## End of Tower Point ## } } #endregion #region 5. Access Point dsAppConfig.Tables[0].DefaultView.RowFilter = "ID = 5"; //Access Point if (dsAppConfig.Tables[0].DefaultView.Count > 0) { if (Convert.ToBoolean(dsAppConfig.Tables[0].DefaultView[0]["visible"]) == true) //At Parent level { #region AccessPoint Point feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'point' and id = 5 and lid = 1"; //Access_Points if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); strPointSymbolType = sPointSymbolType + dsAppConfig.Tables[1].DefaultView[0]["PointSymbol"].ToString(); //"PointSymbolType.Circle"; sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; fpointSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); //"15"; sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); //"TYPE_NAME"; iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //17; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; slabelfontfamilyname = dsAppConfig.Tables[1].DefaultView[0]["labelfontfamilyname"].ToString(); flabelfontsize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelfontsize"].ToString()); slabelfontcolor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelfontcolor"].ToString(); slabeldrawingfontstyles = sDrawingFontStyle + dsAppConfig.Tables[1].DefaultView[0]["labeldrawingfontstyles"].ToString(); flabelxoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelxoffset"].ToString()); flabelyoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelyoffset"].ToString()); sInnerLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["innerlinecolor"].ToString(); sOutLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["outlinecolor"].ToString(); fInnerLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["innerlinewidth"].ToString()); fOutLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["outlinewidth"].ToString()); sColorHaloPen = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelhalopencolor"].ToString(); fHaloPenWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelhalopenwidth"].ToString()); colorHalopen = GetGeoColor(sColorHaloPen); color = GetGeoColor(sColor); if (sInnerLineColor != "GeoColor.StandardColors.NA") { colorInnerLine = GetGeoColor(sInnerLineColor); }//Not used, needs value in xml } if (sOutLineColor != "GeoColor.StandardColors.NA") { colorOuterLine = GetGeoColor(sOutLineColor); }//Not used, needs value in xml pointSymbolType = GetPointSymbolType(strPointSymbolType); //PointSymbolType.Square; if (sOutLineColor != "GeoColor.StandardColors.NA") { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, colorOuterLine, fOutLineWidth, fpointSize); } else { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, fpointSize); } //linestyle = LineStyles.CreateSimpleLineStyle(color, 2, color, 10, color, 10, true); //LineStyles.CreateSimpleLineStyle(color, 2, color, 10, color, 10, true); //------------Layer Access Point sl.lyr_point_Access_Point = GetShapeFileFeatureLayer(sShapeFilePath); // Create ApplyUntilZoomLevel from String. applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); // Get Start Zoom Level Index. zoomLevelSet = sl.lyr_point_Access_Point.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultPointStyle = pointStyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_point_Access_Point.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_points_Access_Points = new Proj4Projection(); proj4_points_Access_Points.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_points_Access_Points.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Access_Point.FeatureSource.Projection = proj4_points_Access_Points; layerOverLay.Layers.Add("Lyr_Access_Point", sl.lyr_point_Access_Point); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_point_Access_Point.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_point_Access_Point.IsVisible = false; } //------------ //------------Layer Access Point Lable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { sl.lyr_point_Access_Point_lbl = GetShapeFileFeatureLayer(sShapeFilePath); iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // Create text style by column name. //textStyle = TextStyles.City1(sDisplayColName); color = GetGeoColor(slabelfontcolor); drawingfontstyles = GetDrawingFontStyles(slabeldrawingfontstyles); textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, slabelfontfamilyname, flabelfontsize, drawingfontstyles, color, colorHalopen, fHaloPenWidth, flabelxoffset, flabelyoffset); textStyle.AllowLineCarriage = true; textStyle.BestPlacement = true; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; textStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels; //textStyle.HaloPen = new GeoPen(GeoColor.StandardColors.White,5); //textStyle.XOffsetInPixel = XOffsetInPixel; //textStyle.YOffsetInPixel = YOffsetInPixel; applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); zoomLevelSet_lbl = sl.lyr_point_Access_Point_lbl.ZoomLevelSet; startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; startZoomLevel_lbl.DefaultPointStyle = pointStyle; startZoomLevel_lbl.DefaultTextStyle = textStyle; startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; sl.lyr_point_Access_Point_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_points_Access_Points_lbl = new Proj4Projection(); proj4_points_Access_Points_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_points_Access_Points_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Access_Point_lbl.FeatureSource.Projection = proj4_points_Access_Points_lbl; layerOverLay.Layers.Add("Lbl_Access_Point", sl.lyr_point_Access_Point_lbl); sl.lyr_point_Access_Point_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; //Over write label visibility if, parent layer initflag is false if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) { sl.lyr_point_Access_Point_lbl.IsVisible = false; } } //------------ } } #endregion ## End of AccessPoint Point ## } } #endregion #region 7. Equipment dsAppConfig.Tables[0].DefaultView.RowFilter = "ID = 7"; //Equipment if (dsAppConfig.Tables[0].DefaultView.Count > 0) { if (Convert.ToBoolean(dsAppConfig.Tables[0].DefaultView[0]["visible"]) == true) //At Parent level { #region Termination_Panel Point feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'point' and id = 7 and lid = 1"; //Termination_Panel if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); strPointSymbolType = sPointSymbolType + dsAppConfig.Tables[1].DefaultView[0]["PointSymbol"].ToString(); //"PointSymbolType.Diamond"; sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; fpointSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); //"15"; sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); //"TYPE_NAME"; iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //17; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; slabelfontfamilyname = dsAppConfig.Tables[1].DefaultView[0]["labelfontfamilyname"].ToString(); flabelfontsize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelfontsize"].ToString()); slabelfontcolor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelfontcolor"].ToString(); slabeldrawingfontstyles = sDrawingFontStyle + dsAppConfig.Tables[1].DefaultView[0]["labeldrawingfontstyles"].ToString(); flabelxoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelxoffset"].ToString()); flabelyoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelyoffset"].ToString()); sInnerLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["innerlinecolor"].ToString(); sOutLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["outlinecolor"].ToString(); fInnerLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["innerlinewidth"].ToString()); fOutLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["outlinewidth"].ToString()); sColorHaloPen = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelhalopencolor"].ToString(); fHaloPenWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelhalopenwidth"].ToString()); colorHalopen = GetGeoColor(sColorHaloPen); color = GetGeoColor(sColor); if (sInnerLineColor != "GeoColor.StandardColors.NA") { colorInnerLine = GetGeoColor(sInnerLineColor); }//Not used, needs value in xml } if (sOutLineColor != "GeoColor.StandardColors.NA") { colorOuterLine = GetGeoColor(sOutLineColor); }//Not used, needs value in xml pointSymbolType = GetPointSymbolType(strPointSymbolType); //PointSymbolType.Diamond; if (sOutLineColor != "GeoColor.StandardColors.NA") { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, colorOuterLine, fOutLineWidth, fpointSize); } else { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, fpointSize); } //------------Layer Access Point sl.lyr_point_Termination_Panel = GetShapeFileFeatureLayer(sShapeFilePath); // Create ApplyUntilZoomLevel from String. applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); // Get Start Zoom Level Index. zoomLevelSet = sl.lyr_point_Termination_Panel.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultPointStyle = pointStyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_point_Termination_Panel.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_points_Termination_Panel = new Proj4Projection(); proj4_points_Termination_Panel.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_points_Termination_Panel.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Termination_Panel.FeatureSource.Projection = proj4_points_Termination_Panel; layerOverLay.Layers.Add("Lyr_Termination_Panel", sl.lyr_point_Termination_Panel); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_point_Termination_Panel.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_point_Termination_Panel.IsVisible = false; } //------------ //------------Layer Terminiation panel Lable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { sl.lyr_point_Termination_Panel_lbl = GetShapeFileFeatureLayer(sShapeFilePath); iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // Create text style by column name. //textStyle = TextStyles.City1(sDisplayColName); color = GetGeoColor(slabelfontcolor); drawingfontstyles = GetDrawingFontStyles(slabeldrawingfontstyles); textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, slabelfontfamilyname, flabelfontsize, drawingfontstyles, color,colorHalopen,fHaloPenWidth, flabelxoffset, flabelyoffset); textStyle.AllowLineCarriage = true; textStyle.BestPlacement = true; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; textStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels; //textStyle.XOffsetInPixel = XOffsetInPixel; //textStyle.YOffsetInPixel = YOffsetInPixel; applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); zoomLevelSet_lbl = sl.lyr_point_Termination_Panel_lbl.ZoomLevelSet; startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; startZoomLevel_lbl.DefaultPointStyle = pointStyle; startZoomLevel_lbl.DefaultTextStyle = textStyle; startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; sl.lyr_point_Termination_Panel_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_points_Termination_Panel_lbl = new Proj4Projection(); proj4_points_Termination_Panel_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_points_Termination_Panel_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Termination_Panel_lbl.FeatureSource.Projection = proj4_points_Termination_Panel_lbl; layerOverLay.Layers.Add("Lbl_Termination_Panel", sl.lyr_point_Termination_Panel_lbl); sl.lyr_point_Termination_Panel_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; //Over write label visibility if, parent layer initflag is false if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) { sl.lyr_point_Termination_Panel_lbl.IsVisible = false; } } //------------ } } #endregion ## End of Termination_Panel Point ## } } #endregion #region 8. Splice Closure dsAppConfig.Tables[0].DefaultView.RowFilter = "ID = 8"; //Splice Closure if (dsAppConfig.Tables[0].DefaultView.Count > 0) { if (Convert.ToBoolean(dsAppConfig.Tables[0].DefaultView[0]["visible"]) == true) //At Parent level { #region Splice_Closure Point feature layer declaration //initialize variables dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'point' and id = 8 and lid = 1"; //Splice_Closure if (dsAppConfig.Tables[1].DefaultView.Count > 0) { if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) != 0) //At layer top level { sShapeFilePath = sDataFolder + dsAppConfig.Tables[1].DefaultView[0]["datasource"].ToString(); strPointSymbolType = sPointSymbolType + dsAppConfig.Tables[1].DefaultView[0]["PointSymbol"].ToString(); //"PointSymbolType.Diamond"; sColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["color"].ToString(); //"GeoColor.SimpleColors.Blue"; fpointSize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["size"].ToString()); //"15"; sDisplayColName = dsAppConfig.Tables[1].DefaultView[0]["labelcolumndisplay"].ToString(); //"TYPE_NAME"; iZoomLevelStart = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["scaleupper"]); //17; sZoomlevelEnd = sLevel + dsAppConfig.Tables[1].DefaultView[0]["scalelower"].ToString(); // "Level20"; slabelfontfamilyname = dsAppConfig.Tables[1].DefaultView[0]["labelfontfamilyname"].ToString(); flabelfontsize = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelfontsize"].ToString()); slabelfontcolor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelfontcolor"].ToString(); slabeldrawingfontstyles = sDrawingFontStyle + dsAppConfig.Tables[1].DefaultView[0]["labeldrawingfontstyles"].ToString(); flabelxoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelxoffset"].ToString()); flabelyoffset = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelyoffset"].ToString()); sInnerLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["innerlinecolor"].ToString(); sOutLineColor = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["outlinecolor"].ToString(); fInnerLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["innerlinewidth"].ToString()); fOutLineWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["outlinewidth"].ToString()); sColorHaloPen = sGeoColorSimpleColors + dsAppConfig.Tables[1].DefaultView[0]["labelhalopencolor"].ToString(); fHaloPenWidth = float.Parse(dsAppConfig.Tables[1].DefaultView[0]["labelhalopenwidth"].ToString()); colorHalopen = GetGeoColor(sColorHaloPen); color = GetGeoColor(sColor); if (sInnerLineColor != "GeoColor.StandardColors.NA") { colorInnerLine = GetGeoColor(sInnerLineColor); }//Not used, needs value in xml } if (sOutLineColor != "GeoColor.StandardColors.NA") { colorOuterLine = GetGeoColor(sOutLineColor); }//Not used, needs value in xml pointSymbolType = GetPointSymbolType(strPointSymbolType); //PointSymbolType.Square; if (sOutLineColor != "GeoColor.StandardColors.NA") { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, colorOuterLine, fOutLineWidth, fpointSize); } else { pointStyle = PointStyles.CreateSimplePointStyle(pointSymbolType, color, fpointSize); } //------------Layer Access Point sl.lyr_point_Splice_Closure = GetShapeFileFeatureLayer(sShapeFilePath); // Create ApplyUntilZoomLevel from String. applyUntilZoomlevel = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd); // Get Start Zoom Level Index. zoomLevelSet = sl.lyr_point_Splice_Closure.ZoomLevelSet; startZoomLevel = zoomLevelSet.GetZoomLevels()[iZoomLevelStart]; startZoomLevel.DefaultPointStyle = pointStyle; startZoomLevel.ApplyUntilZoomLevel = applyUntilZoomlevel; sl.lyr_point_Splice_Closure.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_points_Splice_Closure = new Proj4Projection(); proj4_points_Splice_Closure.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_points_Splice_Closure.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Splice_Closure.FeatureSource.Projection = proj4_points_Splice_Closure; layerOverLay.Layers.Add("Lyr_Splice_Closure", sl.lyr_point_Splice_Closure); if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lyr_status"]) == 1) { //Set default setting sl.lyr_point_Splice_Closure.IsVisible = Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]); } else { sl.lyr_point_Splice_Closure.IsVisible = false; } //------------ //------------Layer Access Point Lable if (Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) != 0) //At label level { sl.lyr_point_Splice_Closure_lbl = GetShapeFileFeatureLayer(sShapeFilePath); iZoomLevelStart_lbl = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["labelscaleupper"]); //18; sZoomlevelEnd_lbl = sLevel + dsAppConfig.Tables[1].DefaultView[0]["labelscalelower"].ToString(); // "Level20"; // Create text style by column name. //textStyle = TextStyles.City1(sDisplayColName); color = GetGeoColor(slabelfontcolor); drawingfontstyles = GetDrawingFontStyles(slabeldrawingfontstyles); textStyle = TextStyles.CreateSimpleTextStyle(sDisplayColName, slabelfontfamilyname, flabelfontsize, drawingfontstyles, color,colorHalopen,fHaloPenWidth, flabelxoffset, flabelyoffset); textStyle.AllowLineCarriage = true; textStyle.BestPlacement = true; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; textStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels; //textStyle.XOffsetInPixel = XOffsetInPixel; //textStyle.YOffsetInPixel = YOffsetInPixel; applyUntilZoomlevel_lbl = (ApplyUntilZoomLevel)Enum.Parse(typeof(ApplyUntilZoomLevel), sZoomlevelEnd_lbl); zoomLevelSet_lbl = sl.lyr_point_Splice_Closure_lbl.ZoomLevelSet; startZoomLevel_lbl = zoomLevelSet_lbl.GetZoomLevels()[iZoomLevelStart_lbl]; startZoomLevel_lbl.DefaultPointStyle = pointStyle; startZoomLevel_lbl.DefaultTextStyle = textStyle; startZoomLevel_lbl.ApplyUntilZoomLevel = applyUntilZoomlevel_lbl; sl.lyr_point_Splice_Closure_lbl.DrawingMarginPercentage = fDrawingMarginPercentage; Proj4Projection proj4_points_Splice_Closure_lbl = new Proj4Projection(); proj4_points_Splice_Closure_lbl.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_points_Splice_Closure_lbl.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); sl.lyr_point_Splice_Closure_lbl.FeatureSource.Projection = proj4_points_Splice_Closure_lbl; layerOverLay.Layers.Add("Lbl_Splice_Closure", sl.lyr_point_Splice_Closure_lbl); sl.lyr_point_Splice_Closure_lbl.IsVisible = Convert.ToInt32(dsAppConfig.Tables[1].DefaultView[0]["lbl_status"]) == 1 ? true : false; //Over write label visibility if, parent layer initflag is false if (Convert.ToBoolean(dsAppConfig.Tables[1].DefaultView[0]["initflag"]) == false) { sl.lyr_point_Splice_Closure_lbl.IsVisible = false; } } //------------ } } #endregion ## End of Splice_Closure Point ## } } #endregion #endregion //Create in Memory layer to draw rectangle on map & projection for that InMemoryFeatureLayer shapeLayer = new InMemoryFeatureLayer(); shapeLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimpleCircleStyle(GeoColor.FromArgb(180, 102, 255, 102), 10, GeoColor.StandardColors.DarkGreen, 1); shapeLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.Green, 4, true); shapeLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(180, 102, 255, 102), GeoColor.StandardColors.DarkGreen, 1); shapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; shapeLayer.DrawingQuality = DrawingQuality.HighQuality; Proj4Projection proj4_shapeLayer = new Proj4Projection(); proj4_shapeLayer.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_shapeLayer.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); shapeLayer.FeatureSource.Projection = proj4_shapeLayer; layerOverLay.Layers.Add("shapeLayer", shapeLayer); #region //For some reason.. to over come issue of projection at some point Proj4Projection proj4ForShapes = new Proj4Projection(); proj4ForShapes.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4ForShapes.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); proj4ForShapes.Open(); //Map1.EditOverlay.FeatureSource.Projection = proj4ForShapes; #endregion //Create in memory layer to search and zoom in based on Long, Lat (Geo code) #region Create in memory layer to search and zoom in based on Long, Lat & Map point web service InMemoryFeatureLayer InMemoryLayerGeoCode = new InMemoryFeatureLayer(); InMemoryLayerGeoCode.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimplePointStyle(PointSymbolType.Star, GeoColor.StandardColors.Red, 20); InMemoryLayerGeoCode.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Proj4Projection proj4_InMemoryLayerGeoCode = new Proj4Projection(); proj4_InMemoryLayerGeoCode.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4_InMemoryLayerGeoCode.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); InMemoryLayerGeoCode.FeatureSource.Projection = proj4_InMemoryLayerGeoCode; layerOverLay.Layers.Add("InMemoryLayerGeoCode", InMemoryLayerGeoCode); #endregion //Create VE layer and to Map1 VirtualEarthOverlay ve = new VirtualEarthOverlay("VirtualEarth Map"); ve.VirtualEarthMapType = VirtualEarthMapType.Birdseye; Map1.CustomOverlays.Clear(); Map1.CustomOverlays.Add(layerOverLay); Map1.CustomOverlays.Add(ve); LoadLegendData(); } else { } } catch (Exception ex) { bReturnLog = false; bReturnLog = ErrorLog.ErrorRoutine(false, "Page_Load", ex, vErrorLogFile); } }