Giter VIP home page Giter VIP logo

Comments (2)

JserWang avatar JserWang commented on June 16, 2024
  render() {
    const { visible } = this.state;
    return (
      <Map
        ak="WAeVpuoSBH4NswS30GNbCRrlsmdGB5Gv"
        scrollWheelZoom
      >
        {
          visible && (
            <InfoWindow
              title="弹出框标题" // 信息窗标题文字,支持HTML内容
              content="弹出框内容" // 信息窗显示文字,支持HTML内容
              point={point} // 显示位置坐标
              offset={offset} // 信息窗位置偏移值。
              width={0} // 信息窗宽度,单位像素。取值范围:0, 220 - 730。如果您指定宽度为0,则信息窗口的宽度将按照其内容自动调整
              height={0} // 信息窗高度,单位像素。取值范围:0, 60 - 650。如果您指定高度为0,则信息窗口的高度将按照其内容自动调整
              maxWidth={250} // 信息窗最大化时的宽度,单位像素。取值范围:220 - 730
              autoPan={false} // 是否开启信息窗口打开时地图自动移动(默认开启)
              closeOnClick={false} // 是否开启点击地图关闭信息窗口(默认开启)
              displayMessage={false} // 是否在信息窗里显示短信发送按钮(默认开启)
            />
          )
        }
      </Map>
    );
  }

InfoWindow内部没有提供visible属性,但是你就像使用React组件一样,通过state或者你的状态管理来控制它是否渲染即可。

from rc-bmap.

zhangqi053694 avatar zhangqi053694 commented on June 16, 2024

我明白了,我也在试

from rc-bmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.