logo
Tutorials Examples naver map js api v3 네이버 지도 API Point

Class: naver.maps.Point

naver.maps. Point

Point 클래스는 2차원 평면의 좌표를 정의합니다.

new naver.maps.Point(x, y)

Parameters
Name Type Default Description
x number 0

x 좌표

y number 0

y 좌표

Methods

add(point)

좌표 객체의 x, y에 지정한 좌표의 x, y를 더합니다.

Parameters
Name Type Description
point Coord | PointLiteral

더할 좌표 객체

Returns
Type Description
naver.maps.Point

this

add(x, y)

좌표 객체의 x, y에 지정한 수치를 더합니다.

Parameters
Name Type Description
x number

x 좌표

y number

y 좌표

Returns
Type Description
naver.maps.Point

this

ceil()

좌표 객체의 x, y값을 올려 정수 형태로 만듭니다.

Returns
Type Description
naver.maps.Point

this

clone()

객체의 복제본을 반환합니다.

Returns
Type Description
naver.maps.Point

복제된 객체

div(x, y)

좌표 객체의 x, y에 지정한 수치를 나눕니다.

Parameters
Name Type Description
x number

x 좌표

y number

y 좌표

Returns
Type Description
naver.maps.Point

this

div(point)

좌표 객체의 x, y에 지정한 좌표의 x, y를 나눕니다.

Parameters
Name Type Description
point Coord | PointLiteral

나눌 좌표 객체

Returns
Type Description
naver.maps.Point

this

equals(point)

객체의 좌표와 지정한 좌표가 같은지 여부를 확인합니다.

Parameters
Name Type Description
point Coord | PointLiteral

비교할 좌표 객체

Returns
Type Description
boolean

동일 여부

floor()

좌표 객체의 x, y값의 소수점 이하를 버리고 정수 형태로 만듭니다.

Returns
Type Description
naver.maps.Point

this

mul(point)

좌표 객체의 x, y에 지정한 좌표의 x, y를 곱합니다.

Parameters
Name Type Description
point Coord | PointLiteral

곱할 좌표 객체

Returns
Type Description
naver.maps.Point

this

mul(x, y)

좌표 객체의 x, y에 지정한 수치를 곱합니다.

Parameters
Name Type Description
x number

x 좌표

y number

y 좌표

Returns
Type Description
naver.maps.Point

this

round()

좌표 객체의 x, y값을 반올림한 정수 형태로 만듭니다.

Returns
Type Description
naver.maps.Point

this

sub(x, y)

좌표 객체의 x, y에 지정한 수치를 뺍니다.

Parameters
Name Type Description
x number

x 좌표

y number

y 좌표

Returns
Type Description
naver.maps.Point

this

sub(point)

좌표 객체의 x, y에 지정한 좌표의 x, y를 뺍니다.

Parameters
Name Type Description
point Coord | PointLiteral

뺄 좌표 객체

Returns
Type Description
naver.maps.Point

this

toString()

객체의 좌표를 문자열로 반환합니다.

Returns
Type Description
string

좌표를 나타내는 문자열로 형식은 (x,y)입니다.

Example
var point = new naver.map.Point(128, 256);
point.toString(); // '(128,256)'