Class descriptorMDNRestMap

Creates an instance of a descriptor for describing content from a MapDotNet UX REST map service.

class

descriptorMDNRestMap

Index

Constructor methods

Methods

Constructor methods

constructor(mapId: string, options?: { version?: string; imageType?: string; bleedRatio?: number; mapCacheOption?: string; mapCacheName?: string; useQuadKeyForMapCacheName?: boolean; backgroundColorStr?: string; layerVisibility?: {}; layerOutline?: {}; layerFill?: {}; layerWhere?: {}; tag?: string; }): descriptorMDNRestMap

Parameters

  • mapId: string
  • options?: { version?: string; imageType?: string; bleedRatio?: number; mapCacheOption?: string; mapCacheName?: string; useQuadKeyForMapCacheName?: boolean; backgroundColorStr?: string; layerVisibility?: {}; layerOutline?: {}; layerFill?: {}; layerWhere?: {}; tag?: string; } optional

Returns

descriptorMDNRestMap

Methods

public getBackgroundColorStr(): string

Gets map image background color.

Returns

string

CSS style string for the map image background color.

public getBleedRatio(): number

Gets bleed ratio for the layer associated with this descriptor.

Returns

number

The bleed ratio.

public getImageType(): string

Gets image type associated with this descriptor, either 'png', 'png8', or 'jpg'.

Returns

string

The image type associated with this descriptor.

public getIsBackgroundTransparent(): boolean

Checks whether or not the map background is transparent.

Returns

boolean

Whether or not the map background is transparent.

public getLayerFill(layerId: string): string

Gets a layer's fill color as a CSS style string or as a SQL expression.

Parameters

  • layerId: string

    The MapDotNet map layer ID.

Returns

string

Either the CSS style string or the SQL expression, according to how the layer's fill color was set.

public getLayerOutline(layerId: string): { color: string; thickness: number; }

Gets a layer's outline color and thickness.

Parameters

  • layerId: string

    The MapDotNet map layer ID.

Returns

{ color: string; thickness: number; }

JavaScript object of the form {color, thickness} where color is the CSS style string of the outline color and thickness is the outline thickness in pixels.

public getLayerVisibility(layerId: string): boolean

Gets a layer's visibility.

Parameters

  • layerId: string

    The MapDotNet map layer ID.

Returns

boolean

Whether or not the layer is visible.

public getLayerWhere(layerId: string): string

Gets the current layer where clause.

Parameters

  • layerId: string

    The MapDotNet map layer ID.

Returns

string

The current where clause. If no where clause is in use, this will return an empty string.

public getLayerWhereSep(): string

Returns the current separator for the layer where clause in the query string.

Returns

string

The current seperator.

public getMapCacheName(): string

Gets the optional map cache name.

Returns

string

The map cache name.

public getMapCacheOption(): string

Gets the map's cache setting, which is one of 'None', 'ReadOnly', 'ReadWrite', 'ForceWrite', and 'Default.'

Returns

string

The map's cache setting.

public getMapId(): string

Gets the map ID.

Returns

string

The map ID.

public getTag(): string

Gets a tag which is used to modify the request URIs to avoid browser caching

Returns

string

The map's tag.

public getUseQuadKeyForMapCacheName(): boolean

Determines whether the map is flagged to use the quadkey as its map cache name.

Returns

boolean

Whether or not the map has been flagged to use the quadkey as its map cache name.

public getVersion(): string

Gets the REST service version.

Returns

string

The REST service version.

public setBackgroundColor(a: number, r: number, g: number, b: number)

Sets the map image background color.

Parameters

  • a: number

    Alpha level.

  • r: number

    Red level.

  • g: number

    Green level.

  • b: number

    Blue level.

public setBleedRatio(br: number)

Sets the bleed ratio. Bleeds greater than 1.0 will fetch content beyond the edge of the tile extents (this is useful for point features).

Parameters

  • br: number

    The desired bleed ratio, between 1.0 and 2.0.

public setImageType(t: string)

Gets image type associated with this descriptor to one of 'png', 'png8', or 'jpg'.

Parameters

  • t: string

    The image type associated which should be associated with this descriptor.

public setLayerFill(layerId: string, a: number, r: number, g: number, b: number)

Sets a layer's fill color.

Parameters

  • layerId: string

    The MapDotNet map layer ID.

  • a: number

    Alpha level.

  • r: number

    Red level.

  • g: number

    Green level.

  • b: number

    Blue level.

public setLayerFillAsExpression(layerId: string, exp: string)

Sets a layer's fill color as a SQL expression.

Parameters

  • layerId: string

    The MapDotNet map layer ID.

  • exp: string

    The SQL expression to select a row's fill color.

public setLayerOutline(layerId: string, a: number, r: number, g: number, b: number, thk: number)

Sets a layer's outline color and thickness.

Parameters

  • layerId: string

    The MapDotNet map layer ID.

  • a: number

    Alpha level.

  • r: number

    Red level.

  • g: number

    Green level.

  • b: number

    Blue level.

  • thk: number

    Outline thickness in pixels.

public setLayerVisibility(layerId: string, isVisible: boolean)

Sets a layer's visibility.

Parameters

  • layerId: string

    The MapDotNet map layer ID.

  • isVisible: boolean

    Whether or not the layer should be visible.

public setLayerWhere(layerId: string, where: string, merge: boolean)

Add or replace the where clause for a layer. The where clause is a SQL expression used to filter rows.

Parameters

  • layerId: string

    The MapDotNet map layer ID.

  • where: string

    The desired SQL where expression.

  • merge: boolean

public setLayerWhereSep(sep: string)

Sets a separator character for the layer where clause expression in the query string. This is set to ',' by default, which is consistent with SQL.

Parameters

  • sep: string

    The desired seperator, which should be a single character.

public setMapCacheName(mcn: string)

Sets the optional map cache name.

Parameters

  • mcn: string

    The desired map cache name.

public setMapCacheOption(mco: string)

Gets the map's cache setting to one of 'None', 'ReadOnly', 'ReadWrite', 'ForceWrite', and 'Default.'

Parameters

  • mco: string

    The desired cache setting for the map.

public setSuspendDescriptorChangeNotifications(flag: boolean)

Sets the flag to suspend descriptor change notifications. If set true, all changes to this descriptor will not cause the map to redraw. Setting to false will enable redraws and immediately force a redraw.

Parameters

  • flag: boolean

    Whether or not descriptor change notifications should be enabled.

public setTag(tag: string)

Sets the map's tag, which is used modify request URIs to avoid browser caching.

Parameters

  • tag: string

    The desired tag.

public setUseQuadKeyForMapCacheName(flag: boolean)

Sets the flag that uses the quadkey as its map cache name.

Parameters

  • flag: boolean

    Whether or not the map should be flagged to use the quadkey as its map cache name.

public setVersion(v: string)

Sets the REST service version.

Parameters

  • v: string

    The version number.