Skip to content

L.Illustrate.Textbox

manleyjster edited this page Sep 29, 2014 · 1 revision
<style> .markdown-body code { background-color: rgba(0,0,0,0); } </style>

Textbox

Textboxes enable users to type annotations directly on the map.

Factory

L.Illustrate.textbox(<LatLng> latlng, <Textbox options> options?)

Methods

Method Returns Description
getSize() Point Gets the size of the textbox in pixels.
setSize(<L.Point> size) this Sets the size of the textbox.
getLatLng() LatLng Gets the latlng associated with the textbox. This latlng indicates the center of the textbox, not its upper-left corner.
setLatLng(<LatLng> latlng) this Sets the latlng associated with the textbox. This latlng indicates the center of the textbox, not its upper-left corner.
getRotation() Number Gets the rotation of the textbox about its center. Returns a number between 0 and 2π radians.
setRotation(<Number>) this Set the rotation of the textbox about its center. Should be a number between 0 and 2π radians.
getContent() String Gets the text content inside the textbox.
setContent(<String>) this Sets the text content for the textbox.
getTextarea() HTMLElement Returns a reference to the <textarea> of the textbox.
setStyle(<Textbox style options> options) this
toGeoJSON() GeoJSON Returns a geojson Point feature representing the textbox.

Options

Option Type Default Description
minSize Point L.point(10, 10) Determines the minimum size that the textbox can attain while its size is being changed in editing mode.
textEditable Boolean true Determines whether the text content of the textbox is editable.
textContent String "" Text content inside texxtbox. Defaults to the empty string.

Example

var textbox = L.Illustrate.textbox(L.latLng(41, -87), {}).addTo(map);
Clone this wiki locally