Reference Source
public class | source

MapTooltip

Extends:

leaflet~L.Tooltip → MapTooltip

用于在地图上显示提示框

Example:

var tooltip = new KQ.Map.MapTooltip({
  offset: new KQ.Struct.Point(0, -30),
});

tooltip.setLatLng(new KQ.Struct.LatLng(30, 104));
tooltip.setContent('Hello world!');
mapView.openTooltip(tooltip);

Constructor Summary

Public Constructor
public

constructor(options: Object)

构造函数

Method Summary

Public Methods
public

addToMapView(mapview: MapView): Null

添加到mapview

public

remove(): Null

从地图移除

public

setContent(htmlContent: String): Null

设置html内容

public

setLatLng(latlng: LatLng): Null

设置弹出框弹出的地理点坐标

Public Constructors

public constructor(options: Object) source

构造函数

Params:

NameTypeAttributeDescription
options Object

设置参数

options.offset Point

提示框的偏移距离,Point(0, 0)

options.direction String

提示框出现的方向,right, left, top, bottom, center, auto。

options.permanent Boolean

是否固定显示true or false

options.opacity Number

透明度 0~1

options.className String

关联一个自定义的CSS类

Public Methods

public addToMapView(mapview: MapView): Null source

添加到mapview

Params:

NameTypeAttributeDescription
mapview MapView

mapview对象

Return:

Null

public remove(): Null source

从地图移除

Return:

Null

public setContent(htmlContent: String): Null source

设置html内容

Params:

NameTypeAttributeDescription
htmlContent String

html内容

Return:

Null

public setLatLng(latlng: LatLng): Null source

设置弹出框弹出的地理点坐标

Params:

NameTypeAttributeDescription
latlng LatLng

地理点坐标

Return:

Null