Skip to content

Commit

Permalink
fix: Guard accessing a quad feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Jun 27, 2022
1 parent 8d01f4a commit 7a7bf3c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/canvas/tileLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ var canvas_tileLayer = function () {
*/
this._update = function (request) {
s_update.call(m_this, request);
m_quadFeature.nearestPixel(m_this.nearestPixel());
if (m_quadFeature && m_quadFeature.nearestPixel) {
m_quadFeature.nearestPixel(m_this.nearestPixel());
}
m_this._addBaseQuadToTiles(m_quadFeature, m_tiles);
return m_this;
};
Expand Down
4 changes: 3 additions & 1 deletion src/webgl/pixelmapFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ var webgl_pixelmapFeature = function (arg) {

if (arg.quadFeature) {
m_quadFeature = arg.quadFeature;
m_quadFeature.nearestPixel(true);
if (m_quadFeature.nearestPixel) {
m_quadFeature.nearestPixel(true);
}
}
this._init(arg);
return this;
Expand Down
4 changes: 3 additions & 1 deletion src/webgl/tileLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ var webgl_tileLayer = function () {
*/
this._update = function (request) {
s_update.call(m_this, request);
m_quadFeature.nearestPixel(m_this.nearestPixel());
if (m_quadFeature && m_quadFeature.nearestPixel) {
m_quadFeature.nearestPixel(m_this.nearestPixel());
}
m_this._addBaseQuadToTiles(m_quadFeature, m_tiles);
return m_this;
};
Expand Down

0 comments on commit 7a7bf3c

Please sign in to comment.