Skip to content

Commit 4ee2a21

Browse files
committed
fix null pointer in batchConversionMarkers
1 parent 0884b64 commit 4ee2a21

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/map/Map.Camera.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ Map.include(/** @lends Map.prototype */{
239239
const centerPoint = this._prjToPoint(this._getPrjCenter(), undefined, TEMP_COORD);
240240
const pts = [];
241241
for (let i = 0, len = points.length; i < len; i++) {
242+
if (!points[i]) {
243+
pts.push(null);
244+
continue;
245+
}
242246
const point = points[i].copy()._multi(res);
243247
const altitude = altitudeIsArray ? (altitudes[i] || 0) : altitudes;
244248
this._toContainerPoint(point, isTransforming, res, altitude, centerPoint);

src/renderer/layer/vectorlayer/VectorLayerCanvasRenderer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer {
283283
for (let i = 0, len = markers.length; i < len; i++) {
284284
const geo = markers[i];
285285
geo._cPoint = pts[i];
286+
if (!geo._cPoint) {
287+
geo._inCurrentView = false;
288+
continue;
289+
}
286290
const { x, y } = pts[i];
287291
//Is the point in view
288292
geo._inCurrentView = (x >= xmin && y >= ymin && x <= xmax && y <= ymax);

0 commit comments

Comments
 (0)