function createShopButtons() {
		// Sorts coffeeshops alphabetically by name
		coffeeShops.sort(function (a, b) {
			var textA = a.name.toUpperCase();
			var textB = b.name.toUpperCase();
			return textA < textB ? -1 : textA > textB ? 1 : 0;
		});

		// Creates shop buttons as well as populates the directions drop down
		coffeeShops.forEach(function (shop) {
			$('#directionsSelect').append(
				'<option value="' +
					shop.latitude +
					',' +
					shop.longitude +
					'">' +
					shop.name +
					'</option>'
			);
			$('#shopbtnsList').append(
				'<a class="panel-block"><button class="button is-link is-fullwidth shopbtns">' +
					shop.name +
					'</button></a>'
			);
		});
	}
// Function to generate shop buttons for each entry in the coffeeShops array
Function to generate shop buttons for each entry in the coffeeShops array
Function to generate shop buttons for each entry in the coffeeShops array
function createShopButtons() {
		coffeeShops.sort(function (a, b) {
			var textA = a.name.toUpperCase();
			var textB = b.name.toUpperCase();
			return textA < textB ? -1 : textA > textB ? 1 : 0;
		});
		coffeeShops.forEach(function (shop) {
			$('#directionsSelect').append(
				'<option value="' +
					shop.latitude +
					',' +
					shop.longitude +
					'">' +
					shop.name +
					'</option>'
			);
			$('#shopbtnsList').append(
				'<a class="panel-block"><button class="button is-link is-fullwidth shopbtns">' +
					shop.name +
					'</button></a>'
			);
		});
	}
function createShopButtons ( ) { coffeeShops . sort ( function ( a , b ) { var textA = a . name . toUpperCase ( ) ; var textB = b . name . toUpperCase ( ) ; return textA < textB ? - 1 : textA > textB ? 1 : 0 ; } ) ; coffeeShops . forEach ( function ( shop ) { $ ( '#directionsSelect' ) . append ( '<option value="' + shop . latitude + ',' + shop . longitude + '">' + shop . name + '</option>' ) ; $ ( '#shopbtnsList' ) . append ( '<a class="panel-block"><button class="button is-link is-fullwidth shopbtns">' + shop . name + '</button></a>' ) ; } ) ; }
Function to generate shop buttons for each entry in the coffeeShops array
Function to generate shop buttons for each entry in the coffeeShops array
// Sorts coffeeshops alphabetically by name // Creates shop buttons as well as populates the directions drop down