reactjs - Google-maps-react 折线根本不显示

标签 reactjs google-maps

我在这里经历了一些类似的话题,但没有一个对我有帮助。我正在尝试使用 Google Maps API 在 React Js 中的一些协调之间划清界限。请在下面查看我的代码。

<div id="map-container" className="map-container mt-3" style={style}>
      <Map
        google={this.props.google}
        zoom={14}
        style={style}
        initialCenter={{
          lat: 36.164195,
          lng: 5.669404
        }}
      >
        <Polyline
          paths={[
            { lat: "36.160093", lng: "5.668375" },
            { lat: "36.164195", lng: "5.669404" },
            { lat: "36.170509", lng: "5.672011" }
          ]}
          strokeColor="#1E1E1E"
          strokeOpacity={0.8}
          strokeWeight={5}
        />
      </Map>
    </div>

最佳答案

path 替换 Polyline 中的 paths 属性。

关于reactjs - Google-maps-react 折线根本不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52722302/

相关文章:

php - 使用 PHP 查询 MySQL 数据库以显示英国邮政编码特定半径内的属性

google-maps - ionic 电容器谷歌地图 setMapType 不起作用

reactjs - React Material-UI网格系统

css - 显示描述的模态对话框

javascript - 验证集成到react.js项目中

javascript - 为什么 web3.eth.getAccounts().then(console.log) 返回空数组?

css - 谷歌地图(街景)嵌入一个div,全屏坏了

google-maps - 使 d3 svg 路径可点击(在 Google map 叠加层中)

html - <div.main> </div.main> - 语法

google-maps - 提供的 key 不是有效的 Google API key