User Manual

Setting Up

Register a License

To activate Mapzania, you will need a license. Click here to get one.

The next step is to register your license. This can be done in three ways as described below.

1. Register license in source-code

See Initialize Mapzania section below.

2. Register license as appSettings in web.config file

<configuration>
  <appSettings>
    ...
    <add key="Mapzania_LicenseKey" value="[your license key]"/>
  </appSettings>
    ...
</configuration>

3. Register license in Mapzania.license file

  1. Create a text file and paste your license key into the file.
  2. Rename the text file to Mapzania.license.
  3. Place the file in the root of your project (same folder as web.config).

NOTE: If all options are configured, precedence is option 3 then 2 then 1.

Initialize Mapzania

To initialize Mapzania, add the code highlighted below to the Application_Start method in your global.asax file:


void Application_Start(object sender, EventArgs e)
{
	...
	// ** Start Mapzania (default) **
	Mapzania.Services.Start(this);

    //// ** Start Mapzania (with options including license) **
    //Mapzania.Services.Start(this, new Mapzania.Config {
    //    LicenseKey = "[your license key]"
    //});
    
    AreaRegistration.RegisterAllAreas();
    GlobalConfiguration.Configure(WebApiConfig.Register);
    RouteConfig.RegisterRoutes(RouteTable.Routes);
    BundleConfig.RegisterBundles(BundleTable.Bundles);
    ...
}

See Mapzania.Services.Start for reference documentation.

Initialize Endpoints

Method 1 - .NET MVC Projects without WebApi

To initialize the Mapzania endpoints, add the highlighted code to the Application_Start method in your global.asax file:


protected void Application_Start()
{
    // Start Mapzania
	Mapzania.Services.Start(this);

	AreaRegistration.RegisterAllAreas();
	FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
	
	//Register Mapzania Routes (endpoints)
	Mapzania.Services.RegisterRoutes(GlobalConfiguration.Configuration);
	
	RouteConfig.RegisterRoutes(RouteTable.Routes);
	BundleConfig.RegisterBundles(BundleTable.Bundles);
}

Method 2 - .NET MVC Projects with WebApi

To initialise the Mapzania endpoints, add the highlighted code to the Register method in your WebApiConfig.cs file (located in the App_Start folder):


public static void Register(HttpConfiguration config)
{
	config.MapHttpAttributeRoutes();

    //Register Mapzania Routes (endpoints)
    Mapzania.Services.RegisterRoutes(config);
    
    config.Routes.MapHttpRoute(
        name: "DefaultApi",
        routeTemplate: "api/{controller}/{id}",
        defaults: new { id = RouteParameter.Optional }
    );
}

‚Äč
NOTE: It is vital that you place this line after config.MapHttpAttributeRoutes() and before you define your default route with config.Routes.MapHttpRoute, otherwise the Mapzania endpoints may not initialize correctly.

  • Build your application.

  • To test that the endpoints have been added successfully, try this url on your site: http://your-site/mz/maps. If the endpoint is working successfully, you should see JSON data.

See Mapzania.Services.RegisterRoutes for reference documentation.

Also, see the REST Documentation for more details on the endpoints that are now available in your project.