digidem / leaflet-bing-layer

Bing Maps Layer for Leaflet v1.0.0
http://digidem.github.io/leaflet-bing-layer/
87 stars 53 forks source link

`Error: fetchJsonp is not a function` #28

Open diachedelic opened 6 years ago

diachedelic commented 6 years ago

I installed the script via Bower, but it looks like fetchJsonp is never defined (these lines are never executed)

leaflet-bing-layer.js?md5=:100 Uncaught TypeError: fetchJsonp is not a function
    at e.initialize (leaflet-bing-layer.js?md5=:100)
    at new e (leaflet.js?md5=:5)
    at Object.createLayer (base-layer-options.js:26)
    at controller.js:73
    at Array.forEach (<anonymous>)
    at Object.bind (controller.js:71)
    at controller.js:43
diachedelic commented 6 years ago

I'm using RequireJS/AMD

diachedelic commented 6 years ago

Looks like the issue is that fetch-jsonp is already wrapped in UMD, which breaks when browserify wraps it again:

image

dunkinnear commented 6 years ago

+1 for this, only happens for me on IE11, not Chrome.

gmaclennan commented 6 years ago

I don't use RequireJS or AMD so this will need someone else to fix it.

diachedelic commented 6 years ago

I have fixed it for myself, but I need to build against fetch-jsonp's master (annotated commit: https://github.com/diachedelic/leaflet-bing-layer/commit/d5371eaf648856fce0fbd5f53307c8f6b7e966db)

So it's not the nicest but it works for me.