Closed DmitrySavritsky closed 3 years ago
It seems the setScale is called before the Object initialization and the changed function is not completely defined.
The parameters initialization should be set after the object initialization (parent.call
).
I've pushed a new version that should fix the error. Can you test it? Just copy the GeoImage file https://github.com/Viglino/ol-ext/blob/master/src/source/GeoImage.js and replace the one in your node_module/ol-ext/source
Yes, there is no errors in new version. It will be great if you'll update the npm package with this fix.
I've published the 3.2.8 on npm.
Hello, I moved from 3.2.4 to 3.2.7 version of ol-ext package and it seems that there is something wrong with the setScale function of GeoImage class. Target.js:103 Uncaught TypeError: Cannot read properties of undefined (reading 'change') at ol_source_GeoImage../node_modules/ol/events/Target.js.Target.dispatchEvent (Target.js:103) at ol_source_GeoImage../node_modules/ol/Observable.js.Observable.changed (Observable.js:48) at ol_source_GeoImage../node_modules/ol-ext/source/GeoImage.js.ol_source_GeoImage.setScale (GeoImage.js:159) You changed "this.scale = opt_options.imageScale; " to "this.setScale(opt_options.imageScale); " in the constructor and I think that call of "this.changed(); " inside the setScale() function is the cause of this TypeError. Am I right?