Comments (2)
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.
我明白了,我也在试
from rc-bmap.
Related Issues (20)
- 自定义组件不全面啊,能不能直接继承BaseOverLay?
- 1.0.5版本,经纬度-3.74922 40.46367报错 HOT 1
- MarkerClusterer 如何引入使用 HOT 1
- Size 设置 offset 时无法使用负数,内部判断是否为Size时漏掉偏移量场景。 HOT 4
- Label组件中的Content中为HTML添加点击事件,不生效
- [BUG] 在移动端上 Polygon 再次渲染时会消失
- 请求补充typescript声明
- Marker执行点击事件时如何屏蔽Map的点击事件呢?
- Cannot read property 'Geolocation' of undefined
- 无法获取百度原生对象呢? HOT 1
- 没有这个AutoComplete 例子demo吗?
- 如何获取到BMapLib这个类
- BMapUtil.search 搜索结果参数不固定
- 为什么1.0版本后MarkerClusterer点聚合功能没有呢?
- setCenter方法不管用
- BMapUtil.search 这个方法是不是有点问题 HOT 1
- ie10报错
- DrivingRoute的search方法设置途经点waypoints不起作用
- 示例地址以及api地址打不开了
- Why can't I open the document address???
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rc-bmap.