Class envelope

An immutable envelope

class

envelope

Index

Constructor methods

Methods

Functions

Constructor methods

constructor(minX: number, minY: number, maxX: number, maxY: number): envelope

Parameters

  • minX: number
  • minY: number
  • maxX: number
  • maxY: number

Returns

envelope

Methods

public clone(): envelope

Creates a new envelope from this as deep copy.

Returns

envelope

The new cloned envelope.

public contains(pt: point): boolean

Tests whether the given point is contained within this envelope.

Parameters

  • pt: point

    Point to test.

Returns

boolean

Result of containment test.

public createFromBleed(bleed: number): envelope

Create a new envelope from this one plus a bleed ratio.

Parameters

  • bleed: number

    The bleed ratio.

Returns

envelope

A new envelope.

public createFromMargins(marginX: number, marginY: number): envelope

Creates a new envelope from this one plus x and y margins.

Parameters

  • marginX: number

    The x margin.

  • marginY: number

    The y margin.

Returns

envelope

A new envelope.

public equals(env: envelope): boolean

Equality comparer between this and another envelope.

Parameters

Returns

boolean

Result of equality comparison.

public getArea(): number

Gets area of the envelope.

Returns

number

Area of the envelope.

public getAspect(): number

Gets the aspect of the envelope.

Returns

number

Width-to-height ratio.

public getCenter(): point

Gets the center point of the envelope.

Returns

point

Center as a point.

public getHeight(): number

Gets height of the envelope.

Returns

number

Height of the envelope.

public getLL(): point

Gets lower left of this envelope.

Returns

point

A new point.

public getLR(): point

Gets lower right of this envelope.

Returns

point

A new point.

public getMaxX(): number

Gets the maximum x coordinate of the envelope

Returns

number

The maximum x coordinate.

public getMaxY(): number

Gets the maximum y coordinate of the envelope

Returns

number

The maximum y coordinate.

public getMinX(): number

Gets the minimum x coordinate of the envelope.

Returns

number

The minimum x coordinate.

public getMinY(): number

Gets the minimum y coordinate of the envelope

Returns

number

The minimum y coordinate.

public getUL(): point

Gets upper left coordinate of this envelope.

Returns

point

A new point.

public getUR(): point

Gets upper right of this envelope.

Returns

point

A new point.

public getWidth(): number

Gets the width of the envelope.

Returns

number

Width of the envelope.

public toGeometry(): geometry

Create a closed geometry from this envelope.

Returns

geometry

A new closed path geometry.

public toObject(): envObject

Returns the minimum and maximum coordinates of this envelope as an envObject.

Returns

envObject

Representaton of this envelope as an envObject.

public toString(): string

Method for casting this envelope as a string.

Returns

string

String of the form 'minX,minY,maxX,maxY'.

Functions

createFromCenterAndMargins(centerPtX: number, centerPtY: number, marginX: number, marginY: number): envelope

Creates a new envelope from the x and y coordinates of the center point and x and y margins from the center point.

Parameters

  • centerPtX: number

    The center x coordinate.

  • centerPtY: number

    The center y coordinate.

  • marginX: number

    The margin from center x coordinate.

  • marginY: number

    The margin from center y coordinate.

Returns

envelope

A new envelope

createFromMdnXml(xml: string): envelope

Creates a new envelope from MapDotNet XML.

Parameters

  • xml: string

    A MapDotNet XML string of the envelope.

Returns

envelope

A new envelope

createFromPoints(pt1: point, pt2: point): envelope

Creates new envelope from two corner points.

Parameters

  • pt1: point

    Corner point

  • pt2: point

    Opposite corner point

Returns

envelope

A new envelope

intersects(env1: envelope, env2: envelope): boolean

Tests whether two given envelopes intersect.

Parameters

  • env1: envelope

    First envelope to test.

  • env2: envelope

    Second envelope to test.

Returns

boolean

Result of the intersection test.

union(env1: envelope, env2: envelope): envelope

Creates a new envelope from the union of two given envelopes.

Parameters

  • env1: envelope

    The first enevelope to unite.

  • env2: envelope

    The second envelope to unite.

Returns

envelope

A new envelope.