userSettings Property

Description

The userSettings property provides values for user settings.

To set this property, use the ESDWeb object's set method as illustrated below, or pass it to the startup method as part of the configuration parameter.

The value of this property must be a JavaScript object containing a hash of configuration settings. These settings are supported:

laneWidth — This value will be applied to streets drawn using the Street tool on the toolbar and streets placed on the diagram using the street shapes in the Symbol Manager. The value should include the lane width and a unit designation. Examples: '10 ft', '3.5 m'.

shoulderWidth — This value will be applied when a shoulder is added to a street. The value should include the shoulder width and a unit designation. Examples: '4 ft', '1.5 m', '120 cm'.

curbReturnSetback_paved — When placing a new curb return connecting two paved streets, the curb return uses this value to determine the distance from the curbline intersection point and the point where the curb return transitions to the street border stripe. If the streets meet at a right angle, this value is the curb return's radius. Examples: '5 ft', '1.5 m', '120 cm'.

curbReturnSetback_gravel — When placing a new curb return connecting two gravel roads, the curb return uses this value to determine the distance from the road border intersection point and the point where the curb return transitions to the road's border stripe. Examples: '5 ft', '1.5 m', '120 cm'.

curbReturnSetback_dirt — This setting is used when placing a new curb return joining two dirt roads. The value describes the distance from the road border intersection point and the point where the curb returns transitions to the road's border stripe. Examples: '5 ft', '1.5 m', '120 cm'.

interiorStripeSetback — This value describes the distance from a street intersection area to the point where street interior stripes begin. Examples: '4 ft', '1.5 m', '120 cm'.

stripeDashLength — The length of the dash segments in stripes with dashed patterns. Examples: '8 ft', '3.0 m', '250 cm'.

stripeGapLength — The distance between dash segments of stripes with dashed patterns. Examples: '4 ft', '1.5 m', '120 cm'.

stripeWidth — The default line width for stripes. This value is applied when drawing new street shapes and when drawing free stripes. Examples: '6 in', '15 cm'.

strokeWidth — This is the default stroke or line width for new shapes. The value is applied when drawing basic geometric shapes such as lines, arcs and rectangles. Include a unit designation in the value. Examples: '4 in', '10 cm'.
Note: Changes to stroke width are only applied to diagrams loaded or created after the stroke width has been changed.

uom — This specifies the diagram editor's unit of measure. Use one of these values:

  • 'feetAndInches' - Traditional US feet and inches; e.g. 23' 7'
  • 'feetAndTenths' - Decimal feet; e.g. 23.5'
  • 'meters' - Decimal meters; e.g. 7.19m

dirOfTravel — This value will be applied to streets drawn using the Street tool on the toolbar and streets placed on the diagram using the street shapes in the Symbol Manager. It sets direction of travel defaults for right and left side driving.

  • 'normal' - Right side
  • 'notNormal' - Left side

showCurbReturnApex — This setting determines whether or not curbline apex markers are displayed in the editor. The apex marker is placed at the location where curb lines would intersect if a curb return was not installed and the curblines of intersecting streets continued to the point where they intersect.

dimInactiveLayer — This setting determines whether or not symbols on an inactive layer will be dimmed/greyed out when navigating to a new layer. Accepts a boolean value where the default 'true' enables the dimming feature.

outlineOnly — This setting determines whether or not symbols dropped from the symbols layer will appear as outline only/white fill. Accepts a boolean value where the default 'false' suppresses this feature.

excludedSymbolCollections — This setting defines the symbol collections to be excluded. When a symbol collection is excluded its associated symbols and folders will not be shown in the symbol manager. The value of this setting will be an array of strings containing the names of the symbol collections you want to exclude. Please refer to the example below.

includeAttachments — This setting determines whether or not attachment symbols will be included by default in stored SVG, printed, and image output. Accepts a boolean value where the default is false. See the store method.

includeFieldMeasurements — This setting determines whether or not measurement layer shapes will be included by default in stored SVG, printed, and image output. Accepts a boolean value where the default is false. See the store method.

includeStructureDimensions — This setting determines whether or not wall length dimension lines will be included by default in stored SVG, printed, and image output. Accepts a boolean value where the default is false. See the store method.

exportOptions — This setting controls how images are exported. Accepts a javascript object with the following properties:

  • width — The image width in pixels or expressed as a linear measurement like '7.5"' or '20cm'. When width is expressed as a linear measurement it will be converted to pixels based on the output resolution. For example if width is '7.5"' and output resolution is 300px/inch, the resulting width will be 2250px.
  • height — The image height in pixels or expressed as a linear measurement like '10"' or '5cm'. When height is expressed as a linear measurement it will be converted to pixels based on the output resolution. For example if height is '10"' and output resolution is 300px/inch, the resulting height will be 3000px.
  • margin — The image margin width in pixels or expressed as a linear measurement like '0.25"' or '0.5cm'. When margin is expressed as a linear measurement it will be converted to pixels based on the output resolution. For example if margin is '0.5"' and output resolution is 300px/inch, the resulting margin will be 75px.
  • format — The image format. 'image/jpeg' (JPEG) and 'image/png' (PNG) are supported. The default is 'image/png'.
  • imageQuality — For JPEG only. A number between 0 and 1. 1 being the highest quality and 0 the least. The default 0.75.
  • resolutionPixels — The number of pixels per output resolution unit. This value and the value of resolutionUnit define the output resolution. Output resolution is always resolutionPixels / 1 resolutionUnit. For example, if resolutionUnit is 'inch' and resolutionPixels is 300, the output resolution will be 300px/inch. The default is 72px.

    Note: Output resolution is important for two reasons. First, it used to convert output sizes (width, height, margin) expressed as linear measurements to pixels. Second, some diagram features are sized based on output resolution. Items on the measurement layer and structure dimension lines are examples of this behavior. The sizes of these items are defined in points (1/72") and the output resolution is used to calculate their output size in pixels.

  • resolutionUnit — A standard linear unit of measure like 'inch' or 'cm' that is combined with resolutionPixels to define output resolution. The default is 'inch'.

Example

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

// Configure editor settings:
editor.set('userSettings',
	{
      laneWidth: '10 ft',
	  shoulderWidth: '4 ft',
	  strokeWidth: '4 in',
	  dirOfTravel: 'normal',
	  uom: 'feetAndInches'
	  dimInactiveLayer: true,
	  outlineOnly: false,
      excludedSymbolCollections: [
	     'VehicleAdvanced',
	     'RoadwayAdvanced'
      ],
	  exportOptions: {
	     width: 1000,
		 height: 1000,
		 margin: 20,
		 format: "image/jpeg",
		 imageQuality: 1,
		 resolutionPixels: 72,
		 resolutionUnit: 'inch'
	  }
    }
);