בשיטה Place Photos (חדשה) צריך להעביר את שם המשאב של התמונה, שכולל את מזהה המקום בכתובת ה-URL של הבקשה, במקום רק את הפניה לתמונה. מידע נוסף זמין במאמר בנושא שינוי להפניות לתמונות.
Place Photos (חדש) תומך במפתחות API ובאסימוני OAuth כמנגנון אימות.
בטבלה הבאה מפורטים פרמטרים ב-Place Photos (גרסה קודמת) ששמם שונה או שהם שונו עבור Place Photos (גרסה חדשה), או פרמטרים שכבר לא נתמכים.
הפרמטר הנוכחי
פרמטר חדש
הערות
maxheight
maxHeightPx
חובה לציין את maxHeightPx, את maxWidthPx או את שניהם.
maxwidth
maxWidthPx
חובה לציין את maxHeightPx, את maxWidthPx או את שניהם.
הגדלת גודל התמונה
ב-Place Photos (Legacy) היה אפשר להעלות תמונות בגודל מקסימלי של 1,600 x 1,600 פיקסלים. התכונה 'מיקום תמונות' (חדשה)
תומכת בגדלים של עד 4,800 x 4,800 פיקסלים.
מעבר לתמונות לדוגמה
Place Photos (חדש)
API מחייב להעביר את resource name של התמונה המבוקשת, שכולל place ID ו-photo reference, בפורמט:
כל הפונקציות Nearby Search (חדש), Text Search (חדש) ו-Place Details (חדש) מחזירות מערך photos[] בתגובה שתומך בפורמט הזה. כל רכיב של photos[] בתשובה החדשה מכיל את השדות הבאים:
name – מחרוזת שמכילה את שם המשאב של התמונה. המחרוזת הזו היא בפורמט:
places/PLACE_ID/photos/PHOTO_REFERENCE
heightPx – הגובה המקסימלי של התמונה, בפיקסלים.
widthPx — הרוחב המקסימלי של התמונה, בפיקסלים.
authorAttributions[] – כל הקרדיטים הנדרשים. השדה הזה תמיד קיים, אבל יכול להיות שהוא ריק.
ב-API הקודם, צריך להעביר רק את התמונה להמחשה, בפורמט:
השיטות Find Place (קודמת), Nearby Search (קודמת), Text Search (קודמת) ו-Place Details (קודמת) מחזירות את המערך photos[] בתגובה שתומכת בפורמט הזה. כל רכיב photo בתגובה מדור קודם מכיל את השדות הבאים:
photo_reference – מחרוזת שמשמשת לזיהוי התמונה כשמבצעים בקשה לתמונה.
height – הגובה המקסימלי של התמונה.
width – הרוחב המקסימלי של התמונה.
html_attributions[] – כל הקרדיטים הנדרשים. השדה הזה תמיד קיים, אבל יכול להיות שהוא ריק.
[[["התוכן קל להבנה","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-09-04 (שעון UTC)."],[],[],null,["**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\nIntroduction\n\nThe Places API supports\n[Place Photos (Legacy)](/maps/documentation/places/web-service/photos).\nIf you are familiar with Place Photos (Legacy),\n[Place Photos (New)](/maps/documentation/places/web-service/place-photos)\nmakes the following changes:\n\n- Place Photos (New) requires that you pass the resource name of the photo, which includes the place ID in the request URL, instead of just the photo reference. For more information, see [Change to photo references](#photo-ref).\n- Place Photos (New) supports both [API keys](/maps/documentation/places/web-service/get-api-key) and [OAuth](/maps/documentation/places/web-service/oauth-token) tokens as the authentication mechanism.\n\nThe following table lists parameters in\nPlace Photos (Legacy) that have been renamed or\nmodified for Place Photos (New), or parameters\nthat are no longer supported.\n\n| Current parameter | New parameter | Notes |\n|-------------------|---------------|---------------------------------------------------------------|\n| `maxheight` | `maxHeightPx` | You must specify either `maxHeightPx`, `maxWidthPx`, or both. |\n| `maxwidth` | `maxWidthPx` | You must specify either `maxHeightPx`, `maxWidthPx`, or both. |\n\nIncreased photo size\n\nPlace Photos (Legacy) supported a maximum photo\nsize of 1600 by 1600 pixels. Place Photos (New)\nsupports sizes up to 4800 by 4800 pixels.\n\nChange to photo references\n\n[Place Photos (New)](/maps/documentation/places/web-service/place-photos)\nAPI requires that you pass the *resource name* of the requested photo, which\nincludes a **place ID** and the **photo reference**, in the form: \n\n```json\nhttps://places.googleapis.com/v1/places/\u003cvar translate=\"no\"\u003ePLACE_ID\u003c/var\u003e/photos/\u003cvar translate=\"no\"\u003ePHOTO_REFERENCE\u003c/var\u003e/media?maxWidthPx=400&key=\u003cvar translate=\"no\"\u003eAPI_KEY\u003c/var\u003e\n```\n\nNearby Search (New),\nText Search (New), and\nPlace Details (New)\nall return a `photos[]` array in the response that supports this format. Each\nelement of `photos[]` in the new response contains the following fields:\n\n- `name` --- A string containing the resource name of the\n photo. This string is in the form:\n\n ```\n places/PLACE_ID/photos/PHOTO_REFERENCE\n ```\n- `heightPx` --- The maximum height of the image, in pixels.\n- `widthPx` --- The maximum width of the image, in pixels.\n- `authorAttributions[]` --- Any required attributions. This field is always present, but might be empty.\n\nWith the legacy API, you only have to pass the **photo reference**, in the\nform: \n\n```json\nhttps://maps.googleapis.com/maps/api/place/photo?photo_reference=\u003cvar translate=\"no\"\u003ePHOTO_REFERENCE\u003c/var\u003emaxwidth=400&key=\u003cvar translate=\"no\"\u003eAPI_KEY\u003c/var\u003e\n```\n\nFind Place (Legacy),\nNearby Search (Legacy),\nText Search (Legacy), and\nPlace Details (Legacy) all return a `photos[]` array in\nthe response that supports this format. Each `photo` element in the legacy\nresponse contains the following fields:\n\n- `photo_reference` --- A string used to identify the photo when you perform a Photo request.\n- `height` --- The maximum height of the image.\n- `width` --- The maximum width of the image.\n- `html_attributions[]` --- Any required attributions. This field is always present, but might be empty.\n\n| **Note:** The `photo_reference` field does not include the place ID. If you want to use Place Photos (New) with these legacy APIs, you must add the place ID to construct the full resource name."]]