장소 필드 opening_hours.open_now 및 utc_offset은 2019년 11월 20일부로 지원 중단되었으며 2021년 2월 20일에 사용 중지됩니다. 이 필드는 장소 라이브러리, Maps JavaScript API에서만 지원 중단되었습니다. 이 가이드에서는 이 필드의 사용을 중지하도록 코드를 업데이트하는 방법을 보여줍니다.
장소 세부정보 요청의 경우 fields 요청 매개변수에 opening_hours.open_now를 요청하는 대신 fields 요청 매개변수에 opening_hours 및 utc_offset_minutes를 포함한 다음 반환된 google.maps.places.PlaceResult 객체에서 opening_hours.isOpen() 메서드를 호출하여 장소가 영업 중인지 확인합니다. 다음 예는 장소가 영업 중인지를 결정하는 장소 세부정보 요청을 보여줍니다.
newgoogle.maps.places.PlacesService(attrContainer).getDetails({placeId:'...',fields:['opening_hours','utc_offset_minutes'],},function(place,status){if(status!=='OK')return;// something went wrongconstisOpenAtTime=place.opening_hours.isOpen(newDate('December 17, 2020 03:24:00'));if(isOpenAtTime){// We know it's open.}constisOpenNow=place.opening_hours.isOpen();if(isOpenNow){// We know it's open.}});
장소 검색 요청
장소 검색 요청의 경우 opening_hours.open_now 필드가 대체되지 않습니다. opening_hours 정보를 가져오려면 장소 세부정보 요청을 하는 것이 좋습니다.
주변 검색 및 텍스트 검색 요청
주변 검색 및 텍스트 검색 요청의 경우 openNow 요청 매개변수를 사용할 수 있습니다. 이 매개변수는 현재 영업 중인 장소만 포함하도록 결과를 필터링합니다.
openNow:false는 모든 장소를 반환합니다.
openNow:true는 현재 영업 중인 장소만 반환합니다.
모든 장소를 나열하고 openNow 상태를 표시하려면 먼저 openNow:false를 사용하여 모든 장소를 가져오도록 요청한 다음 openNow:true를 사용하여 영업 중인 장소만 가져오도록 요청하세요. 그런 다음 응답을 병합하세요.
utc_offset 필드
장소 세부정보 요청에서 utc_offset 필드는 utc_offset_minutes 필드로 대체됩니다. fields 요청 매개변수에서 그리고 PlaceResult에서 이 정보를 읽을 때 utc_offset을 utc_offset_minutes로 대체하면 됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-27(UTC)"],[[["\u003cp\u003eThe Places fields \u003ccode\u003eopening_hours.open_now\u003c/code\u003e and \u003ccode\u003eutc_offset\u003c/code\u003e are deprecated and will be turned off on February 20, 2021 in the Places Library, Maps JavaScript API.\u003c/p\u003e\n"],["\u003cp\u003eFor Place Details requests, use the \u003ccode\u003eopening_hours.isOpen()\u003c/code\u003e method and include \u003ccode\u003eopening_hours\u003c/code\u003e and \u003ccode\u003eutc_offset_minutes\u003c/code\u003e in the \u003ccode\u003efields\u003c/code\u003e request parameter instead of \u003ccode\u003eopening_hours.open_now\u003c/code\u003e and \u003ccode\u003eutc_offset\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eFor Find Place requests, it is recommended to make a Place Details request to get \u003ccode\u003eopening_hours\u003c/code\u003e information.\u003c/p\u003e\n"],["\u003cp\u003eFor Nearby Search and Text Search requests, use the \u003ccode\u003eopenNow\u003c/code\u003e request parameter to filter results based on open/closed status.\u003c/p\u003e\n"],["\u003cp\u003eReplace \u003ccode\u003eutc_offset\u003c/code\u003e with \u003ccode\u003eutc_offset_minutes\u003c/code\u003e in Place Details requests for the UTC offset information.\u003c/p\u003e\n"]]],[],null,[]]