在 React 中禁用街景、google 地图的全屏
Disable streetview, full screen of google map in react
我使用了这个 npm 包,"google-maps-react" link,有什么办法可以 disable/remove 全屏吗,街景功能?我试图找到方法,但这个图书馆似乎没有办法,请帮助我。
这是我的代码。
const myComp = props => {
return(
<Map
google={props.google}
style={{ width: "100%", height: "100%" }}
zoom={12}
onDragend={handleMapCenterChanged}
onReady={fetchPlaces}
>
</Map>
)
}
export default connect(
mapStateToProps,
{}
)(
GoogleApiWrapper({
apiKey: API_KEY,
LoadingContainer: LoadingContainer,
})(myComp)
)
要在使用 google-maps-react 库时禁用这些控件,您需要将每个控件的 parameters 设置为 false
。你可以关注这个:
<Map
google={this.props.google}
zoom={14}
style={mapStyles}
initialCenter={{ lat: 40.756795, lng: -73.954298 }}
fullscreenControl={false}
streetViewControl={false}
/>
我使用了这个 npm 包,"google-maps-react" link,有什么办法可以 disable/remove 全屏吗,街景功能?我试图找到方法,但这个图书馆似乎没有办法,请帮助我。 这是我的代码。
const myComp = props => {
return(
<Map
google={props.google}
style={{ width: "100%", height: "100%" }}
zoom={12}
onDragend={handleMapCenterChanged}
onReady={fetchPlaces}
>
</Map>
)
}
export default connect(
mapStateToProps,
{}
)(
GoogleApiWrapper({
apiKey: API_KEY,
LoadingContainer: LoadingContainer,
})(myComp)
)
要在使用 google-maps-react 库时禁用这些控件,您需要将每个控件的 parameters 设置为 false
。你可以关注这个:
<Map
google={this.props.google}
zoom={14}
style={mapStyles}
initialCenter={{ lat: 40.756795, lng: -73.954298 }}
fullscreenControl={false}
streetViewControl={false}
/>