Class Pixel

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(x: number, y: number): Pixel

Constructor: OpenLayers.Pixel Create a new OpenLayers.Pixel instance

Parameters: x - {Number} The x coordinate y - {Number} The y coordinate

Returns: An instance of OpenLayers.Pixel

Parameters

  • x: number
  • y: number

Returns

Pixel

Properties

public CLASS_NAME: string

public x: number

APIProperty: x {Number} The x coordinate

public y: number

APIProperty: y {Number} The y coordinate

Methods

public add(x: number, y: number): Pixel

APIMethod: add

Parameters: x - {Integer} y - {Integer}

Returns: {} A new Pixel with this pixel's x&y augmented by the values passed in.

Parameters

  • x: number
  • y: number

Returns

Pixel

public clone(): Pixel

APIMethod: clone Return a clone of this pixel object

Returns: {} A clone pixel

Returns

Pixel

public distanceTo(px: Pixel): number

APIMethod: distanceTo Returns the distance to the pixel point passed in as a parameter.

Parameters: px - {}

Returns: {Float} The pixel point passed in as parameter to calculate the distance to.

Parameters

Returns

number

public equals(px: Pixel): boolean

APIMethod: equals Determine whether one pixel is equivalent to another

Parameters: px - {|Object} An OpenLayers.Pixel or an object with a 'x' and 'y' properties.

Returns: {Boolean} The point passed in as parameter is equal to this. Note that if px passed in is null, returns false.

Parameters

Returns

boolean

public equals(px: { x: number; y: number; }): boolean

Parameters

  • px: { x: number; y: number; }

Returns

boolean

public offset(px: Pixel): Pixel

APIMethod: offset

Parameters px - {|Object} An OpenLayers.Pixel or an object with a 'x' and 'y' properties.

Returns: {} A new Pixel with this pixel's x&y augmented by the x&y values of the pixel passed in.

Parameters

Returns

Pixel

public offset(px: { x: number; y: number; }): Pixel

Parameters

  • px: { x: number; y: number; }

Returns

Pixel