【问题标题】:React-Google-Maps DirectionsRenderer PanelReact-Google-Maps DirectionsRenderer 面板
【发布时间】:2018-07-03 21:46:44
【问题描述】:

当使用 react-google-maps 包装器时,有谁知道如何使用“面板”作为方向渲染器中的道具来显示面板,该面板显示已映射路线的文本说明。

https://tomchentw.github.io/react-google-maps/#directionsrenderer

【问题讨论】:

    标签: react-google-maps


    【解决方案1】:

    能够通过将道具设置为:

    (props =>
      <GoogleMap defaultZoom={7}>
        {props.directions && <DirectionsRenderer directions={props.directions}
        panel={ document.getElementById('panel') } />}
        <div id="panel"></div>
      </GoogleMap>
    );
    

    【讨论】:

      猜你喜欢
      • 2021-09-28
      • 2017-10-08
      • 1970-01-01
      • 2021-09-03
      • 2011-10-01
      • 2011-03-08
      • 2020-07-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多