reviewsהשקת Places UI Kit: ספריית רכיבים מוכנה לשימוש בעלות נמוכה, שמאפשרת לכם להוסיף לכל מפה שתבחרו את ממשק המשתמש המוכר של 'מקומות' במפות Google. כדאי לנסות אותו ולשלוח לנו משוב כדי לעזור לנו לעצב את העתיד של GMP.
סמנים
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
אפשר להשתמש בסמנים כדי למשוך את תשומת הלב של המשתמש למיקום מסוים במפה. המדריך הזה מדגים איך להשתמש בסמנים במפות תלת-ממדיות ולהתאים אותם אישית. אפשר לשלוט בצורה, בגודל ובצבע של הסמנים בנוסף לגובה שבו הם מופיעים.
יש להשתמש בסמנים כדי להציג מיקומים במפות. הדוגמה שלמעלה מראה סמן בסיסי יחיד ללא התאמה אישית.
התאמה אישית של הצבע, קנה המידה ותמונת הסמל
ניתן להתאים אישית את הרקע, הגליף, צבע הגבול והגודל של הסמן שמוגדר כברירת מחדל.

צריך להחליף את סמל הסמן שמוגדר כברירת מחדל במשאב SVG מותאם אישית.

הגדרת גובה הסמן
ניתן להגדיר את גובה הסמן על ידי הזזת הסמן והגדרת הגובה.

לגרום לסמנים להגיב לאירועי קליק ומקלדת
אפשר לגרום לסמן להגיב לקליקים ולאירועי מקלדת על ידי הוספת האזנה לאירועים
click
.
function initMap() {
const map = new Map3DElement({
center: { lat: 37.4690, lng: -122.1074, altitude: 0 },
tilt: 67.5,
range: 45000,
mode: MapMode.HYBRID
});
const interactiveMarker = new google.maps.marker.Marker3DInteractiveElement({
map,
position: {lat: 37.4239163, lng: -122.0947209},
});
interactiveMarker.addEventListener('gmp-click', (event) => {
// Handle the click event.
// ...
});
}
הגדרת התנהגות של התנגשויות בין סמנים
מציינים איך הסמן צריך להתנהג כשהוא מתנגש עם סמן אחר או עם תווית מפה אחרת.
const marker = new Marker3DElement({
position: {lat, lng},
collisionBehavior: google.maps.CollisionBehavior.REQUIRED
});
השלב הבא
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-04-29 (שעון UTC).
[null,null,["עדכון אחרון: 2025-04-29 (שעון UTC)."],[],[],null,["\u003cbr /\u003e\n\n| This product or feature is in Preview (pre-GA). Pre-GA products and features might have limited support, and changes to pre-GA products and features might not be compatible with other pre-GA versions. Pre-GA Offerings are covered by the [Google\n| Maps Platform Service Specific Terms](https://cloud.google.com/maps-platform/terms/maps-service-terms). For more information, see the [launch stage\n| descriptions](/maps/launch-stages).\n\n\u003cbr /\u003e\n\nUse markers to draw a user's attention to a location on a map. This guide\ndemonstrates how to use and customize markers in 3D maps. You can control the\nshape, size, and color of markers, in addition to the altitude at which they\nappear.\n\nUse markers to show locations on maps. The example above shows a basic, single\nmarker with no customization applied.\n\nCustomize color, scale and icon image\n\nCustomize the default marker's background, glyph, border color, and size.\n\nReplace the default marker icon with a custom SVG resource.\n\nSet marker altitude\n\nYou can set marker altitude by extruding the marker and setting the altitude.\n\nMake markers respond to click and keyboard events\n\nMake a marker respond to clicks and keyboard events by adding a `click` event\nlistener. \n\n function initMap() {\n const map = new Map3DElement({\n center: { lat: 37.4690, lng: -122.1074, altitude: 0 },\n tilt: 67.5,\n range: 45000,\n mode: MapMode.HYBRID\n });\n\n const interactiveMarker = new google.maps.marker.Marker3DInteractiveElement({\n map,\n position: {lat: 37.4239163, lng: -122.0947209},\n });\n\n interactiveMarker.addEventListener('gmp-click', (event) =\u003e {\n // Handle the click event.\n // ...\n });\n }\n\nSet marker collision behavior\n\nSpecify how a marker should behave when it collides with another marker or map\nlabel. \n\n const marker = new Marker3DElement({\n position: {lat, lng},\n collisionBehavior: google.maps.CollisionBehavior.REQUIRED\n });\n\nNext step\n\n- [Add a marker](/maps/documentation/javascript/3d/marker-add)"]]