Skip to content

Instantly share code, notes, and snippets.

@sprestridge
Forked from cliss/TackyLights.html
Last active October 1, 2020 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sprestridge/e09e46ec03ad5abaf5e46c4fcd976522 to your computer and use it in GitHub Desktop.
Save sprestridge/e09e46ec03ad5abaf5e46c4fcd976522 to your computer and use it in GitHub Desktop.
Howard County Beer Tour. This small bit of HTML & Javascript takes a series of addresses, and converts that into an ordered list. Each item in the list is an Apple Maps navigation link from [Your Current Location] to [That Brewery]. This file is designed to be hosted in Dropbox and then added to your home screen on your iPhone.
<html>
<head>
<title>Howard County Beer Tour</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<meta name="viewport" content="width=device-width" />
<!--<link rel="apple-touch-icon-precomposed" sizes="120x120" href="put-your-holiday-icon-here" />-->
</head>
<body>
<ol id="list"></ol>
<script type="text/javascript">
var addresses = [];
addresses.push("Bare Bones, 9150 Baltimore National Pike #22, Ellicott City, MD 21042");
addresses.push("Black Flag, 9315 Snowden River Pkwy, Columbia, MD 21046");
addresses.push("Ellicott Mills Brewing, 8308 Main St, Ellicott City, MD 21043");
addresses.push("Frisco / Push, 6695 Dobbin Rd, Columbia, MD 21045");
addresses.push("Hysteria, 9570 Berger Rd Suite J, Columbia, MD 21046");
addresses.push("Jailbreak, 9445 Washington Boulevard North F, Laurel, MD 20723");
addresses.push("Manor Hill, 4411 Manor Ln, Ellicott City, MD 21042");
addresses.push("Waredaca, 4017 Damascus Rd, Gaithersburg, MD 20882");
function replaceAll(str, from, to) {
return str.split(from).join(to);
}
$(document).ready(function() {
for (var i=0; i < addresses.length; ++i) {
var from = "Current+Location";
var to = addresses[i];
$("#list").append("<li><a href='http://maps.apple.com/?daddr=" + replaceAll(to, " ", "+") + "&saddr=" + from + "'>" + to.substr(0, to.indexOf(",")) + "</a></li>");
}
});
</script>
</body>
</html>
@sprestridge
Copy link
Author

I really liked this little script that Casey Liss put together to have an easy way to navigate from your current location to one of the locations on the list. He used it for holiday light touring in Richmond, VA but you could just as easily use it for a brewery tour, a list of places you visit often, etc. for one tap access to Apple Maps directions. I have updated it for breweries in the Howard County, MD vicinity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment