reviewsהשקת Places UI Kit: ספריית רכיבים מוכנה לשימוש בעלות נמוכה, שמאפשרת לכם להוסיף לכל מפה שתבחרו את ממשק המשתמש המוכר של 'מקומות' במפות Google. כדאי לנסות אותו ולשלוח לנו משוב כדי לעזור לנו לעצב את העתיד של GMP.
כדי להגדיר סמנים מתקדמים, פועלים לפי השלבים הבאים.
קבלת מפתח API והפעלת Maps JavaScript API
לפני שמשתמשים בסמנים מתקדמים, צריך פרויקט ב-Cloud עם חשבון לחיוב, וצריך להפעיל את Maps JavaScript API. מידע נוסף זמין במאמר בנושא הגדרת פרויקט Google Cloud.
כדי להשתמש בסמנים מתקדמים במפה צריך מזהה מפה. אם מזהה המפה חסר,
לא ניתן לטעון סמנים מתקדמים. כשלב לפתרון בעיות, אפשר להוסיף מאזין mapcapabilities_changed כדי להירשם לשינויים ביכולות המפה. השימוש ביכולות של המפה הוא אופציונלי, ומומלץ רק למטרות בדיקה ופתרון בעיות, או למטרות חזרה למצב קודם בזמן ריצה.
// Optional: subscribe to map capability changes.map.addListener('mapcapabilities_changed',()=>{constmapCapabilities=map.getMapCapabilities();if(!mapCapabilities.isAdvancedMarkersAvailable){// Advanced markers are *not* available, add a fallback.}});
[[["התוכן קל להבנה","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-07-13 (שעון UTC)."],[[["Get started with advanced markers by obtaining an API key, enabling the Maps JavaScript API, and creating a map ID."],["Update your map initialization code to include loading the advanced markers library and providing a map ID when instantiating the map."],["For testing purposes, use `DEMO_MAP_ID` as the map ID or utilize the provided example code, but replace the example map IDs for production."],["Optionally, check map capabilities to ensure advanced markers are available or to implement a fallback if they are not supported."]]],["To use advanced markers, you need a Cloud project with a billing account and the Maps JavaScript API enabled. First, obtain an API key and create a map ID, selecting JavaScript as the map type with either Vector or Raster options, or using `DEMO_MAP_ID` for testing. Update your map initialization code by loading the Maps JavaScript API and the advanced markers library. Instantiate the map with the created or demo map ID. Optionally, use a listener to check map capabilities.\n"]]