ee.FeatureCollection.getMap

একটি আবশ্যিক ফাংশন যা একটি মানচিত্র আইডি এবং টোকেন প্রদান করে, একটি মানচিত্র ওভারলে তৈরি করার জন্য উপযুক্ত৷

একটি বস্তু ফেরত দেয় যা ee.data.getTileUrl বা ui.Map.addLayer-এ পাস করা যেতে পারে, একটি অতিরিক্ত 'ইমেজ' ক্ষেত্র সহ, একটি Collection.draw চিত্রটি এই বৈশিষ্ট্যটি সম্বলিত একটি FeatureCollection র্যাপ করে। একটি কলব্যাক নির্দিষ্ট করা হলে অনির্ধারিত৷

ব্যবহার রিটার্নস
FeatureCollection. getMap ( visParams , callback ) MapId|বস্তু
যুক্তি টাইপ বিস্তারিত
এই: featurecollection ফিচার কালেকশন ফিচার কালেকশনের উদাহরণ।
visParams বস্তু, ঐচ্ছিক ভিজ্যুয়ালাইজেশন পরামিতি। বর্তমানে শুধুমাত্র একটি প্যারামিটার, 'রঙ', একটি RGB রঙের স্ট্রিং ধারণকারী অনুমোদিত। যদি vis_params নির্দিষ্ট করা না থাকে, তাহলে রং #000000 ব্যবহার করা হয়।
callback ফাংশন, ঐচ্ছিক একটি অ্যাসিঙ্ক কলব্যাক৷ যদি সরবরাহ না করা হয়, কলটি সিঙ্ক্রোনাসভাবে করা হয়।

উদাহরণ

কোড এডিটর (জাভাস্ক্রিপ্ট)

// 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));

পাইথন সেটআপ

পাইথন এপিআই এবং ইন্টারেক্টিভ ডেভেলপমেন্টের জন্য geemap ব্যবহার করার জন্য পাইথন এনভায়রনমেন্ট পৃষ্ঠাটি দেখুন।

import ee
import geemap.core as geemap

Colab (পাইথন)

# 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),
)