如何更改 Google 地图缩放控件样式?
How do I change the Google Maps zoom control style?
我正在使用 Google 地图 API v3.17
这是我的代码:
this._options = {
zoom: this._params.zoom,
center: new google.maps.LatLng(this._params.center.lat, this._params.center.lng),
// Disabled controls
mapTypeControl: false,
panControl: false,
scaleControl: false,
streetViewControl: false,
// Zoom control
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL,
position: google.maps.ControlPosition.RIGHT_BOTTOM
},
// Disable scrollwheel and double-click zooming
scrollwheel: false,
disableDoubleClickZoom: true // Because clicking through images results in a zoom
};
this._map = new google.maps.Map(this._el, this._options);
我得到了一张旧式 Google 地图,带有小缩放图标(见左图)。
根据 API 文档,我要找的是更大的图标(见右图)。
我的代码与他们所说的完全相同...我错过了什么?
谢谢!!
术语 SMALL
和 LARGE
有点误导,它们与大小无关,它们的意思是与缩放控件一起使用:隐藏或显示滑块。
没有用于设置 "size" 的内置选项。
您在右侧看到的似乎是一个 signed-in map,它使用不同的控件。
注意:登录地图在 v3.17 中不可用
我正在使用 Google 地图 API v3.17
这是我的代码:
this._options = {
zoom: this._params.zoom,
center: new google.maps.LatLng(this._params.center.lat, this._params.center.lng),
// Disabled controls
mapTypeControl: false,
panControl: false,
scaleControl: false,
streetViewControl: false,
// Zoom control
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL,
position: google.maps.ControlPosition.RIGHT_BOTTOM
},
// Disable scrollwheel and double-click zooming
scrollwheel: false,
disableDoubleClickZoom: true // Because clicking through images results in a zoom
};
this._map = new google.maps.Map(this._el, this._options);
我得到了一张旧式 Google 地图,带有小缩放图标(见左图)。
根据 API 文档,我要找的是更大的图标(见右图)。
我的代码与他们所说的完全相同...我错过了什么?
谢谢!!
术语 SMALL
和 LARGE
有点误导,它们与大小无关,它们的意思是与缩放控件一起使用:隐藏或显示滑块。
没有用于设置 "size" 的内置选项。
您在右侧看到的似乎是一个 signed-in map,它使用不同的控件。
注意:登录地图在 v3.17 中不可用