 
 ;; Map configuration/alteration
 
+(def tile-url (str "http://server.arcgisonline.com"
+                   "/ArcGIS/rest/services/Canvas"
+                   "/World_Light_Gray_Base/MapServer/tile"
+                   "/{z}/{y}/{x}"))
+
 (defn setup-map [m lat lng]
   (-> m (.setView [lat lng] 12))
   (-> L (.tileLayer tile-url {:maxZoom 16 ;; this is the limitation of the tile

                from (from-query lat lng)
                transport-type (transportation-query)
                category (category-query)
                directions (<! (fetch-draw-directions mappy to from
                                                      transport-type category))]
            (<! (draw-yelp-info mappy directions category))
            ;; stop loading spinner
            (stop-spinner)
            )))))

              [[(:sw-lat map-bounds) (:sw-lng map-bounds)]
               [(:ne-lat map-bounds) (:ne-lng map-bounds)]]))

(defn add-numbered-marker [layer layer-items lat lng num]
  (let [NumberedDivIcon (.-NumberedDivIcon js/L)
        marker (-> L (.marker [lat, lng]
                              {:icon (NumberedDivIcon. {:number (str num)})})
                   (.on "click" #(aset js/window "location"
                                       (str "#" (section-id num)))))
        new-layer (.addLayer layer marker)]
    (swap! layer-items assoc num new-layer)))

(defn add-numbered-marker-active [layer layer-items lat lng num]
  (let [NumberedDivIconActive (.-NumberedDivIconActive js/L)
        marker (-> L (.marker [lat, lng]
                              {:icon (NumberedDivIconActive. {:number (str num)})})
                   (.on "click" #(aset js/window "location"
                                       (str "#" (section-id num)))))
        new-layer (.addLayer layer marker)]
    (swap! layer-items assoc num new-layer)))

(defn remove-marker [layer layer-items num]
  (let [marker (get @layer-items num)]
    (swap! layer-items dissoc num)
    (.removeLayer layer marker)))

;; Draw directions/markers

(defn draw-directions [m directions directions-layer]
  (let [{:keys [start-point end-point lines map-bounds]} directions
        start-circle (-> L (.circle (vec start-point) 8 {:color "green"}))
        end-circle (-> L (.circle (vec end-point) 8 {:color "red"}))
