maptalks_CurvedLabel

Geospatiale. maptalks_CurvedLabel

Curved text Geometry for Maptalks (UIMarker-based).

Constructor

new maptalks_CurvedLabel(arg1_optionsopt)

Source:
Parameters:
Name Type Attributes Description
Array.<Array.<number>> | Array.<maptalks.Coordinate>
arg1_options Object <optional>
Name Type Attributes Default Description
base_font_size number <optional>
16
class string <optional>

Overrides manual .style using a preset class.

letter_spacing number <optional>
0
map maptalks.Map <optional>
style Object <optional>

Methods

getSmoothPoints(arg0_coords, arg1_samples_per_segmentopt) → {Array.<Array.<number>>}

Returns smoothed points between coords for arc curves.

Source:
Parameters:
Name Type Attributes Default Description
arg0_coords Array.<Array.<number>>
arg1_samples_per_segment <optional>
25
Returns:
Type:
Array.<Array.<number>>

measureTextWidth(arg0_text, arg1_font_size) → {number}

Measures actual text width using a <canvas> to assess kerning.

Source:
Parameters:
Name Type Description
arg0_text string
arg1_font_size number
Returns:
Type:
number

remove()

Removes the maptalks_CurvedLabel geometry from the map.

Source:

render()

Renders the maptalks_CurvedLabel geometry to the map.

Source:

setCoordinates(arg0_coords)

Sets coordinates for the maptalks_CurvedLabel geometry.

Source:
Parameters:
Name Type Description
arg0_coords Array.<Array.<number>>

setFontSize(arg0_size)

Sets the font size for the maptalks_CurvedLabel geometry.

Source:
Parameters:
Name Type Description
arg0_size number

setText(arg0_text)

Sets the new text for the maptalks_CurvedLabel geometry.

Source:
Parameters:
Name Type Description
arg0_text string

toJSON() → {Object}

Exports class to JSON.

Source:
Returns:
Type:
Object

updateZoom()

Internal helper function to refresh zoom.

Source:

(static) fromJSON(arg0_map, arg1_json) → {Geospatiale.maptalks_CurvedLabel}

Creates a new maptalks_CurvedLabel geometry from JSON.

Source:
Parameters:
Name Type Description
arg0_map maptalks.Map
arg1_json Object | string