Skip to content

Commit

Permalink
Merge pull request #1231 from OpenGeoscience/guard-shutdown
Browse files Browse the repository at this point in the history
fix: Guard accessing a quad feature.
  • Loading branch information
manthey authored Jun 27, 2022
2 parents 8d01f4a + 7a7bf3c commit 3e924c6
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 3e924c6

Please sign in to comment.