Setting up the Project
- Open Visual Studio (2015 in this sample).
- Create an empty Class Library project.
- Add a reference to Cadcorp.Web.UI.dll, Cadcorp.Web.UI.Common found in the WebMap ‘bin’ folder.
- Add a reference to System.Web in the .NET Framework.
Defining an Extender Component
- Create a new class called MeasureExtenderComponent, implementing the interface Cadcorp.Web.UI.Interfaces.IWMLExtenderComponent.
- IWMLExtenderComponent defines the available properties for an Extender Component. If implementation does not required any of these properties, then return null or false (if Boolean).
- Some of the IWMLExtenderComponent properties are hard-coded and correspond to values defined in ‘WebMap/map.aspx’, this is subject to change in future versions of Cadcorp SIS WebMap.
- Using IWMLExtenderComponent, you can load any of the following:
- OpenLayers map controls,
- Dialogs (and Admin dialogs),
- Menu items (and Admin menu items),
- Tool strip buttons
- An IWMLExtenderComponent can be loaded into the Admin page or into the Map page by changing the return value of the IsAdminControl property.

IsAdminControl Codepublic class MeasureExtenderComponent : Cadcorp.Web.UI.Interfaces.IWMLExtenderComponent
{
public MeasureExtenderComponent()
{
}
public DialogBase ControlDialog
{
get
{
return null;
}
}
public MenuItem ControlMenuItem
{
get
{
return null;
}
}
public string DialogControllerID
{
get
{
return "dController";
}
}
public string FooterId
{
get
{
return "footer";
}
}
public bool IsAdminControl
{
get
{
return false;
}
}
public bool IsAuthenticated
{
get
{
return false;
}
}
public OLControlBase MapControl
{
get
{
return null;
}
}
public string MapId
{
get
{
return null;
}
}
public string MenuId
{
get
{
return null;
}
}
public ButtonBase ToolStripButton
{
get
{
return null;
}
}
public Dictionary<string, Type> WebScriptUrls
{
get
{
return null;
}
}
public string FriendlyName
{
get
{
return "Custom Measure Extender";
}
}
}

ControlDialog – Type: DialogBase
The ControlDialog property must return an object of a class derived from DialogBase, or null. DialogBase is one of the classes provided in the Cadcorp.Web.UI library; it is used to define the dialogs triggered by clicking menu items.
A single WebMap Dialog is visible at a time. Events triggered by opening and closing a dialog allow WebMap to automatically manage the mutual exclusivity of dialogs. Default behaviour can be overridden by the developer.
ControlMenuItem – Type: MenuItem
The ControlMenuItem property must return a MenuItem object, or null. The returned MenuItem will be added to either the Map Menu or Admin Menu.
A MenuItem and a DialogBase can be linked together as a pair using their string ID properties: MenuItem.DialogID and DialogBase.MenuId. WebMap will automatically open the Dialog when the MenuItem is clicked. This default behaviour can be overridden by the developer.
MapControl – Type: OLControlBase
The MapControl property must return an OLControlBase object, or null. The OLControlBase class creates an OpenLayers.Control object, which will be added to the OpenLayers.Map instance. It is recommended that client-side map interactions are performed via objects of this class, using the built-in setMap, activate and deactivate commands. See http://dev.openlayers.org/docs/files/OpenLayers/Control-js.html for more information.
Unlike DialogBase, MenuItem or ButtonBase,OLControlBase does not have any user interface elements by default. If these are required, the individual DOM elements must be deriving a new class from OLControlBase.
ToolStripButton – Type: ButtonBase
The ToolStripButton property must return a ButtonBase object, or null. A WebMap Button, deriving ButtonBase will appear in the upper right corner of Map.aspx. The DialogButton class is derived from ButtonBase and can be used to create managed WebMap dialogs.
Other uses of ButtonBase, such as the GeoLocate button, will require a derived control class.
DialogControllerID – type: string
The variable name of the JavaScript Dialog Controller object held on the "window.Cadcorp" object.
In Cadcorp SIS WebMap this is hard coded to "dController", as set in ‘WebMapLayers/map.aspx’
FooterId – type: string
The variable name of the footer DOM ID attribute. This is used behind the scenes to draw Web Map Layers UI controls.
In WebMap this is hard coded as "footercontainer" as set in ‘WebMap/map.aspx’
IsAdminControl – type: bool
Controls which page the Extender Component will be loaded into.
A return value of 'true' will cause the Extender Component to load on wmadm.aspx, while a value of 'false' will cause the Extender Component to load on Map.aspx. The two options are mutually exclusive. A second IWMLExtenderComponent must be created to load in both the admin page and the map page.
IsAuthenticated – type: bool
Controls whether the Extender Component should be available to everyone or only users with granted permissions.
MapId – type: string
The JavaScript variable on 'window.Cadcorp' that contains the Web Map Layers map object. In SIS WebMap 9 Admin this is hard coded as "theMap", as set in ‘WebMap/map.aspx’.
MenuId – type: string
The DOM element ID property corresponding to the drop down menus. WebMap uses the property to draw WebMap UI controls.
In Cadcorp SIS WebMap this is hard coded as "menu" as set in ‘WebMap/map.aspx’.
WebScriptUrls – type: Dictionary<string, Type>
A dictionary populated with fully qualified resource locations and their corresponding Dialog Type. This emulates the EmitJavascriptFrom method on ControlBase, for use with Embedded Maps. Custom resource files will not load for Embedded Maps without this property.
The string key value must be the fully qualified resource location and the Type value must be that of the dialog emitting the resource.
FriendlyName – type: string
The name displayed in the Admin page under “General Map Settings” and used to toggle the Add-in on or off.
![]() |
3. Adding a Menu Item and Dialog Control to Map.aspx |