private void OpenRoadShapefile(string path) { // open the shapefile passing in the path, display name of the shapefile and // the field name to be used when rendering the shapes (we use an empty string // as the field name (3rd parameter) can not be null) EGIS.ShapeFileLib.ShapeFile sf = this.sfMap1.AddShapeFile(path, "ShapeFile", ""); // Setup a dictionary collection of road types and colors // We will use this when creating a RoadTypeCustomRenderSettings class to setup which //colors should be used to render each type of road sf.RenderSettings.FieldName = "name"; sf.RenderSettings.Font = new Font(this.Font.FontFamily, 12); Dictionary <string, Color> colors = new Dictionary <string, Color>(); colors.Add("service", Color.Green); colors.Add("secondary", Color.Green); colors.Add("residential", Color.Blue); colors.Add("primary", Color.Yellow); SaudiRenderSettings rs = new SaudiRenderSettings(sf.RenderSettings, "TYPE", colors); sf.RenderSettings.CustomRenderSettings = rs; sf.RenderSettings.UseToolTip = true; sf.RenderSettings.ToolTipFieldName = "name"; sf.RenderSettings.MaxPixelPenWidth = 20; }
void OpenMetersfile(string path) { this.sfMap1.AddShapeFile(path, "meters", ""); EGIS.ShapeFileLib.ShapeFile sf = this.sfMap1[1]; rs = new SaudiRenderSettings(sf.RenderSettings, "Serial Num", sf); sf.RenderSettings.CustomRenderSettings = rs; sf.RenderSettings.UseToolTip = false; sf.RenderSettings.ToolTipFieldName = sf.RenderSettings.FieldName; sf.RenderSettings.IsSelectable = false; sf.SelectRecord(0, true); }