Document Maps JavaScript API Reference Manual Basic Class Size

Size

AMap.Size

Pixel dimensions of the feature object, construct a size object

new AMap.Size(width: number, height: number);

Parameter

Attribute

Type

Description

width

number

Width

height

number

Height

Demo

var size = new AMap.Size(25, 34);

Method

getWidth()

Get pixel x-coordinate

return value:(NumberPixel x-coordinate

Demo:

size.getWidth();

getHeight()

Get the pixel Y-coordinate

return value:(NumberPixel Y-coordinate

Demo:

size.getHeight();

toString()

Return the size object as a string

return value:(StringSize in string format

Demo:

size.toString();