הודעה: כל הפרויקטים הלא מסחריים שנרשמו לשימוש ב-Earth Engine לפני
15 באפריל 2025 חייבים
לאמת את הזכאות לשימוש לא מסחרי כדי לשמור על הגישה. אם לא תאמתו את החשבון עד 26 בספטמבר 2025, יכול להיות שהגישה שלכם תושעה.
ee.FeatureCollection.getMap
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
פונקציה אימפרטיבית שמחזירה מזהה ואסימון של מפה, שמתאימים ליצירת שכבת-על של מפה.
הפונקציה מחזירה אובייקט שאפשר להעביר לפונקציה ee.data.getTileUrl או לפונקציה ui.Map.addLayer, כולל שדה נוסף image שמכיל תמונה של Collection.draw שעוטפת FeatureCollection שמכילה את התכונה הזו. אם צוינה קריאה חוזרת (callback), הערך לא מוגדר.
| שימוש | החזרות |
|---|
FeatureCollection.getMap(visParams, callback) | MapId|Object |
| ארגומנט | סוג | פרטים |
|---|
זה: featurecollection | FeatureCollection | מופע FeatureCollection. |
visParams | אובייקט, אופציונלי | פרמטרים של התצוגה החזותית. בשלב הזה מותר להשתמש רק בפרמטר אחד, color, שמכיל מחרוזת של צבע RGB. אם לא מציינים את vis_params, המערכת משתמשת בצבע #000000. |
callback | פונקציה, אופציונלי | התקשרות חזרה אסינכרונית. אם לא מספקים את הערך הזה, השיחה מתבצעת באופן סינכרוני. |
דוגמאות
עורך הקוד (JavaScript)
// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
.filter('country_lg == "Belgium"');
// Get MapId for styled FeatureCollection.
var mapId = fc.getMap({color: '800080'});
print('mapId for styled FeatureCollection', mapId);
// MapId can be used as an input to Map.addLayer to display the layer.
Map.setCenter(4.56, 50.78, 7);
Map.addLayer(mapId);
// MapId can be used as an input to ee.data.getTileUrl to fetch map tiles.
print('URL for zoom level 6 tile that includes majority of points',
ee.data.getTileUrl(mapId, 32, 21, 6));
הגדרת Python
מידע על Python API ועל שימוש ב-geemap לפיתוח אינטראקטיבי מופיע בדף
Python Environment.
import ee
import geemap.core as geemap
Colab (Python)
# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
'country_lg == "Belgium"'
)
# Get MapId for styled FeatureCollection.
map_id = fc.getMapId({'color': '800080'})
display('map_id for FeatureCollection', map_id)
# MapId can be used as an input to geemap.Map.add_layer to display the layer.
m = geemap.Map()
m.set_center(4.56, 50.78, 7)
m.add_layer(map_id['image'])
display(m)
# MapId can be used as an input to ee.data.getTileUrl to fetch map tiles.
display(
'URL for zoom level 6 tile that includes majority of points',
ee.data.getTileUrl(map_id, 32, 21, 6),
)
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[],[]]