b = map_name.setBaseMap(base_map);
The
Map.setBaseMap function changes the
base map that is displayed when the
Map object named
map_name is shown. Maps can use online base maps, which require an Internet connection to load, or can use offline base maps, which requires a map file stored on the device.
To specify an online map, use one of the following names as the base_map:
Name | Description |
Normal | Standard road map showing streets and outlines of some buildings. |
Satellite | Satellite imagery. |
Hybrid | Features from the street map overlaid on satellite imagery. |
Terrain | Physical map based on terrain information. |
None | Empty base map. Only markers and buttons are shown. |
To use an
offline map, specify
base_map using a string expression containing the filename of the offline map.
When no base map is set, the default base map will be calculated using
defined rules.
The function returns a logical value of 1 (true) if the base map was changed successfully and 0 (false) otherwise (for example, if the offline map is not found).
// Declare a map
Map mymap;
// Change the base map to satellite imagery
mymap.setBaseMap(Satellite);
// Display the map
mymap.show();
// Declare a map
Map mymap;
// Change the base map to an offline map file
mymap.setBaseMap("Maps/Suitland.mbtiles");
// Display the map
mymap.show();