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.
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
USDemographicMap
.gitignore Initial commit Mar 20, 2017
README.md
ScreenShot.png Update ScreenShot. Mar 20, 2017
USDemographicMap.sln Add us demographic map sample. Mar 20, 2017

README.md

US Demographic Map Sample for Wpf

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

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);

        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 Wpf Wiki Resources

Map Suite Desktop for Wpf 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.