skip to the main content area of this page
Developer Resources - Web Example 1

Easy GIS .NET Desktop Edition Code Examples

Easy GIS .NET Web Edition Code Examples

Click here to view or download the API reference.

Click here to download sample Shapefiles.

Loading an Easy GIS .NET Project in a Web Page

This example shows how to load an Easy GIS .NET Project in a Web Page using the EGIS.Web.Controls SFMap Control.

Download Code [1417KB]

Instructions to Build and Run Example

  • This example requires ASP .NET 2.0 or greater. You will need Visual Studio 2005 or Visual Studio Web Developer Express Edition installed to open the included solution file.
  • No software is required on a clients web-browser. The project is run using java-script and an IHTTPHandler (included in the SFMap Control) on the server-side to generate map images.
  • To build and run the project, extract the downloaded files and open the WebExample1 solution file. Build and run the project. You should see a page as shown in Figure 1
screenshot of web example 1
Figure 1

Explanation of Example

The example uses the EGIS.Web.Controls.SFMap and EGIS.Web.Controls.MapPanControls Web Controls.

The example world.egp Easy GIS .NET project consists of a single polygon shapefile, which was saved and exported using the Easy GIS .NET Dektop Edition.

If you would like to load another project you have created in the Desktop Edition of Easy GIS .NET you can use this project as a starting template. Just export the project from Easy GIS .NET Desktop Edition, save it to a suitable location in your webpage, and then set the relative location of the project in the SFMap ProjectName property. Rebuild the web project and you should see your Easy GIS .NET project loaded in a web page!

Download Code [1417KB]

Special Instructions for .NET 4.0

If you are using .NET 4.0 and IIS7 you may need to replace the <HttpHandler> section with an entry in the new <system.webServer> section

Replace the following section..
    <add path="egismaptiled.axd" verb="*" type="EGIS.Web.Controls.TiledSFMapImageProvider, EGIS.Web.Controls, Culture=neutral, PublicKeyToken=05b98c869b5ffe6a" validate="true"/>
    <add path="egismap.axd" verb="*" type="EGIS.Web.Controls.SFMapImageProvider, EGIS.Web.Controls, Culture=neutral, PublicKeyToken=05b98c869b5ffe6a" validate="true"/>

..with the new section
        <add name="TiledSFMapImageProvider" path="egismaptiled.axd" verb="*" type="EGIS.Web.Controls.TiledSFMapImageProvider, EGIS.Web.Controls" resourceType="Unspecified"/>
        <add name="SFMapImageProvider" path="egismap.axd" verb="*" type="EGIS.Web.Controls.SFMapImageProvider, EGIS.Web.Controls" resourceType="Unspecified"/>