useCache option isn't available in new mixin concept
Closed this issue · 0 comments
mikeatlas commented
Hi again.
I'm trying out the mixin changes:
var baseLayer = L.tileLayer(myLayerURL,
{useCache: true, maxAge: maxAgePouchDBCache, minZoom: 2 });
This throws an exception in
.addInitHook(function(url,opts) {
if (!opts.useCache) {
because in Leaflet 0.7.3, url
and options
are not passed as parameters to that method:
// call all constructor hooks
if (this._initHooks) {
this.callInitHooks(); //
}
URL and options are already part of the instance of the tileLayer.
The code should probably be:
.addInitHook(function() {
if (!this.options.useCache) {
// etc
-Mike