Skip to content

Instantly share code, notes, and snippets.

@jacobtoye
Last active December 25, 2015 00:59
Show Gist options
  • Save jacobtoye/6891979 to your computer and use it in GitHub Desktop.
Save jacobtoye/6891979 to your computer and use it in GitHub Desktop.
// Assumes LEGEND exists like in legend.js and that map is an already initialized Leaflet map
for(var i = 0; i < LEGEND.sections.length; i++) {
for(var j = 0; j < LEGEND.sections[i].keys.length; j++) {
L.marker([LEGEND.sections[i].keys[j].coordinates[0], LEGEND.sections[i].keys[j].coordinates[1]])
.bindLabel(LEGEND.sections[i].keys[j].text, { noHide: true })
.addTo(map)
.showLabel();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment