Class: Legend maps.nyc.gov

nyc.Legend

new Legend(legendTemplate)

A class to generate legend HTML
Parameters:
Name Type Description
legendTemplate string The template with an optional replacement token for the caption (${caption})
Source:

Extends

Methods

html(caption) → {JQuery}

Returns the legend HTML as a JQuery object
Parameters:
Name Type Description
caption string A legend caption
Source:
Returns:
The HTML element for the legend wrapped in a JQuery object
Type
JQuery

replace(str, values) → {string}

Replace tokens in a string with values from a provided object
Parameters:
Name Type Description
str string String with tokens to be replaced
values Object.<string, string> Values token for replacement
Inherited From:
Source:
Returns:
String with replacement value substitution
Type
string