On Thursday, April 30, 2015 at 9:36:03 PM UTC+2, [email protected] wrote: > I'm missing something ... I'd like to use leafletjs in clojurescript. > > So, I added `[cljsjs/leaflet "0.7.3-0"]` as a dependency to project.clj. > > Then, I use the leafletjs inside cljs like so: > > (.setView (.map js/L "map") #js [lat lng] 10) > > That works fine in without any optimizations. But when I compile in advanced, > it throws `Uncaught TypeError: L.map(...).Zc is not a function` > > So, I thought maybe i need to require it? So I tried adding > > (:require cljsjs.leaflet) > > ... which seems to compile ok. But I still see > > Uncaught TypeError: L.map(...).Zc is not a function > > Any ideas? > > Thanks, > Dave
Hi Dave, I'm not familiar with leaflet but it seems like setView is not in the extern file. I couldn't find it here: https://github.com/cljsjs/packages/blob/master/leaflet/resources/cljsjs/common/leaflet.ext.js and it is the function that is called on the object returned by map. The symbol "map" is in the extern file so it is not munged: (.setView (.map js/L "map") #js [lat lng] 10) L.map("map").setView([lat lng],10) L.map("map").Zc([lat lng],10) -> Zc is undefined! A possible fix would be to add setView to the extern file. Hope this helps Sebastian -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
