Reference Source
public class | source

MapTooltip

Extends:

leaflet~L.Tooltip → MapTooltip

Used to display the prompt box on the map

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)

Constructor

Method Summary

Public Methods
public

addToMapView(mapview: MapView): Null

Add to mapview

public

remove(): Null

Remove from the map

public

setContent(htmlContent: String): Null

Set the content of html

public

setLatLng(latlng: LatLng): Null

Set the geographic coordinates of the pop-up

Public Constructors

public constructor(options: Object) source

Constructor

Params:

NameTypeAttributeDescription
options Object

setting options

options.offset Point

The offset distance of the prompt box, Point(0, 0)

options.direction String

The direction of the prompt box appears, right, left, top, bottom, center, auto.

options.permanent Boolean

Is fixed display. true or false

options.opacity Number

Opacity 0~1

options.className String

Associate a custom CSS class

Public Methods

public addToMapView(mapview: MapView): Null source

Add to mapview

Params:

NameTypeAttributeDescription
mapview MapView

mapview object

Return:

Null

public remove(): Null source

Remove from the map

Return:

Null

public setContent(htmlContent: String): Null source

Set the content of html

Params:

NameTypeAttributeDescription
htmlContent String

html content

Return:

Null

public setLatLng(latlng: LatLng): Null source

Set the geographic coordinates of the pop-up

Params:

NameTypeAttributeDescription
latlng LatLng

Geographic coordinates

Return:

Null