new TextBox(content, coordinates, width, height, optionsopt) [source]
var textbox = new maptalks.TextBox('This is a textbox',
[0, 0], 200, 90,
{
'draggable' : true,
'textStyle' : {
'wrap' : true,
'padding' : [12, 8],
'verticalAlignment' : 'top',
'horizontalAlignment' : 'right',
'symbol' : {
'textFaceName' : 'monospace',
'textFill' : '#34495e',
'textHaloFill' : '#fff',
'textHaloRadius' : 4,
'textSize' : 18,
'textWeight' : 'bold'
}
},
'boxSymbol': {
// box's symbol
'markerType' : 'square',
'markerFill' : 'rgb(135,196,240)',
'markerFillOpacity' : 0.9,
'markerLineColor' : '#34495e',
'markerLineWidth' : 1
}
});
Parameter | Type | Default | Description |
---|---|---|---|
content
|
String | TextBox's text content | |
coordinates
|
Coordinate | coordinates | |
width
|
Number | width in pixel | |
height
|
Number | height in pixel | |
options
opt
|
Object | null | construct options defined in TextBox |
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
getWidth() [source]
Get textbox's width
Returns:
Number:setWidth(width) [source]
Set new width to textbox
Parameter | Type | Description |
---|---|---|
width
|
Number | returns {TextBox} this |
getHeight() [source]
Get textbox's height
Returns:
Number:setHeight(height) [source]
Set new height to textbox
Parameter | Type | Description |
---|---|---|
height
|
Number | returns {TextBox} this |
getBoxSymbol() [source]
Get textbox's boxSymbol
Returns:
Object: boxsymbolsetBoxSymbol(symbol) [source]
Set a new box symbol to textbox
Parameter | Type | Description |
---|---|---|
symbol
|
Object | returns {TextBox} this |
getTextStyle() [source]
Get textbox's text style
Returns:
Object:setTextStyle(style) [source]
Set a new text style to the textbox
Parameter | Type | Description |
---|---|---|
style
|
Object | new text style returns {TextBox} 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
(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: