Skip to content

The Demographic and Lifestyle sample template gives you a head start on your statistics project, which includes details about race, age, gender, land usage, and more for all the states in U.S. The template contains pre-styled layers that can be used as-is, or as the foundation for adding your own map notes and layers.

hnjm/USDemographicMapSample-ForWinForms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

US Demographic Map Sample for WinForms

Description

The Demographic and Lifestyle sample template gives you a head start on your statistics project, which includes details about race, age, gender, land usage, and more for all the states in U.S. The template contains pre-styled layers that can be used as-is, or as the foundation for adding your own map notes and layers.

Please refer to Wiki for the details.

Screenshot

Requirements

This sample makes use of the following NuGet Packages

MapSuite 10.0.0

About the Code

internal class CustomDotDensityStyle : DotDensityStyle
{
    protected override void DrawSampleCore(GeoCanvas canvas, DrawingRectangleF drawingExtent)
    {
        base.DrawSampleCore(canvas, drawingExtent);
        PointShape upperLeftPoint = ExtentHelper.ToWorldCoordinate(canvas.CurrentWorldExtent, drawingExtent.CenterX - drawingExtent.Width / 2, drawingExtent.CenterY - drawingExtent.Height / 2, canvas.Width, canvas.Height);
        PointShape lowerRightPoint = ExtentHelper.ToWorldCoordinate(canvas.CurrentWorldExtent, drawingExtent.CenterX + drawingExtent.Width / 2, drawingExtent.CenterY + drawingExtent.Height / 2, canvas.Width, canvas.Height);
        RectangleShape rectangle = new RectangleShape(upperLeftPoint, lowerRightPoint);
        rectangle.ScaleDown(10);

        // Here draw the points on Legend Image
        Random random = new Random(DateTime.Now.Millisecond);
        Collection<BaseShape> drawingPoints = new Collection<BaseShape>();
        for (int i = 0; i < DrawingPointsNumber; i++)
        {
            double x = rectangle.LowerLeftPoint.X + random.NextDouble() * (rectangle.Width);
            double y = rectangle.LowerLeftPoint.Y + random.NextDouble() * (rectangle.Height);
            drawingPoints.Add(new PointShape(x, y));
        }
        TextStyle textStyle = new TextStyle(DrawingPointsNumber.ToString(), new GeoFont("Arial", 20, DrawingFontStyles.Bold), new GeoSolidBrush(GeoColor.FromArgb(180, GeoColor.FromHtml("#d3d3d3"))));
        textStyle.DrawSample(canvas, drawingExtent);
        CustomPointStyle.Draw(drawingPoints, canvas, new Collection<SimpleCandidate>(), new Collection<SimpleCandidate>());
    }
}

Getting Help

Map Suite Desktop for Winforms Wiki Resources

Map Suite Desktop for Winforms Product Description

ThinkGeo Community Site

ThinkGeo Web Site

Key APIs

This example makes use of the following APIs:

About Map Suite

Map Suite is a set of powerful development components and services for the .Net Framework.

About ThinkGeo

ThinkGeo is a GIS (Geographic Information Systems) company founded in 2004 and located in Frisco, TX. Our clients are in more than 40 industries including agriculture, energy, transportation, government, engineering, software development, and defense.

About

The Demographic and Lifestyle sample template gives you a head start on your statistics project, which includes details about race, age, gender, land usage, and more for all the states in U.S. The template contains pre-styled layers that can be used as-is, or as the foundation for adding your own map notes and layers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages