diff --git a/js/data/circle_bucket.js b/js/data/circle_bucket.js index 66456e65bd6..6d59b398004 100644 --- a/js/data/circle_bucket.js +++ b/js/data/circle_bucket.js @@ -41,34 +41,38 @@ CircleBucket.prototype.shaders = { CircleBucket.prototype.addFeature = function(feature) { - var geometries = loadGeometry(feature)[0]; + var geometries = loadGeometry(feature); for (var j = 0; j < geometries.length; j++) { - var group = this.makeRoomFor('circle', 4); - - var x = geometries[j].x; - var y = geometries[j].y; - - // Do not include points that are outside the tile boundaries. - if (x < 0 || x >= EXTENT || y < 0 || y >= EXTENT) continue; - - // this geometry will be of the Point type, and we'll derive - // two triangles from it. - // - // ┌─────────┐ - // │ 3 2 │ - // │ │ - // │ 0 1 │ - // └─────────┘ - - var index = this.addCircleVertex(x, y, -1, -1) - group.vertexStartIndex; - this.addCircleVertex(x, y, 1, -1); - this.addCircleVertex(x, y, 1, 1); - this.addCircleVertex(x, y, -1, 1); - group.vertexLength += 4; - - this.addCircleElement(index, index + 1, index + 2); - this.addCircleElement(index, index + 3, index + 2); - group.elementLength += 2; + var geometry = geometries[j]; + + for (var k = 0; k < geometry.length; k++) { + var group = this.makeRoomFor('circle', 4); + + var x = geometry[k].x; + var y = geometry[k].y; + + // Do not include points that are outside the tile boundaries. + if (x < 0 || x >= EXTENT || y < 0 || y >= EXTENT) continue; + + // this geometry will be of the Point type, and we'll derive + // two triangles from it. + // + // ┌─────────┐ + // │ 3 2 │ + // │ │ + // │ 0 1 │ + // └─────────┘ + + var index = this.addCircleVertex(x, y, -1, -1) - group.vertexStartIndex; + this.addCircleVertex(x, y, 1, -1); + this.addCircleVertex(x, y, 1, 1); + this.addCircleVertex(x, y, -1, 1); + group.vertexLength += 4; + + this.addCircleElement(index, index + 1, index + 2); + this.addCircleElement(index, index + 3, index + 2); + group.elementLength += 2; + } } }; diff --git a/package.json b/package.json index 3604db1f138..b15ee239057 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "eslint": "^1.5.0", "eslint-config-mourner": "^1.0.0", "istanbul": "^0.4.1", - "mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#7ebad0438ea47721235434f56eb0dba2db66ddb5", + "mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#bd74e2c8aef40651f5fcc9d5544b89b6707787ae", "prova": "^2.1.2", "sinon": "^1.15.4", "st": "^1.0.0",