כדי להגדיר סמנים מתקדמים, פועלים לפי השלבים הבאים.
קבלת מפתח 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-09-25 (שעון UTC)."],[],["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"]]