Commits

Ning Sun committed ce7aba3

write iframe inside of plain url

Comments (0)

Files changed (2)

src/osm_api/core.clj

     (for [x (xml-seq xml-struct) :when (= :way (:tag x))]
         x)))
 
+(defn get-way-id [way]
+  (:id (:attrs way)))
+        
 (defn get-way-url
   [way]
-  (str "http://www.openstreetmaps.org/?way=" (:id (:attrs way))))
+  (str "http://www.openstreetmaps.org/?way=" (get-way-id way)))
 
 (defn -main []
     (let [osmdata (parse-osm-xml(load-from-osm 118.759 32.058 118.765 32.062))]

src/osm_api/web.clj

         (parse-osm-xml(apply load-from-osm (split bbox-str #","))))))        
 
 (defn to-link [url]
-    (html [:a {:href url} url]))        
+    (html [:iframe {:src url :width "300px" :height "200px"}]))        
         
 (defroutes root
     (GET "/ways" {{bbox :bbox} :params} 
-        (join "<br/>" (map to-link (ways bbox)))))
+        (join "" (map to-link (ways bbox)))))
 
 (def app
     (site root))