开发 室内地图 JS API 开发指南 在地图上绘制 信息窗体

信息窗体 最后更新时间: 2021年01月22日

简介

用于在地图的某些地方打开信息窗体。

示例代码:

1)如果你想只绑定一个弹出来标记一下,然后打开它:

marker.bindPopup(popupContent).openPopup();

2)下面是一个更复杂的方法:

var popup = Indoor.popup()
.setLatLng(latlng)
.setContent('<p>Hello world!<br>This is a nice popup.</p>')
.openOn(map);

创建信息窗体

FActory

Description

Indoor.popup( <Popup options> options?, <ILayer> source? )

实例化一个信息窗体.

窗体选项

Option

Type

Default

Description

maxWidth

Number

300

最大宽度.

minWidth

Number

50

最小宽度.

maxHeight

Number

null

最大高度,超过后内容将滚动出现

autoPan

Boolean

true

自动平移动画.

closeButton

Boolean

true

控制的关闭按钮.

offset

Point

Point(0, 7)

弹出位置的偏移量.

closeOnClick

Boolean

null

关闭单击.

className

String

''

信息窗体的css class.

窗体方法

Method

Returns

Description

addTo( <Map> map )

this

添加到地图.

openOn( <Map> map )

this

关闭前一个,打开当前.

setLatLng( <LatLng> latlng )

this

设置打开位置坐标.

getLatLng()

LatLng

获取坐标位置.

setContent(<String|HTMLElement> htmlContent )

this

设置HTML content.

getContent()

<String|HTMLElement>

获取HTML content.

update()

this

更新位置和属性.

示例
中心
常见
问题
智能
客服