Пример #1
0
        private void AddSampleDataToLinesTable(LinesLayer layer, SpatialDataTable dt)
        {
            int nplines = 15 / Layers.CountAll((l) => l.Visible && l is LinesLayer);
            var rnd     = new Random(Layers.IndexOf(layer)); // this ensures same data for same layer but different points for different layers

            for (int i = 0; i < nplines; ++i)
            {
                LinesDataRow row       = (LinesDataRow)dt.NewRow();
                var          lineStyle = layer.LineStyle;
                row.Latitude0  = rnd.Next(SampleLatMin, SampleLatMax);
                row.Longitude0 = rnd.Next(SampleLonMin, SampleLonMax);
                row.Latitude1  = rnd.Next(SampleLatMin, SampleLatMax);
                row.Longitude1 = rnd.Next(SampleLonMin, SampleLonMax);
                row.LineStroke = lineStyle.StrokeColor;
                row.DashStyle  = lineStyle.DashStyle;
                dt.Add(row);
            }
        }
Пример #2
0
        private void AddSampleDataToPointsTable(PointsLayer layer, SpatialDataTable dt)
        {
            int npoints = 15 / Layers.CountAll((l) => l.Visible && l is PointsLayer);
            var rnd     = new Random(Layers.IndexOf(layer)); // this ensures same data for same layer but different points for different layers

            for (int i = 0; i < npoints; ++i)
            {
                PointsDataRow row         = (PointsDataRow)dt.NewRow();
                var           markerStyle = layer.MarkerStyle;
                row.Latitude     = rnd.Next(SampleLatMin, SampleLatMax);
                row.Longitude    = rnd.Next(SampleLonMin, SampleLonMax);
                row.Caption      = string.Format(CultureInfo.InvariantCulture, "{0} {1}", layer.Caption, i);
                row.MarkerSize   = MarkerStyle.c_SizeValue;
                row.MarkerStroke = markerStyle.StrokeColor;
                row.MarkerFill   = markerStyle.FillColor;
                row.MarkerShape  = markerStyle.Shape;
                row.Font         = markerStyle.Font;
                row.TextColor    = markerStyle.TextColor;
                dt.Add(row);
            }
        }