Fork me on GitHub
#cljsjs
<
2017-08-05
>
nha15:08:33

After upgrading react-leaflet I get the following message:

No such namespace: cljsjs.react-leaflet
Is there anything needed between "0.12.3-4" and "1.4.1-0"?

juhoteperi15:08:42

Hmh, I made a typo there...

nha15:08:38

Thanks! Trying 🙂

nha15:08:05

For some reason there is a leafnet error? java.io.FileNotFoundException: …project/cljsjs/leafnet/development/leaflet.inc.js (No such file or directory) clojure.lang.ExceptionInfo: …project/cljsjs/leafnet/development/leaflet.inc.js (No such file or directory)

juhoteperi15:08:09

That's probably due to cljsjs/leaflet typo, I think I already fixed that one...

juhoteperi15:08:26

I should really add proper validation to Cljsjs packaging scripts...

nha15:08:19

No big deal, I am happy with the previous version tbh. Is there a way I can fix it?

juhoteperi15:08:54

Leaflet 1.1.0-1 should fix this

juhoteperi15:08:10

Oh right, react-leaflet depends on 1.1.0-0

nha15:08:17

Ah makes sense 🙂

nha16:08:32

Works fine now 🙂 (looks like I have some updates to make on my code though - the marker is not displaying anymore)

nha16:08:09

probably not your doing, it looks like the request to get the image does not go to cloudflare cdn anymore, it tries to hit my local machine instead (after updating the leaflet css link). I will stay on the version I have for now

juhoteperi16:08:56

Do you have this (set! leaflet/Icon.Default.imagePath "//cdnjs.cloudflare.com/ajax/libs/leaflet/1.1.0/images") somewhere?

juhoteperi16:08:10

Works for me

nha17:08:09

I don't, looks like I need the equivalent of that for ReactLeaflet

juhoteperi17:08:01

Hmh, should work with react-leaflet also

juhoteperi17:08:05

Hmm, I'm not using that snippet in another project but icons work there

juhoteperi17:08:12

And that is with react-leaflet

juhoteperi17:08:31

Hmm or perhaps that project only uses custom icons

nha17:08:07

I am looking into custom icons now as well

nha17:08:42

Stupid check, but your leaflet in the snippet above is :require [cljsjs.leaflet :as leaflet] right?

nha17:08:20

(looks like ReactLeaflet has no Icon so I have to make one from leaflet directly)

juhoteperi17:08:54

You can't use cljsjs.leaflet :as leaflet

juhoteperi17:08:27

You either need to use js/L.Icon.Default.imagePath, or migrate to use :global-exports

juhoteperi17:08:40

:require [leaflet :as leaflet] works

nha17:08:23

Hm if I do :require [leaflet :as leaflet] I get leaflet is not defined. I have to read up on :global-export. I tried (set! js/L.Icon.Default.imagePath "//cdnjs.cloudflare.com/ajax/libs/leaflet/1.1.0/images") - no luck

juhoteperi17:08:15

You need Cljs 1.9.854 for :global-exports

nha17:08:42

Thanks - I know there has been quite a few nice changes lately 🙂

nha17:08:21

re - require: https://github.com/cljsjs/packages/tree/master/leaflet this seems to suggest to use :require [cljsjs.leaflet :as leaflet]?

juhoteperi17:08:01

It doesn't suggest to use :as leaflet with the old name

juhoteperi17:08:15

Proper documentation for this is still missing

nha17:08:34

no problem at all 🙂

juhoteperi17:08:08

I updated the web page to mention this a few days ago

nha17:08:57

very nice 🙂 I have to play a bit with it. Appreciate your help 🙂