new Label(content, coordinates, optionsopt) [source]
var label = new maptalks.Label('label with a box',
[0, 0],
{
'draggable' : true,
'boxStyle' : {
'padding' : [12, 8],
'verticalAlignment' : 'top',
'horizontalAlignment' : 'right',
'minWidth' : 300,
'minHeight' : 200,
'symbol' : {
'markerType' : 'square',
'markerFill' : 'rgb(135,196,240)',
'markerFillOpacity' : 0.9,
'markerLineColor' : '#34495e',
'markerLineWidth' : 1
}
},
'textSymbol': {
'textFaceName' : 'monospace',
'textFill' : '#34495e',
'textHaloFill' : '#fff',
'textHaloRadius' : 4,
'textSize' : 18,
'textWeight' : 'bold',
'textVerticalAlignment' : 'top'
}
});
Parameter | Type | Default | Description |
---|---|---|---|
content
|
String | Label's text content | |
coordinates
|
Coordinate | coordinates | |
options
opt
|
Object | null | construct options defined in Label |
Extends:
Mixes From:
Fires:
Members
(constant) options
Properties:
Name | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options
opt
|
Object | null | textbox's options, also including options of Marker
Properties
|
- Source:
Methods
getBoxStyle() [source]
Get label's box style
Returns:
Object:setBoxStyle(style) [source]
Set a new box style to the label
Parameter | Type | Description |
---|---|---|
style
|
Object |
Returns:
Label: thisgetTextSymbol() [source]
Get label's text symbol
Returns:
Object:setTextSymbol(symbol) [source]
Set a new text symbol to the label
Parameter | Type | Description |
---|---|---|
symbol
|
Object |
Returns:
Label: this(mixin) startEditText() [source]
Start to edit the text, editing will be ended automatically whenever map is clicked.
Mixes From:
Fires:
Returns:
TextMarker: this(mixin) endEditText() [source]
End text edit.
Mixes From:
Fires:
Returns:
TextMarker: this(mixin) isEditingText() [source]
Whether the text is being edited.
Mixes From:
Returns:
Boolean:(mixin) getTextEditor() [source]
Get the text editor which is an ui.UIMarker
Mixes From:
Returns:
ui.UIMarker: text editor(inherited) getContent() [source]
Get text content of the label
Inherited From:
Returns:
String:(inherited) setContent() [source]
Set a new text content to the label
Inherited From:
Fires:
Returns:
Label: thisEvents
contentchange [source]
an event when changing label's text content
Properties:
Name | Type | Description |
---|---|---|
type
|
String | contentchange |
target
|
Label | label fires the event |
old
|
String | old content |
new
|
String | new content |
- Source:
(inherited) edittextstart [source]
edittextstart when starting to edit text content
Inherited From:
Properties:
Name | Type | Description |
---|---|---|
type
|
String | edittextstart |
target
|
TextMarker | fires the event |
- Inherited From:
- Source:
(inherited) edittextend [source]
edittextend when ended editing text content
Inherited From:
Properties:
Name | Type | Description |
---|---|---|
type
|
String | edittextend |
target
|
TextMarker | textMarker fires the event |
- Inherited From:
- Source: