From cfd3b6f1ee2816685d317506095ec96906fe734d Mon Sep 17 00:00:00 2001
From: Anton Sarukhanov <code@ant.sr>
Date: Thu, 4 Feb 2016 20:19:11 -0500
Subject: [PATCH] Remove UI and Welcome screen when embedded.

---
 static/js/map.js   | 2 +-
 templates/map.html | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/static/js/map.js b/static/js/map.js
index 82af2b8..e3ac8a2 100644
--- a/static/js/map.js
+++ b/static/js/map.js
@@ -33,7 +33,7 @@ BusMap.Map = function(opts) {
         // Go to view requested by URL hash (if set)
         var viewOk = that.setViewFromUrlHash();
 
-        if (!viewOk) {
+        if (!viewOk && !that.opts.embed) {
             // Restore the user's last view (if exists).
             lastViewRecover();
         }
diff --git a/templates/map.html b/templates/map.html
index 66160ba..e808ae4 100644
--- a/templates/map.html
+++ b/templates/map.html
@@ -99,7 +99,7 @@
                 vehicles: 5,
             },
         });
-
+        {% if not embed %}
         // Put "About" link into the attribution box
         $(".leaflet-control-attribution")
             .html('<a id="show-about" href="javascript:void(0)">About</a>');
@@ -122,6 +122,7 @@
                 timeout: 3000,
             });
         });
+        {% endif %}
 
     </script>
 {% endblock %}
-- 
GitLab