Code Examples
- Example 1
Opens and display a shapefile in a Windows application using the EGIS.Controls.SFMap .NET Shapefile map control.
- Example 2
Opens a shapefile and displays a description of the shapefile attributes using the EGIS.ShapeFileLib class library.
- Example 3
Opens a shapefile and creates a new shapefile using the EGIS.ShapeFileLib ShapeFile and ShapeFileWriter classes.
- Example 4
Converts a shapefile to a Google Earth KML file using the EGIS.ShapeFileLib class library.
- Example 5
Displays a GPS position marker on a map using the EGIS.Controls.SFMap map control.
- Example 6
This example extends Example 5 and shows a map displayed in a Windows Form, overlayed with tiles from Open Street Map
- Example 8
This example shows how to use an ICustomRenderSettings class to render roads in a shapefile in different colors
depending on the type of road.
The example also show how to use an ICustomRenderSettings class to render a POI point shapefile with different
icons depending on the POI category.
- Web Example 1
Shows how to load an Easy GIS .NET Project in a Web Page using the EGIS.Web.Controls.SFMap Shapefile map control.
- Web Example 2
Using Custom Render Settings in the EGIS.Web.Controls.SFMap Web Control.
Click here to view or download the API reference.
Using Easy GIS .NET in your own Desktop Applications
While Easy GIS .NET Desktop Edition is a powerful GIS application on its own,
its true power lies in the componentized design and ease by which developers can add the Easy GIS .NET controls
to their own Windows desktop applications.
This page offers links to various examples of how you can use Easy GIS .NET Desktop Edition in your own .NET
Windows applications, as well as instructions on how to add a reference to the Easy GIS .NET ShapeFile control to your
Visual Studio projects.
Easy GIS .NET is written in C# using version 2.0 of the .NET Framework. In order to use the libraries in your own projects you will need to have
version 2.0 or later of the .NET framework installed. All of the examples available to download include Visual Studio 2005 and
Visual C# 2005 Express Edition solutions. The examples will also run in later versions of Visual Studio.
To download the examples click on the links to the left.
Including a reference to the Easy GIS .NET class libraries in your own projects
To add a reference to the Easy GIS .NET class libraries in your own projects perform the following steps.
- Start Visual Studio and create a new Windows Application project.
- Copy EGIS.ShapeFileLib.dll and EGIS.Controls.dll to your project directory.
- Right-click on the project's References folder and click on "Add Reference..". See Figure 1.

Figure 1
- Click the Browse tab and select EGIS.Controls.dll and EGIS.ShapeFileLib.dll. See Figure 2.

Figure 2
Adding the Easy GIS .NET ShapeFile Control to the Visual Studio Design Toolbox
To add the Easy GIS .NET Controls to the Design Toolbox perform the following steps.
- Right-click on the designer Toolbox and select "Choose Items.." as shown in Figure 3.

Figure 3
- When the Choose Toolbox Items dialog opens click on Browse and navigate to the location of the EGIS.Controls.dll class library
you added to your project.
- Select the SFMap and ShapeFileListControl controls as shown in Figure 4 and click OK.

Figure 4
- You should now be able to drag the Easy GIS .NET controls from the Toolbox onto your Windows Forms.
See Example 1 for example code on using the SFMap control to display a shapefile in a Windows Application.