Skip to content

PATTERNS

customize Map

It is often helpful to customize the Map so that it centers and zooms on your area of interest and uses a base map that supports your purpose.

The diagram below shows a general pattern.

graph LR

  step01("Set map center and zoom") ;
  step02("Set base map style") ;

  step01 --> step02

  classDef task fill:#C3C8E6,stroke-width:0px,color:#000000;

  class step01 task; 
  class step02 task;

It is good practice to set the map center and zoom level before setting the base map so that the base map does not need to redraw.

set map center and zoom

Use a data object to center the map and to suggest an appropriate zoom level.

Map.centerObject(
    object,             // data object to center the Map. 
    16                  // zoom level to display the Map.
);

set basemap style

Select a basemap that provides the most helpful reference information from your data.

Map.setOptions("HYBRID");

Choose from the following options:

"ROADMAP" 
"SATELLITE" 
"HYBRID"
"TERRAIN" 


This work is licensed under CC BY-NC-SA 4.0