Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/style/query_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function circleIntersection({
? (pitchScale === 'map' ? intersectionTestMapMap : intersectionTestMapViewport)
: (pitchScale === 'map' ? intersectionTestViewportMap : intersectionTestViewportViewport);

const param = {queryGeometry, size, transform, unwrappedTileID, getElevation} as CircleIntersectionTestParams;
const param: CircleIntersectionTestParams = {queryGeometry, size, transform, unwrappedTileID, getElevation};
for (const ring of geometry) {
for (const point of ring) {
if (intersectionTest(param, point)) {
Expand Down
4 changes: 4 additions & 0 deletions src/style/style_layer/circle_style_layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@
let transformedPolygon: Array<Point>;
let transformedSize: number;
if (pitchAlignment === 'map') {
// TODO I have confirmed that this codepath is correct

Check failure on line 69 in src/style/style_layer/circle_style_layer.ts

View workflow job for this annotation

GitHub Actions / Code Hygiene

Unexpected 'todo' comment: 'TODO I have confirmed that this codepath...'
transformedPolygon = translatedPolygon;
transformedSize = size * pixelsToTileUnits;
} else {
// TODO I suspect this codepath is INCORRECT or BROKEN.

Check failure on line 73 in src/style/style_layer/circle_style_layer.ts

View workflow job for this annotation

GitHub Actions / Code Hygiene

Unexpected 'todo' comment: 'TODO I suspect this codepath is...'
// TODO Investigate the "cannot calculate elevation if elevation maxzoom > source.maxzoom" warnings

Check failure on line 74 in src/style/style_layer/circle_style_layer.ts

View workflow job for this annotation

GitHub Actions / Code Hygiene

Unexpected 'todo' comment: 'TODO Investigate the "cannot calculate...'
transformedPolygon = projectQueryGeometry(translatedPolygon, transform, unwrappedTileID, getElevation);
transformedSize = size;
}

// TODO I have confirmed that circleIntersection is correct.

Check failure on line 79 in src/style/style_layer/circle_style_layer.ts

View workflow job for this annotation

GitHub Actions / Code Hygiene

Unexpected 'todo' comment: 'TODO I have confirmed that...'
return circleIntersection({
queryGeometry: transformedPolygon,
size: transformedSize,
Expand Down
24 changes: 20 additions & 4 deletions src/tile/tile_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import type {MapSourceDataEvent} from '../ui/events';
import type {Terrain} from '../render/terrain';
import type {CanvasSourceSpecification} from '../source/canvas_source';
import {GeoJSONSource} from '../source/geojson_source';

Check failure on line 30 in src/tile/tile_manager.ts

View workflow job for this annotation

GitHub Actions / Code Hygiene

All imports in the declaration are only used as types. Use `import type`

type TileResult = {
tile: Tile;
Expand Down Expand Up @@ -397,7 +398,7 @@
* Analogy: imagine two sheets of paper in 3D space:
* - one sheet = ideal tiles at varying overscaledZ
* - the second sheet = maxCoveringZoom
*
*
* @param retainTileMap - this parameters will be updated with the child tiles to keep
* @param idealTilesWithoutData - which of the ideal tiles currently does not have loaded data
* @return a set of tiles that need to be loaded
Expand Down Expand Up @@ -569,7 +570,7 @@
tileSize: this.usedForTerrain ? this.tileSize : this._source.tileSize,
minzoom: this._source.minzoom,
maxzoom: this._source.type === 'vector' && this.map._zoomLevelsToOverscale !== undefined
? transform.maxZoom - this.map._zoomLevelsToOverscale
? transform.maxZoom - this.map._zoomLevelsToOverscale
: this._source.maxzoom,
roundZoom: this.usedForTerrain ? false : this._source.roundZoom,
reparseOverscaled: this._source.reparseOverscaled,
Expand Down Expand Up @@ -1075,14 +1076,24 @@
if (!transform) return tileResults;
const allowWorldCopies = transform.getCoveringTilesDetailsProvider().allowWorldCopies();

const cameraPointQueryGeometry = has3DLayer ?
const cameraPointQueryGeometry = true ?
transform.getCameraQueryGeometry(pointQueryGeometry) :
pointQueryGeometry;

const project = (point: Point) => transform.screenPointToMercatorCoordinate(point, this.terrain);
// TODO I have confirmed that queryGemetry is correct.

Check failure on line 1084 in src/tile/tile_manager.ts

View workflow job for this annotation

GitHub Actions / Code Hygiene

Unexpected 'todo' comment: 'TODO I have confirmed that queryGemetry...'
const queryGeometry = this.transformBbox(pointQueryGeometry, project, !allowWorldCopies);
const cameraQueryGeometry = this.transformBbox(cameraPointQueryGeometry, project, !allowWorldCopies);

const features: GeoJSON.Feature[] = [{
type: 'Feature',
properties: {},
geometry: {
type: 'Polygon',
coordinates: [queryGeometry.map(p => p.toLngLat().toArray())]
}
}];

const ids = this.getIds();

const cameraBounds = Bounds.fromPoints(cameraQueryGeometry);
Expand All @@ -1104,7 +1115,7 @@
tileSpaceBounds.expandBy(queryPadding);

if (tileSpaceBounds.intersects(EXTENT_BOUNDS)) {

// TODO I need to confirm that tileSpaceQueryGeometry is correct

Check failure on line 1118 in src/tile/tile_manager.ts

View workflow job for this annotation

GitHub Actions / Code Hygiene

Unexpected 'todo' comment: 'TODO I need to confirm that...'
const tileSpaceQueryGeometry: Array<Point> = queryGeometry.map((c) => tileID.getTilePoint(c));
const tileSpaceCameraQueryGeometry = cameraQueryGeometry.map((c) => tileID.getTilePoint(c));

Expand All @@ -1119,6 +1130,11 @@
}
}

(this.map.getSource('bbox') as GeoJSONSource).setData({

Check failure on line 1133 in src/tile/tile_manager.ts

View workflow job for this annotation

GitHub Actions / Unit tests

src/tile/tile_manager.test.ts > TileManager.tilesIn > mercator wrap bounding box spanning antimeridian from 179.9°W

TypeError: Cannot read properties of undefined (reading 'getSource') ❯ TileManager.tilesIn src/tile/tile_manager.ts:1133:19 ❯ src/tile/tile_manager.test.ts:2109:28

Check failure on line 1133 in src/tile/tile_manager.ts

View workflow job for this annotation

GitHub Actions / Unit tests

src/tile/tile_manager.test.ts > TileManager.tilesIn > mercator wrap bounding box spanning antimeridian from 179.9°E

TypeError: Cannot read properties of undefined (reading 'getSource') ❯ TileManager.tilesIn src/tile/tile_manager.ts:1133:19 ❯ src/tile/tile_manager.test.ts:2053:28

Check failure on line 1133 in src/tile/tile_manager.ts

View workflow job for this annotation

GitHub Actions / Unit tests

src/tile/tile_manager.test.ts > TileManager.tilesIn > mercator wrap

TypeError: Cannot read properties of undefined (reading 'getSource') ❯ TileManager.tilesIn src/tile/tile_manager.ts:1133:19 ❯ src/tile/tile_manager.test.ts:2007:28

Check failure on line 1133 in src/tile/tile_manager.ts

View workflow job for this annotation

GitHub Actions / Unit tests

src/tile/tile_manager.test.ts > TileManager.tilesIn > globe wrap bounding box spanning antimeridian from 179.9°W

TypeError: Cannot read properties of undefined (reading 'getSource') ❯ TileManager.tilesIn src/tile/tile_manager.ts:1133:19 ❯ src/tile/tile_manager.test.ts:1944:28

Check failure on line 1133 in src/tile/tile_manager.ts

View workflow job for this annotation

GitHub Actions / Unit tests

src/tile/tile_manager.test.ts > TileManager.tilesIn > globe wrap bounding box spanning antimeridian from 179.9°E

TypeError: Cannot read properties of undefined (reading 'getSource') ❯ TileManager.tilesIn src/tile/tile_manager.ts:1133:19 ❯ src/tile/tile_manager.test.ts:1888:28

Check failure on line 1133 in src/tile/tile_manager.ts

View workflow job for this annotation

GitHub Actions / Unit tests

src/tile/tile_manager.test.ts > TileManager.tilesIn > globe wrap

TypeError: Cannot read properties of undefined (reading 'getSource') ❯ TileManager.tilesIn src/tile/tile_manager.ts:1133:19 ❯ src/tile/tile_manager.test.ts:1842:28

Check failure on line 1133 in src/tile/tile_manager.ts

View workflow job for this annotation

GitHub Actions / Unit tests

src/tile/tile_manager.test.ts > TileManager.tilesIn > reparsed overscaled tiles

TypeError: Cannot read properties of undefined (reading 'getSource') ❯ TileManager.tilesIn src/tile/tile_manager.ts:1133:19 ❯ TileManager.<anonymous> src/tile/tile_manager.test.ts:1775:43 ❯ TileManager.fire src/util/evented.ts:132:26 ❯ SourceMock.fire src/util/evented.ts:147:24 ❯ SourceMock.onAdd src/tile/tile_manager.test.ts:62:18 ❯ TileManager.onAdd src/tile/tile_manager.ts:131:26 ❯ src/tile/tile_manager.test.ts:1795:21

Check failure on line 1133 in src/tile/tile_manager.ts

View workflow job for this annotation

GitHub Actions / Unit tests

src/tile/tile_manager.test.ts > TileManager.tilesIn > regular tiles

TypeError: Cannot read properties of undefined (reading 'getSource') ❯ TileManager.tilesIn src/tile/tile_manager.ts:1133:19 ❯ src/tile/tile_manager.test.ts:1730:35

Check failure on line 1133 in src/tile/tile_manager.ts

View workflow job for this annotation

GitHub Actions / Unit tests

src/tile/tile_manager.test.ts > TileManager.tilesIn > graceful response before source loaded

TypeError: Cannot read properties of undefined (reading 'getSource') ❯ TileManager.tilesIn src/tile/tile_manager.ts:1133:19 ❯ src/tile/tile_manager.test.ts:1694:28
type: 'FeatureCollection',
features
});

return tileResults;
}

Expand Down
Loading