开发 Maps JavaScript API Reference Manual Basic Class Size

Size 最后更新时间: 2026年07月02日

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:(Number) Pixel x-coordinate

Demo:

size.getWidth();

getHeight()

Get the pixel Y-coordinate

return value:(Number) Pixel Y-coordinate

Demo:

size.getHeight();

toString()

Return the size object as a string

return value:(String) Size in string format

Demo:

size.toString();
返回顶部 示例中心 常见问题 智能客服 公众号
二维码