Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useCluster无法使用 #24

Closed
fufjvnvnf opened this issue May 28, 2017 · 1 comment
Closed

useCluster无法使用 #24

fufjvnvnf opened this issue May 28, 2017 · 1 comment

Comments

@fufjvnvnf
Copy link

fufjvnvnf commented May 28, 2017

react-amap version

0.2.7

OS/Browers version

macOS/Safari

Reproduction Link

Steps to reproduce

class AMapboxViz extends React.Component {

  constructor(props){
    super(props);

    const markers = this.props.locations;
    this.state={
      useCluster: true,
    };

    this.state = {
      markers
    };
  }

  render(){
    return (
      <Map
        amapkey={'ba035e10b09acfc492d168adfd1b97cb'}
        center={{longitude: 110, latitude: 40}}
        zoom={5}
      >
        <Markers
          markers={this.state.markers}
          useCluster={this.state.useCluster}
        />
      </Map>
    );
  }
}
function amapbox(slice, json){
  const div = d3.select(slice.selector);
  div.selectAll('*').remove();
  ReactDOM.render(
    <AMapboxViz
      {...json.data}
    />,
    div.node(),
  );
}

What is Expected?

显示的地图的marker会cluster成圆圈。

What is actually happening?

仅显示了markers,并没有cluster起来。

@fufjvnvnf
Copy link
Author

好吧 是由于constructor内两个紧接着的this.state={},第二个把第一个overwrite了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant