.map {
width: 65%;
/*height: 95%;*// doesnt works. why?
height: 680px; // works?
}
map.jsx
<div id="mapCanvas">
<Map name="map"/>
</div>
home.jsx
render () {
console.log("Render Map")
return <div className="map" id="map"></div>
}
答案 0 :(得分:0)
在屏幕高度更改时调整地图画布的大小
componentDidUpdate () {
$(window).resize(function () {
const h = $(window).height(),
offsetTop = 85; // Calculate the top offset
$('#map').css('height', (h - offsetTop));
}).resize()
},