diff --git a/js/data/circle_bucket.js b/js/data/circle_bucket.js index 7d36ab37b36..e3a9a82417b 100644 --- a/js/data/circle_bucket.js +++ b/js/data/circle_bucket.js @@ -20,6 +20,7 @@ function CircleBucket(buffers) { } CircleBucket.prototype.addFeatures = function() { + var extent = 4096; for (var i = 0; i < this.features.length; i++) { var geometries = this.features[i].loadGeometry()[0]; for (var j = 0; j < geometries.length; j++) { @@ -27,6 +28,9 @@ CircleBucket.prototype.addFeatures = function() { var x = geometries[j].x, y = geometries[j].y; + // Do not include points that are outside the tile boundaries. + if (x < 0 || x >= extent || y < 0 || y >= extent) continue; + var idx = this.buffers.circleVertex.index - this.elementGroups.current.vertexStartIndex;