Google Maps - Controls
Example of a map with disabled
default UI. The maps displayed through the Google Maps API contain UI elements to allow user interaction with the map. These elements are known as controls and you can include variations of these controls in your Google Maps API application. Alternatively, you can do nothing and let the Google Maps API handle all control behavior. By default maps UI is enabled.
You may wish to tailor your interface by removing
, adding
, or modifying
UI behavior or controls. If you wish to only add or modify existing behavior, you need to ensure that the control is explicitly added to your application. Some controls appear on the map by default while others will not appear unless you specifically request them. Adding or removing controls from the map is specified in the MapOptions
object's fields.
Several controls are configurable, allowing you to alter
their behavior or change
their appearance. The Zoom control, for example, may display as either a large control with a full zoom control with slider, or as a smaller, mini-zoom control for smaller maps. These controls are modified by altering appropriate control options fields within the MapOptions
object upon creation of the map.
Most of control options contain a position
property which indicates where on the map to place the control. Positioning of these controls is not absolute; instead, the API will layout the controls intelligently by "flowing" them around existing map elements, or other controls, within given constraints (such as the map size). Note: all positions may coincide with positions of UI elements whose placements you may not modify.