Display legend information on the map. This internally creates the legend,
and then you can add it to a map by chaining .appendTo(map.parent)
.
<div id='map-div'></div>
<script>
var mm = com.modestmaps;
wax.tilejson(
'http://tiles.mapbox.com/mapbox/api/Tileset/geography-class',
function(tilejson) {
var m = new mm.Map('map-div',
new wax.mm.connector(tilejson));
wax.mm.legend(m, tilejson).appendTo(m.parent);
m.setCenterZoom(new mm.Location(39, -98), 2);
}
);
</script>
legend = wax.mm.legend(map, tilejson)
legend.appendTo(element)
<div class='wax-legends'><div class='wax-legend'>legend content</div></div>