startup Method

Description

Starts and shows the ESD/SPD Web editor. The startup method requires a single parameter: an object containing the properties to be set.

Syntax

.startup(/* Object */ configuration)

Parameters

configuration: Object

An object containing the following properties:

serviceUrl: String (required)

The URL of the ESD/SPD Web service. It will probably look something like this:

https://servername:3000/REST

See Web Service Installation.

userId: String (required)

The ID of the current user.

licenseId: String (required)

The license ID provided by PAE.

features: Array (optional)

The set of features supported by the web server license as an array of strings. The following are the list of available features:

  • STRUCTURES - Enables structures drawing and manipulation
  • GIS - Enables mapping

Note: Street features do not have to be asked for as all of our various products include it. Also, keep in mind that you can only request features that your license actually supports.

templateServiceUrl: String (optional)

The URL of the template Web service. If provided you will have to setup your own REST end points as described in the Template Service documentation. If omitted the application will serve the default templates from the installed web service.

requestTimeout: String (optional)

The timeout for web service requests in milliseconds.

showToolbar: Boolean (optional)

Indicates whether or not to display the toolbar.

readOnlyMode: Boolean (optional)

Indicates whether or not to display the components that allow editing like the symbol manager and the template manager.

maxLogExceptions: Number (optional)

The maximum number of exceptions retained in the exception log.

beginZIndex: Number (optional)

The lowest z-index that will be used by the visual components of the web editor.

maxImportedImageSize: Number (optional)

The maximum total number of pixels allowed in an imported image before it is resampled.

scaledJPEGImageQuality: Number (optional)

The quality setting used when scaling imported JPEG images.

userSettings: Object (optional)

Specifies values for user settings.

viewAreasEnabled: Boolean (optional)

Indicates whether or not the view area functionality is enabled.

copyDrawingEnabled: Boolean (optional)

Indicates whether or not the Copy to Clipboard functionality is enabled. When this option is true your application must implement clipboard management. See Clipboard Events.

pointerDevice: String (optional)

This property defines the pointer mode the application will run in. Refer to the documentation for pointerDevice property for a list of valid values.

Remarks

This method starts and shows the ESD/SPD Web editor. The editor is inserted into the DOM node specified in the constructor of the ESDWeb object. This node must be in the DOM and visible before startup is called. Most editor methods are supported only after startup has been called. However, the defineTemplateAction method must be called before startup.

Example 1

editor = new ESDWeb(null, 'editorNode');

editor.startup({
			serviceUrl: 'http://www.yourdomain.com/esd',
			licenseId: '===License ID===',
			features: ['GIS', 'STRUCTURES'],
			userId: 'sample-user-id',
			requestTimeout: 10 * 1000, // Set the request timeout (10 seconds)
			showToolbar: true,         // Enable the toolbar and symbol manager.
			readOnlyMode: true,
			maxLogExceptions: 20,      // Set the maximum number of retained log exceptions
			beginZIndex: 50            // Set the z-index
		});
		


If your application hosts the editor in a modal window, the call to startup must occur after the modal window is created and shown. When using the popular Twitter bootstrap library your code might look something like Example 2. Refer to your library/toolkit's documentation for more information.

Example 2

$('#myModal').on('shown.bs.modal', function (e) {
    editor.startup(configuration)
})