O Earth Engine introduziu
níveis de cota não comercial para proteger recursos de computação compartilhados e garantir um desempenho confiável para todo mundo. Os projetos não comerciais usam o nível da comunidade por padrão, mas é possível mudar o nível de um projeto a qualquer momento.
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
Map.getBounds
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Retorna os limites da visualização atual do mapa como uma lista no formato [oeste, sul, leste, norte] em graus.
| Uso | Retorna |
|---|
Map.getBounds(asGeoJSON) | GeoJSONGeometry|List[Number]|String |
| Argumento | Tipo | Detalhes |
|---|
asGeoJSON | Booleano, opcional | Se for verdadeiro, vai retornar os limites do mapa como GeoJSON. |
Exemplos
Editor de código (JavaScript)
// 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());
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2026-01-08 UTC.
[null,null,["Última atualização 2026-01-08 UTC."],[],["The `Map.getBounds()` method retrieves the current map view's boundaries. It returns a list in the format \\[west, south, east, north] by default. If the optional `asGeoJSON` argument is set to true, it returns the bounds as GeoJSON. The code shows examples of using `getBounds()` with both list and GeoJSON outputs, and also how to retrieve other information such as map center, zoom level, and pixel scale.\n"]]