- out += '<div id="mapkey">';
- out += '<h3>' + i18n(mapkey_values['heading'], { zoom_level: zoomlevel }) + "</h3>";
- out += '<table class="mapkey-table">';
- out += showKeyEntry('motorway.png', mapkey_values['motorway'], '');
-
- if (zoomlevel >= 12) {
- suffix = 12;
- }
- out += showKeyEntry('trunk' + suffix + '.png', mapkey_values['trunk'], '');
- if (zoomlevel >= 7) {
- out += showKeyEntry('primary' + suffix + '.png', mapkey_values['primary'], '');
- }
- if (zoomlevel >= 9) {
- out += showKeyEntry('secondary' + suffix + '.png', mapkey_values['secondary'], '');
- }
- if (zoomlevel >= 10) {
- suffix = '';
- if (zoomlevel >= 13) { suffix="13"; }
- out += showKeyEntry('unclassified' + suffix + '.png', mapkey_values['unclassified'], '');
- }
- if (zoomlevel >= 13) {
- out += showKeyEntry('unsurfaced.png', mapkey_values['unsurfaced'], '');
- out += showKeyEntry('track.png', mapkey_values['track'], '');
- out += showKeyEntry('byway.png', mapkey_values['byway'], '');
- out += showKeyEntry('bridleway.png', mapkey_values['bridleway'], '');
- out += showKeyEntry('cycleway.png', mapkey_values['cycleway'], '');
- out += showKeyEntry('footway.png', mapkey_values['footway'], '');
- }
- if (zoomlevel >= 8) {
- suffix = '';
- if (zoomlevel >= 13) { suffix = "13"; }
- out += showKeyEntry('rail' + suffix + '.png', mapkey_values['rail'], '');
- }
- if (zoomlevel >= 13) {
- out += showKeyEntry('subway.png', mapkey_values['subway'], '');
- out += showKeyEntry('tram.png', mapkey_values['tram'], '');
- }
- if (zoomlevel >= 12) {
- out += showKeyEntry('cable.png', mapkey_values['cable'], '');
- }
- if (zoomlevel >= 11) {
- out += showKeyEntry('runway.png', mapkey_values['runway'], '');
- }
- if (zoomlevel >= 12) {
- out += showKeyEntry('apron.png', mapkey_values['apron'], '');
- }
- out += showKeyEntry('admin.png', mapkey_values['admin'], '');
- if (zoomlevel >= 9) {
- out += showKeyEntry('forest.png', mapkey_values['forest'], '');
- }
- if (zoomlevel >= 10) {
- out += showKeyEntry('wood.png', mapkey_values['wood'], '');
- out += showKeyEntry('golf.png', mapkey_values['golf'], '');
- out += showKeyEntry('park.png', mapkey_values['park'], '');
- }
- if (zoomlevel >= 8) {
- out += showKeyEntry('resident.png', mapkey_values['resident'], '');
- }
- if (zoomlevel >= 10) {
- out += showKeyEntry('tourist.png', mapkey_values['tourist'], '');
- out += showKeyEntry('common.png', mapkey_values['common'], '');
- out += showKeyEntry('retail.png', mapkey_values['retail'], '');
- out += showKeyEntry('industrial.png', mapkey_values['industrial'], '');
- out += showKeyEntry('commercial.png', mapkey_values['commercial'], '');
- out += showKeyEntry('heathland.png', mapkey_values['heathland'], '');
- }
- if (zoomlevel >= 8) {
- out += showKeyEntry('lake.png', mapkey_values['lake'], '');
- }
- if (zoomlevel >= 10) {
- out += showKeyEntry('farm.png', mapkey_values['farm'], '');
- out += showKeyEntry('brownfield.png', mapkey_values['brownfield'], '');
- }
- if (zoomlevel >= 11) {
- out += showKeyEntry('cemetery.png', mapkey_values['cemetery'], '');
- out += showKeyEntry('allotments.png', mapkey_values['allotments'], '');
- out += showKeyEntry('pitch.png', mapkey_values['pitch'], '');
- out += showKeyEntry('centre.png', mapkey_values['centre'], '');
- out += showKeyEntry('reserve.png', mapkey_values['reserve'], '');
- out += showKeyEntry('military.png', mapkey_values['military'], '');
- }
- if (zoomlevel >= 12) {
- out += showKeyEntry('school.png', mapkey_values['school'], '');
- out += showKeyEntry('building.png', mapkey_values['building'], '');
- out += showKeyEntry('station.png', mapkey_values['station'], '');
- out += showKeyEntry('summit.png', mapkey_values['summit'], '');
- out += showKeyEntry('tunnel.png', mapkey_values['tunnel'], '');
- }
- if (zoomlevel >= 13) {
- out += showKeyEntry('bridge.png', mapkey_values['bridge'], '');
- }
- if (zoomlevel >= 15) {
- out += showKeyEntry('private.png', mapkey_values['private'], '');
- out += showKeyEntry('permissive.png', mapkey_values['permissive'], '');
- out += showKeyEntry('destination.png', mapkey_values['destination'], '');
- }
- if (zoomlevel >= 12) {
- out += showKeyEntry('construction.png', mapkey_values['construction'], '');
- }
-
- out += "</table>";
- out += "</div>";