alexandre-melard / leaflet.TileLayer.WMTS

Add WMTS layering for leaflet
Other
78 stars 84 forks source link

TypeError: this.callInitHooks is not a function #25

Closed FrankyBoy closed 4 years ago

FrankyBoy commented 4 years ago

Hi!

Currently trying to get this package to run with Leaflet 1.6.0, getting the following error:

TypeError: this.callInitHooks is not a functionleaflet.js:5:2717
    i https://unpkg.com/leaflet@1.6.0/dist/leaflet.js:5
    onload http://localhost:8080/script.js:18

Where script.js:18 is where I do L.TileLayer.WMTS( ... )

Might be related to #11 which happened with Leaflet 1.0.

Cheers :)

FrankyBoy commented 4 years ago

PS: ok this is actually a documentation bug, as https://github.com/Leaflet/Leaflet/issues/5224#issuecomment-322871296 reveals:

Just in case someone has the same error, instead of

var positron = L.TileLayer(...)

you should write:

var positron = new L.TileLayer(...)

This needs to be updated in the readme file only then.

FrankyBoy commented 4 years ago

Uhm ... never mind ... some tutorial actually had it wrong, the official readme here has it correct. I'll go facepalm myself now.