【发布时间】:2018-07-03 21:46:44
【问题描述】:
当使用 react-google-maps 包装器时,有谁知道如何使用“面板”作为方向渲染器中的道具来显示面板,该面板显示已映射路线的文本说明。
https://tomchentw.github.io/react-google-maps/#directionsrenderer
【问题讨论】:
当使用 react-google-maps 包装器时,有谁知道如何使用“面板”作为方向渲染器中的道具来显示面板,该面板显示已映射路线的文本说明。
https://tomchentw.github.io/react-google-maps/#directionsrenderer
【问题讨论】:
能够通过将道具设置为:
(props =>
<GoogleMap defaultZoom={7}>
{props.directions && <DirectionsRenderer directions={props.directions}
panel={ document.getElementById('panel') } />}
<div id="panel"></div>
</GoogleMap>
);
【讨论】: