diff --git a/static/js/embed.js b/static/js/embed.js
index ab9f7363e0013e7953caed7bf7769d098b284b77..5d2db04fa8eccf52652721eaa7afd83e0a727bfd 100644
--- a/static/js/embed.js
+++ b/static/js/embed.js
@@ -1,14 +1,13 @@
 BusMap.Embed = function(opts) {
-    this.opts = opts;
     var embedVars = {};
-    var that = this;
+    var that = this.Embed;
+    that.opts = opts;
 
     /* Constructor - initialize the embed form */
     function init() {
         bindEventHandlers();
         populateOptions();
     }
-
     var updateEmbedCode = function() {
         // Grab HTML representation of preview; trim whitespace.
         var code = $("#embed-preview").html().trim();
@@ -33,8 +32,14 @@ BusMap.Embed = function(opts) {
             opt.appendTo("#embed-stop");
         }
         if ($("#embed-stop option").length > 1 && !$("#embed-stop").val()) {
-            // We have stops. Select the first one.
-            $("#embed-stop option:nth-child(2)").prop('selected', true);
+            // We have stops.
+            if (window._busmap.selectedStop) {
+                // Select the last one clicked if available.
+                $("#embed-stop").val(window._busmap.selectedStop);
+            } else {
+                // Select the first one.
+                $("#embed-stop option:nth-child(2)").prop('selected', true);
+            }
             $("#embed-stop").change(); // fire event to handle the change
         }
     }
diff --git a/static/js/map.js b/static/js/map.js
index 197b92061cb600cbcbb1ff5b58d735cd2b32c5cf..966d6c38ea4ebccab46e4fc0f2e8b782fbba4874 100644
--- a/static/js/map.js
+++ b/static/js/map.js
@@ -13,7 +13,7 @@ var BusMap = {
 BusMap.Map = function(opts) {
     var stops = {};
     var routes = {};
-    var modal_cache = {};
+    var modalCache = {};
     var that = this.Map;
     that.opts = opts;
     window._busmap = this.Map;
@@ -292,10 +292,14 @@ BusMap.Map = function(opts) {
                     title: stops[s].title,
                     icon: markerIcon,
                     opacity: 1,
+                    stopId: s
                 };
                 that.stopMarkers[s] = L.marker(
                     [stops[s].lat, stops[s].lon],
-                    markerOpts).bindPopup(text, popupOpts);
+                    markerOpts).bindPopup(text, popupOpts)
+                    .on('click', function(e) {
+                        that.selectedStop = this.options.stopId;
+                    });
                 that.stopMarkersClusterGroup.addLayer(that.stopMarkers[s]);
             }
             // Add predictions to the marker popup, if available
@@ -399,12 +403,12 @@ BusMap.Map = function(opts) {
             query: "modal",
             modal_name: name,
         };
-        if (modal_cache[name]) {
-            modal.append(modal_cache[name]);
+        if (modalCache[name]) {
+            modal.append(modalCache[name]);
             setUrlFromView();
         } else {
             $.get("ajax", params).done(function(contents) {
-                modal_cache[name] = contents;
+                modalCache[name] = contents;
                 modal.append(contents);
                 setUrlFromView();
             }).fail(function() {