ui.Map.centerObject

একটি প্রদত্ত বস্তুর উপর মানচিত্র দৃশ্য কেন্দ্রে.

এই ui.Map ফেরত দেয়।

ব্যবহার রিটার্নস
Map. centerObject (object, zoom , onComplete ) ui.মানচিত্র
যুক্তি টাইপ বিস্তারিত
এই: ui.map ui.মানচিত্র ui.Map উদাহরণ।
object উপাদান|জ্যামিতি কেন্দ্রে একটি বস্তু - একটি জ্যামিতি, চিত্র বা বৈশিষ্ট্য।
zoom নম্বর, ঐচ্ছিক জুম স্তর, 0 থেকে 24 পর্যন্ত। অনির্দিষ্ট থাকলে, বস্তুর বাউন্ডিং বাক্সের উপর ভিত্তি করে গণনা করা হয়।
onComplete ফাংশন, ঐচ্ছিক একটি কলব্যাক যা রিস্টারিং সফলভাবে সম্পন্ন হওয়ার পরে ট্রিগার হয়৷ এই প্যারামিটারটি পাস করার ফলে `centerObject` অপারেশন অ্যাসিঙ্ক্রোনাসভাবে চালানো হয়।

উদাহরণ

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

// The default map in the Code Editor is a built-in ui.Map object called "Map".
// Let's refer to it as "defaultMap" for clarity.
var defaultMap = Map;

// ui.Map objects can be constructed. Here, a new map is declared.
var newMap = ui.Map({
  center: {lat: 0, lon: 0, zoom: 1},
  style: {position: 'bottom-right', width: '400px'}
});

// Add the newMap to the defaultMap.
defaultMap.add(newMap);

// You can set the viewport of a ui.Map to be centered on an object.
// Here, the defaultMap is centered on a point with a selected zoom level.
var geom = ee.Geometry.Point(-122.0841, 37.4223);
defaultMap.centerObject(geom, 18);
defaultMap.addLayer(geom, {color: 'orange'}, 'Googleplex');

// Map extent can be fetched using the ui.Map.getBounds method.
print('defaultMap bounds as a list',
      defaultMap.getBounds());
print('defaultMap bounds as a dictionary',
      ee.Dictionary.fromLists(['w', 's', 'e', 'n'], defaultMap.getBounds()));
print('defaultMap bounds as GeoJSON',
      defaultMap.getBounds({asGeoJSON: true}));

// Map center point can be fetched using the ui.Map.getCenter method.
print('defaultMap center as a Point geometry', defaultMap.getCenter());

// Map zoom level can be fetched using the ui.Map.getZoom method.
print('defaultMap zoom level', defaultMap.getZoom());

// Map scale can be fetched using the ui.Map.getScale method.
print('defaultMap approximate pixel scale', defaultMap.getScale());