Class Maps

지도

경로 찾기, 지오코딩, 고도 샘플링, 정적 지도 이미지 생성을 지원합니다.

속성

속성유형설명
DirectionFinderDirectionFinderEnums
StaticMapStaticMapEnums

방법

메서드반환 유형간략한 설명
decodePolyline(polyline)Number[]인코딩된 폴리라인 문자열을 점의 배열로 다시 디코딩합니다.
encodePolyline(points)String점 배열을 문자열로 인코딩합니다.
newDirectionFinder()DirectionFinder새 DirectionFinder 객체를 만듭니다.
newElevationSampler()ElevationSamplerElevationSampler 객체를 만듭니다.
newGeocoder()Geocoder새 Geocoder 객체를 만듭니다.
newStaticMap()StaticMap새 StaticMap 객체를 만듭니다.
setAuthentication(clientId, signingKey)void외부에서 설정한 Google 지도 API 프리미엄 플랜 계정을 사용하여 추가 할당량 허용을 활용할 수 있습니다.

자세한 문서

decodePolyline(polyline)

인코딩된 폴리라인 문자열을 점의 배열로 다시 디코딩합니다.

// Decodes a string representation of the latitudes and longitudes of Minneapolis and Milwaukee
// respectively.
var polyline = 'qvkpG`qhxPbgyI_zq_@';
var points = Maps.decodePolyline(polyline);
for (var i = 0; i < points.length; i+= 2) {
  Logger.log('%s, %s', points[i], points[i+1]);
}

매개변수

이름유형설명
polylineString디코딩할 인코딩된 폴리라인입니다.

리턴

Number[] - 위도 경도 쌍 (lat0, long0, lat1, long1, ...)의 배열입니다.

참고 항목


encodePolyline(points)

점 배열을 문자열로 인코딩합니다.

// The latitudes and longitudes of New York and Boston respectively.
var points = [40.77, -73.97, 42.34, -71.04];
var polyline = Maps.encodePolyline(points);

매개변수

이름유형설명
pointsNumber[]인코딩할 위도/경도 쌍의 배열입니다.

리턴

String - 이러한 점을 나타내는 인코딩된 문자열입니다.

참고 항목


newDirectionFinder()

새 DirectionFinder 객체를 만듭니다.

리턴

DirectionFinder - 새 경로 찾기 객체입니다.


newElevationSampler()

ElevationSampler 객체를 만듭니다.

리턴

ElevationSampler - 새로운 고도 샘플러 객체입니다.


newGeocoder()

새 Geocoder 객체를 만듭니다.

리턴

Geocoder - 새 지오코더 객체입니다.


newStaticMap()

새 StaticMap 객체를 만듭니다.

리턴

StaticMap - 새 정적 지도 객체입니다.


setAuthentication(clientId, signingKey)

외부에서 설정한 Google 지도 API 프리미엄 플랜 계정을 사용하여 추가 할당량 허용을 활용할 수 있습니다. 클라이언트 ID 및 서명 키는 Google 엔터프라이즈 지원 포털에서 얻을 수 있습니다. 다시 기본 할당량 허용값을 사용하려면 이 값을 null로 설정합니다.

Maps.setAuthentication('gme-123456789', 'VhSEZvOXVSdnlxTnpJcUE');

매개변수

이름유형설명
clientIdString클라이언트 식별자입니다.
signingKeyString비공개 서명 키.