Skip to content

Instantly share code, notes, and snippets.

@phiat
Created October 14, 2013 23:52
Show Gist options
  • Save phiat/6984319 to your computer and use it in GitHub Desktop.
Save phiat/6984319 to your computer and use it in GitHub Desktop.
A simple static google maps img using compojure (ring/jetty for server) and hiccup (for html generation).
(ns gmaps-test.handler
(:use compojure.core)
(:require [compojure.handler :as handler]
[compojure.route :as route]
[hiccup.core :as h]))
(defn index-page []
(h/html [:img {:src "http://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap&markers=color:blue%7Clabel:S%7C40.702147,-74.015794&markers=color:green%7Clabel:G%7C40.711614,-74.012318&markers=color:red%7Ccolor:red%7Clabel:C%7C40.718217,-73.998284&sensor=false"}]
))
(defroutes app-routes
(GET "/" [] (index-page))
(route/resources "/")
(route/not-found "Not Found"))
(def app
(handler/site app-routes))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment