我将google-react-maps
与zoomControl
和mapTypeControl
一起使用:
<Map onMount={(map, maps) => {}} {...mapProps} style={{
height: '100%'
}} api-key={key} optionsConstructor={(maps) => {
return {
disableDefaultUI: true,
keyboardShortcuts: true,
mapTypeId: maps.MapTypeId.HYBRID,
mapTypeControl: true,
mapTypeControlOptions: {
style: maps.MapTypeControlStyle.DROPDOWN_MENU,
position: maps.ControlPosition.TOP_RIGHT
},
scaleControl: true,
rotateControl: true,
rotateControlOptions: {
position: maps.ControlPosition.RIGHT_TOP
},
zoomControl: true,
zoomControlOptions: {
position: maps.ControlPosition.RIGHT_TOP
}
}
}}>
如何更改缩放和地图类型控件的背景颜色?
答案 0 :(得分:1)
只需将元素作为目标,然后添加CSS背景颜色(div> div> div>按钮)。通过使用css中的类而不是元素,可以更加具体。这是我所做的(检查CSS代码):
DateUpdated
`DateAdded` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`DateUpdated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
这是一个工作示例:http://jsbin.com/cosezum/edit?html,css,js,output
希望这对您有帮助!