反应原生地图叠加

时间:2018-01-05 23:56:13

标签: ios react-native

有没有人在react-native-maps中使用overlay属性?我正在尝试创建一条跟随我当前位置的线,但我似乎无法让它工作。

这是我的代码

    <MapView
      style={styles.map}
      region= {{
        latitude: this.state.currentLatLng.latitude,
        longitude: this.state.currentLatLng.longitude,
        latitudeDelta: .007,
        longitudeDelta: .007,
      }}
      mapType='satellite'
      showsUserLocation={true}
      followUserLocation={false}
      overlays={[{
        coordinates: this.state.routeCoordinates,
        strokeColor: '#19B5FE',
        lineWidth: 10,
      }]}
      />

0 个答案:

没有答案
相关问题