ghettovoice / vuelayers

Web map Vue components with the power of OpenLayers
https://vuelayers.github.io/
MIT License
681 stars 230 forks source link

TypeError in loaderFactory #386

Closed sh-aix closed 3 years ago

sh-aix commented 3 years ago

Hey there,

I am using a loader function in a vector source for loading Features. It works once but then I usually receive this error: Uncaught (in promise) TypeError: loader is not a function

I am defining it the following way layer.source.loaderFactory = function (extent, resolution, projection) {...}

and register it in the vector source component with :loader-factory="layer.source.loaderFactory"

In my understanding, the function should be executed if the extent changes. The strategyFactory is set to loadingBBox.

Am I missing something here?

ghettovoice commented 3 years ago

Hello @sh-aix , which version of VueLayers do you using?

I can't reproduce this with v0.11.x https://jsfiddle.net/ghettovoice/qa8p913o/122/ Can you provide a demo or full code sample?

sh-aix commented 3 years ago

Ah now it works. I changed the loader factory to: layer.source.loaderFactory = function loader() { return (extent, resolution, projection) => {...}}

Thanks!