Re: Google Maps in Clojurescript

2011-11-22 Thread Sam Ritchie
Roman, I apologize, I never thanked you for this. I finally got around to trying this out last night and put together this small project for anyone else interested: https://github.com/sritchie/contour I'm using Noir server-side. This is just a demo now, but we'll see what comes of it. Here's

Re: Google Maps in Clojurescript

2011-11-22 Thread Chris Gray
Hi, Just to add another way of doing the same thing, I used the following when I was using Google Maps in Clojurescript: (def map-opts (extend-object! (js-obj) {zoom 4 center center-of-us mapTypeId types/ROADMAP

Google Maps in Clojurescript

2011-10-09 Thread Sam Ritchie
Hey all, I started playing with Clojurescript tonight, and couldn't quite figure out how to access an external library -- specifically the Google Maps API -- from within a clojurescript project. I can download maps.js, but how do I go about including it in a project? Thanks, -- Sam Ritchie,

Re: Google Maps in Clojurescript

2011-10-09 Thread r0man
Hi Sam, this is how I use Google Maps with Clojurescript. In the html page I load Google's Loader library, the Google Closure base.js file and the deps.js file which is the one cljsc spit out. (defhtml javascripts [] (html (include-js (str https://www.google.com/jsapi?key=; (google-api-key

Re: Google Maps in Clojurescript

2011-10-09 Thread r0man
Forgot to mention my init-map fn: (defn init-map [element] (let [options (h/clj-js {:zoom 1 :mapTypeId google.maps.MapTypeId.ROADMAP}) parent-size (style/getSize (. element parentNode)) element-size (style/getSize element) map (doto (google.maps.Map. element options)