Opting out of the new controls in v3.22 and v3.23
While using v3.22 or v.23 of the Google Maps JavaScript API, you can choose
to use the earlier set of controls rather than the updated controls, by
setting the controls style to 'azteca'. The following sample opts
out of the updated controls, in effect giving you the v3.21 controls in the
v3.22 or v.23 API. Note that you must set
google.maps.controlStyle = 'azteca' before you
initialize the map:
function initMap() {
google.maps.controlStyle = 'azteca';
var map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
});
}
What's changed
Version 3.22 of the Google Maps JavaScript API introduces changes to the controls that allow users to interact with the map. In summary, the changes have the following effect:
- The default position of some controls has changed.
- The color and size of some controls has changed.
- Some controls and control options are deprecated, and are no longer available in v3.22 of the API.
- The functionality of most controls remains the same. Differences are detailed on this page.
- The user experience is now consistent regardless of whether a map is using signed-in mode mode or not, and is also more consistent with the Google Maps website.
The changes affect the map and Street View, as described below.
Controls on the map
Default controls
The following two maps illustrate the default set of controls in v3.21 and v3.22 of the API. Further sections on this page provide more detail about each of the controls in turn.
| Old (v3.21 and opt-out): | |
| New (v3.22 default): |
Map size
By default, all the controls disappear if the map is too small (200x200px). You can override this behavior by explicitly setting the control to be visible. See the developer's guide.
Zoom control
The Zoom control is now just a "+" and "-" button - there is no longer a
slider. The default position of the Zoom control has changed from
TOP_LEFT to RIGHT_BOTTOM.
Old (v3.21 and opt-out):
|
|
New (v3.22 default):
|
Map Type control
The default position of the Map Type control has changed from
TOP_RIGHT to TOP_LEFT.
| Old (v3.21 and opt-out):
Default position: TOP_RIGHT |
|
| New (v3.22 default):
Default position: TOP_LEFT |
Street View (Pegman) control
The Street View control's appearance and default position have changed.
Old (v3.21 and opt-out):
|
|
New (v3.22 default):
|
Rotate control
The Rotate control is visible in satellite and hybrid modes when oblique (tilted) imagery is available on the map. The control's appearance and default position have changed.
Old (v3.21 and opt-out):
|
|
New (v3.22 default):
|
Overview Map control (deprecated)
The Overview Map control is not available in v3.22 of the API.
| Old (v3.21 and opt-out):
The Overview Map control is available, based on the setting of the overviewMapControl and
overviewMapControlOptions properties in
google.maps.MapOptions. |
|
| New (v3.22 default):
The Overview Map control is not available. |
Pan control (deprecated)
The map's Pan control is not available in v3.22 of the API. To pan the view, users can click and drag, or swipe, the map.
| Old (v3.21 and opt-out):
The Pan control is available, based on the setting of the panControl and panControlOptions properties in
google.maps.MapOptions. |
|
| New (v3.22 default):
The Pan control is not available. |
Controls on Street View
Default controls
The following two Street View panoramas illustrate the default set of controls in v3.21 and v3.22 of the API. Further sections on this page provide more detail about each of the controls in turn.
| Old (v3.21 and opt-out): | |
| New (v3.22 default): |
Zoom control
The Zoom control on Street View is now just a "+" and "-" button - there is
no longer a slider. The default position of the Zoom control has changed from
TOP_LEFT to RIGHT_BOTTOM.
Old (v3.21 and opt-out):
|
|
New (v3.22 default):
|
Address control
The background color of the Address control on Street View has changed from white to black. The new control offers users the option to view the address on Google Maps.
Old (v3.21 and opt-out):
|
|
New (v3.22 default):
|
Close control
The default position and the appearance of the Close control have changed. The control is now part of the Address control.
Old (v3.21 and opt-out):
|
|
New (v3.22 default):
|
Full Screen control (new)
The Full Screen control is new in v3.22 of the API. It allows the user to open the Street View panorama in fullscreen mode.
| Old (v3.21 and opt-out):
The Full Screen control is not available. |
|
New (v3.22 default):
|
Pan control
The default position and the appearance of the Pan control have changed on Street View panoramas.
Old (v3.21 and opt-out):
|
|
New (v3.22 default):
|
