Closed gavinr-maps closed 11 months ago
The warning is generated because MaplibreGLLayer.js is returning an _resize function that does not have an implementation (undefined).
Not sure if the best option here is to implement _resize and call GL.resize or just call this._update that is calling _resize when needed.
Let me know what are your thoughts about it.
@BrunoCaimar Good find. I was just investigating this.
Would this work?
_resize: function () {
return this._glMap._resize;
},
This does remove the warning for me, and I didn't see any issue with functionality. I could see in loading both contour-dev.html
and custom-vtl-dev.html
that _resize
was called, but saw now issues in functionality or any additional errors.
I looked into just doing resize: this._glMap._resize
and avoid defining the function at all, but when this code is executed glMap
is not instantiated and it throws an undefined error. So implementing the _resize
function is probably the best solution.
I created a PR in the case that you find this solution sufficient.
Would this work?
_resize: function () { return this._glMap._resize; },
This does remove the warning for me, and I didn't see any issue with functionality. I could see in loading both
contour-dev.html
andcustom-vtl-dev.html
that_resize
was called, but saw now issues in functionality or any additional errors.I looked into just doing
resize: this._glMap._resize
and avoid defining the function at all, but when this code is executedglMap
is not instantiated and it throws an undefined error. So implementing the_resize
function is probably the best solution.
@sheeley820 I don't think this will work. If glMap._resize does not exist, it will throw an error in the same way. I believe that an implementation similar to the _update method will work (or maybe just call the _update on _resize).
@BrunoCaimar Do you mean something like resize: this._update
or
_resize: function e {
this._update(e);
}
I have been using the implementation from my PR in my application and haven't seen any issues with it. Would it be enough to just place the null/undefined check in there?
Describe the bug
When using Esri Leaflet Vector v4.0.0 and higher, there's a warning in the console when the basemap layer is added:
Reproduction
wrong listener type: undefined
Logs
No response
System Info
Additional Information
No response