diff --git a/src/data/bucket/symbol_bucket.js b/src/data/bucket/symbol_bucket.js index cc0c8934b63..6e9316122e7 100644 --- a/src/data/bucket/symbol_bucket.js +++ b/src/data/bucket/symbol_bucket.js @@ -279,6 +279,7 @@ class SymbolBucket implements Bucket { fadeStartTime: number; sortFeaturesByY: boolean; sortedAngle: number; + featureSortOrder: Array; text: SymbolBuffers; icon: SymbolBuffers; @@ -656,8 +657,11 @@ class SymbolBucket implements Bucket { this.text.indexArray.clear(); this.icon.indexArray.clear(); + this.featureSortOrder = []; + for (const i of symbolInstanceIndexes) { const symbolInstance = this.symbolInstances[i]; + this.featureSortOrder.push(symbolInstance.featureIndex); for (const placedTextSymbolIndex of symbolInstance.placedTextSymbolIndices) { const placedSymbol = this.text.placedSymbolArray.get(placedTextSymbolIndex); diff --git a/src/source/query_features.js b/src/source/query_features.js index eaa6285e4df..1829c5d13bc 100644 --- a/src/source/query_features.js +++ b/src/source/query_features.js @@ -6,6 +6,7 @@ import type Coordinate from '../geo/coordinate'; import type CollisionIndex from '../symbol/collision_index'; import type Transform from '../geo/transform'; import type { RetainedQueryData } from '../symbol/placement'; +import assert from 'assert'; export function queryRenderedFeatures(sourceCache: SourceCache, styleLayers: {[string]: StyleLayer}, @@ -56,9 +57,31 @@ export function queryRenderedSymbols(styleLayers: {[string]: StyleLayer}, params.filter, params.layers, styleLayers); + for (const layerID in bucketSymbols) { const resultFeatures = result[layerID] = result[layerID] || []; - for (const symbolFeature of bucketSymbols[layerID]) { + const layerSymbols = bucketSymbols[layerID]; + layerSymbols.sort((a, b) => { + // Match topDownFeatureComparator from FeatureIndex, but using + // most recent sorting of features from bucket.sortFeatures + const featureSortOrder = queryData.featureSortOrder; + if (featureSortOrder) { + // queryRenderedSymbols documentation says we'll return features in + // "top-to-bottom" rendering order (aka last-to-first). + // Actually there can be multiple symbol instances per feature, so + // we sort each feature based on the first matching symbol instance. + const sortedA = featureSortOrder.indexOf(a.featureIndex); + const sortedB = featureSortOrder.indexOf(b.featureIndex); + assert(sortedA >= 0); + assert(sortedB >= 0); + return sortedB - sortedA; + } else { + // Bucket hasn't been re-sorted based on angle, so use the + // reverse of the order the features appeared in the data. + return b.featureIndex - a.featureIndex; + } + }); + for (const symbolFeature of layerSymbols) { resultFeatures.push(symbolFeature.feature); } } diff --git a/src/symbol/collision_index.js b/src/symbol/collision_index.js index 1601cb0182d..3b8d1fc44d8 100644 --- a/src/symbol/collision_index.js +++ b/src/symbol/collision_index.js @@ -294,9 +294,6 @@ class CollisionIndex { } result[featureKey.bucketInstanceId].push(featureKey.featureIndex); } - for (const bucket in result) { - result[bucket].sort((a, b) => b - a); // Match topDownFeatureComparator from FeatureIndex - } return result; } diff --git a/src/symbol/placement.js b/src/symbol/placement.js index aa373dd5022..557401e4c25 100644 --- a/src/symbol/placement.js +++ b/src/symbol/placement.js @@ -68,6 +68,7 @@ export class RetainedQueryData { sourceLayerIndex: number; bucketIndex: number; tileID: OverscaledTileID; + featureSortOrder: ?Array constructor(bucketInstanceId: number, featureIndex: FeatureIndex, @@ -393,6 +394,9 @@ export class Placement { } bucket.sortFeatures(this.transform.angle); + if (this.retainedQueryData[bucket.bucketInstanceId]) { + this.retainedQueryData[bucket.bucketInstanceId].featureSortOrder = bucket.featureSortOrder; + } if (bucket.hasTextData() && bucket.text.opacityVertexBuffer) { bucket.text.opacityVertexBuffer.updateData(bucket.text.opacityVertexArray); diff --git a/test/integration/query-tests/symbol/rotated-sort/expected.json b/test/integration/query-tests/symbol/rotated-sort/expected.json new file mode 100644 index 00000000000..dd161b7bc08 --- /dev/null +++ b/test/integration/query-tests/symbol/rotated-sort/expected.json @@ -0,0 +1,1333 @@ +[ + { + "geometry": { + "type": "Point", + "coordinates": [ + -4.998779296875, + 0.9997051308419742 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -4.998779296875, + 1.9991059831233287 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -3.9990234375, + 0.9997051308419742 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -4.998779296875, + 2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -3.9990234375, + 1.9991059831233287 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -2.999267578125, + 0.9997051308419742 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -3.9990234375, + 2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -2.999267578125, + 1.9991059831233287 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -1.99951171875, + 0.9997051308419742 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -4.998779296875, + 4.001260305845264 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -4.998779296875, + 4.997922089609858 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -3.9990234375, + 4.001260305845264 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -2.999267578125, + 2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -1.99951171875, + 1.9991059831233287 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -0.999755859375, + 0.9997051308419742 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -1.99951171875, + 2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -0.999755859375, + 1.9991059831233287 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -3.9990234375, + 4.997922089609858 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -2.999267578125, + 4.001260305845264 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -0.999755859375, + 2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -2.999267578125, + 4.997922089609858 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -1.99951171875, + 4.001260305845264 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -1.99951171875, + 4.997922089609858 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -0.999755859375, + 4.001260305845264 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -0.999755859375, + 4.997922089609858 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0, + 0.9997051308419742 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0, + 1.9991059831233287 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0.999755859375, + 0.9997051308419742 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0, + 2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0.999755859375, + 1.9991059831233287 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 1.99951171875, + 0.9997051308419742 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0, + 4.001260305845264 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0.999755859375, + 2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 1.99951171875, + 1.9991059831233287 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 2.999267578125, + 0.9997051308419742 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 1.99951171875, + 2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 2.999267578125, + 1.9991059831233287 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 3.9990234375, + 0.9997051308419742 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0, + 4.997922089609858 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0.999755859375, + 4.001260305845264 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 2.999267578125, + 2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 3.9990234375, + 1.9991059831233287 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 4.998779296875, + 0.9997051308419742 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0.999755859375, + 4.997922089609858 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 1.99951171875, + 4.001260305845264 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 1.99951171875, + 4.997922089609858 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 2.999267578125, + 4.001260305845264 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 3.9990234375, + 2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 4.998779296875, + 1.9991059831233287 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 4.998779296875, + 2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 2.999267578125, + 4.997922089609858 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 3.9990234375, + 4.001260305845264 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 3.9990234375, + 4.997922089609858 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 4.998779296875, + 4.001260305845264 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 4.998779296875, + 4.997922089609858 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -4.998779296875, + -4.997922089609844 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -4.998779296875, + -4.00126030584525 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -3.9990234375, + -4.997922089609844 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -3.9990234375, + -4.00126030584525 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -2.999267578125, + -4.997922089609844 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -4.998779296875, + -2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -4.998779296875, + -1.9991059831233144 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -3.9990234375, + -2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -2.999267578125, + -4.00126030584525 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -1.99951171875, + -4.997922089609844 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -1.99951171875, + -4.00126030584525 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -0.999755859375, + -4.997922089609844 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -4.998779296875, + -0.99970513084196 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -3.9990234375, + -1.9991059831233144 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -2.999267578125, + -2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -0.999755859375, + -4.00126030584525 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -4.998779296875, + 0 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -3.9990234375, + -0.99970513084196 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -2.999267578125, + -1.9991059831233144 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -1.99951171875, + -2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -3.9990234375, + 0 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -2.999267578125, + -0.99970513084196 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -1.99951171875, + -1.9991059831233144 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -0.999755859375, + -2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -2.999267578125, + 0 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -1.99951171875, + -0.99970513084196 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -0.999755859375, + -1.9991059831233144 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -1.99951171875, + 0 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -0.999755859375, + -0.99970513084196 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -0.999755859375, + 0 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0, + -4.997922089609844 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0, + -4.00126030584525 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0.999755859375, + -4.997922089609844 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0, + -2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0.999755859375, + -4.00126030584525 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 1.99951171875, + -4.997922089609844 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 1.99951171875, + -4.00126030584525 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 2.999267578125, + -4.997922089609844 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0, + -1.9991059831233144 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0.999755859375, + -2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 2.999267578125, + -4.00126030584525 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 3.9990234375, + -4.997922089609844 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0, + -0.99970513084196 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0.999755859375, + -1.9991059831233144 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 1.99951171875, + -2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0, + 0 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0.999755859375, + -0.99970513084196 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 1.99951171875, + -1.9991059831233144 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 2.999267578125, + -2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 3.9990234375, + -4.00126030584525 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 4.998779296875, + -4.997922089609844 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 4.998779296875, + -4.00126030584525 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 0.999755859375, + 0 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 1.99951171875, + -0.99970513084196 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 2.999267578125, + -1.9991059831233144 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 3.9990234375, + -2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 1.99951171875, + 0 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 2.999267578125, + -0.99970513084196 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 3.9990234375, + -1.9991059831233144 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 4.998779296875, + -2.9978987411030573 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 2.999267578125, + 0 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 3.9990234375, + -0.99970513084196 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 4.998779296875, + -1.9991059831233144 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 3.9990234375, + 0 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 4.998779296875, + -0.99970513084196 + ] + }, + "type": "Feature", + "properties": {} + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + 4.998779296875, + 0 + ] + }, + "type": "Feature", + "properties": {} + } +] diff --git a/test/integration/query-tests/symbol/rotated-sort/style.json b/test/integration/query-tests/symbol/rotated-sort/style.json new file mode 100644 index 00000000000..f1fbc5bb750 --- /dev/null +++ b/test/integration/query-tests/symbol/rotated-sort/style.json @@ -0,0 +1,50 @@ +{ + "version": 8, + "metadata": { + "test": { + "description": "Because text-allow-overlap is true, the query results will be reordered based on rotated rendering order (compare to rotated-after-insert, in which the results match the order in the original data)", + "width": 256, + "height": 256, + "queryGeometry": [ + [ + 0, + 0 + ], + [ + 256, + 256 + ] + ] + } + }, + "center": [ + 0, + 0 + ], + "zoom": 3, + "bearing": 45, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://data/121points.geojson" + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "sprite": "local://sprites/sprite", + "layers": [ + { + "id": "symbol", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": ".", + "text-size": 6, + "text-allow-overlap": true, + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + } + ] +}