S2RegionCoverer不尊重最小/最大细胞水平?

时间:2018-03-12 00:12:18

标签: android google-maps

当使用谷歌的S2几何图形库在谷歌地图小部件上绘制S2单元格时,我得到的单元格超出了我指定的(常量)范围。

class SomeComponent {
  componentWillMount() {
    if (typeof localStorage !== 'undefined') {
      console.log('I get to here...', localStorage.getItem('someValue')) // this comes in as expected always
      this.props.setMyReduxState(localStorage.getItem('someValue'))
    }
  }

  render () {
    // will have the value of the localStorage item someValue when navigated into the page
    // will be an empty string if I do a hard refresh
    console.log('this.props.myReduxState', this.props.myReduxState)
    return (
      <div>
        Stuff...
      </div>
    )
  }
}

const mapStateToProps = (state) => {
  return {
    myReduxState: state.something.myReduxState || ''
  }
}

const mapDispatchToProps = (dispatch) => {
  return {
    setMyReduxState (someValue) {
      dispatch(setMyReduxState(someValue))
    }
  }
}

结果细胞的水平为11-14,我哪里错了?

1 个答案:

答案 0 :(得分:0)

显然这是设计的,而且使用这个函数,传递区域中的任何一个点以及一个空的ArrayList都可以解决问题。

cov.getSimpleCovering(region_rect, bl.toPoint(),14,cells);