Class Maps

지도

방향 찾기, 지오코딩, 고도 샘플링, 정적 지도 이미지 생성을 허용합니다.

속성

속성유형설명
DirectionFinderDirectionFinderEnums
StaticMapStaticMapEnums

메서드

메서드반환 유형간략한 설명
decodePolyline(polyline)Number[]인코딩된 폴리라인 문자열을 포인트 배열로 다시 디코딩합니다.
encodePolyline(points)String포인트 배열을 문자열로 인코딩합니다.
newDirectionFinder()DirectionFinder새 DirectionFinder 객체를 만듭니다.
newElevationSampler()ElevationSamplerElevationSampler 객체를 만듭니다.
newGeocoder()Geocoder새 Geocoder 객체를 만듭니다.
newStaticMap()StaticMap새 StaticMap 객체를 만듭니다.
resetAuthenticationApiKey()void기본 할당량 허용량을 사용하도록 인증 사용자 인증 정보를 재설정합니다.
setAuthenticationByApiKey(apiKey)void추가 할당량을 활용하기 위해 API 키를 사용하여 요청을 인증할 수 있습니다.
setAuthenticationByApiKey(apiKey, signingKey)voidAPI 키와 서명 키를 사용하여 StaticMap에서 추가 할당량을 활용하기 위한 요청을 인증할 수 있습니다.

자세한 문서

decodePolyline(polyline)

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

// Decodes a string representation of the latitudes and longitudes of
// Minneapolis and Milwaukee respectively.
const polyline = 'qvkpG`qhxPbgyI_zq_@';
const points = Maps.decodePolyline(polyline);
for (let 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.
const points = [40.77, -73.97, 42.34, -71.04];
const polyline = Maps.encodePolyline(points);

매개변수

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

리턴

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

참고 항목


newDirectionFinder()

새 DirectionFinder 객체를 만듭니다.

리턴

DirectionFinder - 새 방향 탐지기 객체


newElevationSampler()

ElevationSampler 객체를 만듭니다.

리턴

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


newGeocoder()

새 Geocoder 객체를 만듭니다.

리턴

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


newStaticMap()

새 StaticMap 객체를 만듭니다.

리턴

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


resetAuthenticationApiKey()

기본 할당량 허용량을 사용하도록 인증 사용자 인증 정보를 재설정합니다. 이 방법은 API 키를 사용하여 요청을 인증할 때 작동합니다. 인증 사용자 인증 정보를 제공하지 않고 Maps 메서드를 사용하려면 이 메서드를 사용하여 기본 할당량 허용으로 되돌릴 수 있습니다.

Maps.resetAuthenticationApiKey();

생성 값

Error - setAuthentication(clientId, signingKey)이 인증에 사용되는 경우


setAuthenticationByApiKey(apiKey)

추가 할당량을 활용하기 위해 API 키를 사용하여 요청을 인증할 수 있습니다.

이 메서드는 요청을 인증하는 데 사용되는 API 키를 설정하는 데 사용됩니다. 이 메서드가 호출되면 할당량 소비 및 청구가 가격표에 따라 제공된 API 키와 연결된 Google Cloud 프로젝트에 청구됩니다. 인증 사용자 인증 정보를 제공하지 않고 기본 할당량 허용 범위로 Maps 메서드를 사용할 수 있습니다. StaticMap을 사용하는 경우 setAuthenticationByApiKey(apiKey, signingKey) 메서드를 대신 사용하세요.

Maps.setAuthenticationByApiKey('BBdgJpSbLtAtmkBFjgLt310qT6iekggfDdVqLC0');

매개변수

이름유형설명
apiKeyString빠른 시작 가이드에 설명된 단계에 따라 Google Cloud 콘솔에서 가져올 수 있는 API 키입니다.

생성 값

Error: apiKeynull인 경우 또는 setAuthentication(clientId, signingKey)이 이미 인증에 사용되고 있는 경우


setAuthenticationByApiKey(apiKey, signingKey)

API 키와 서명 키를 사용하여 StaticMap에서 추가 할당량을 활용하기 위한 요청을 인증할 수 있습니다. signingKey는 Static Map API에 대한 요청에 필요하지만 이 메서드를 사용하여 다른 지도 서비스를 인증할 수도 있습니다. 이 경우 signingKey 파라미터는 무시됩니다.

이 메서드는 요청을 인증하는 데 사용되는 API 키와 서명 키를 설정하는 데 사용됩니다. 서명 키는 StaticMap에 필요합니다. 테스트 목적으로 서명 없이 소수의 요청을 허용하지만 프로덕션에서 한도에 도달하면 실패하기 시작합니다. 자세한 내용은 여기에서 확인하실 수 있습니다.

Maps.setAuthenticationByApiKey('BBdgJpSbLtAtmkBFjgLt310qT6iekggfDdVqLC0',
'7_pry-Skg0PKxds-7nvdl91mB5=');

매개변수

이름유형설명
apiKeyString빠른 시작 가이드에 설명된 단계에 따라 Google Cloud 콘솔에서 가져올 수 있는 API 키입니다.
signingKeyString디지털 서명 가이드에 설명된 단계를 따라 Google Cloud 콘솔에서 가져올 수 있는 서명 키 StaticMap에 필요하며 다른 지도 서비스에서는 무시됩니다.

생성 값

Error: apiKeynull인 경우 또는 setAuthentication(clientId, signingKey)이 이미 인증에 사용되고 있는 경우

참고 항목

지원 중단된 메서드