@deck.gl/geo-layers 9.3.0-alpha.2 → 9.3.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.dev.js CHANGED
@@ -28272,10 +28272,24 @@ void main(void) {
28272
28272
  info.sourceTile = sourceTile;
28273
28273
  return info;
28274
28274
  }
28275
- filterSubLayer({ layer, viewport }) {
28275
+ filterSubLayer({ layer, viewport, cullRect, isPicking }) {
28276
28276
  const { tile } = layer.props;
28277
28277
  const { id: viewportId } = viewport;
28278
- return tile.selected && tile.viewportIds.includes(viewportId);
28278
+ if (!tile.selected || !tile.viewportIds.includes(viewportId)) {
28279
+ return false;
28280
+ }
28281
+ if (isPicking && cullRect && tile.content?.cartographicOrigin) {
28282
+ const [sx, sy] = viewport.project(tile.content.cartographicOrigin);
28283
+ const cx = cullRect.x + cullRect.width / 2;
28284
+ const cy = cullRect.y + cullRect.height / 2;
28285
+ const threshold = Math.max(viewport.width, viewport.height) / 4;
28286
+ const dx = sx - cx;
28287
+ const dy = sy - cy;
28288
+ if (dx * dx + dy * dy > threshold * threshold) {
28289
+ return false;
28290
+ }
28291
+ }
28292
+ return true;
28279
28293
  }
28280
28294
  _updateAutoHighlight(info) {
28281
28295
  const sourceTile = info.sourceTile;
package/dist/index.cjs CHANGED
@@ -2365,10 +2365,25 @@ var Tile3DLayer = class extends import_core11.CompositeLayer {
2365
2365
  info.sourceTile = sourceTile;
2366
2366
  return info;
2367
2367
  }
2368
- filterSubLayer({ layer, viewport }) {
2368
+ filterSubLayer({ layer, viewport, cullRect, isPicking }) {
2369
+ var _a;
2369
2370
  const { tile } = layer.props;
2370
2371
  const { id: viewportId } = viewport;
2371
- return tile.selected && tile.viewportIds.includes(viewportId);
2372
+ if (!tile.selected || !tile.viewportIds.includes(viewportId)) {
2373
+ return false;
2374
+ }
2375
+ if (isPicking && cullRect && ((_a = tile.content) == null ? void 0 : _a.cartographicOrigin)) {
2376
+ const [sx, sy] = viewport.project(tile.content.cartographicOrigin);
2377
+ const cx = cullRect.x + cullRect.width / 2;
2378
+ const cy = cullRect.y + cullRect.height / 2;
2379
+ const threshold = Math.max(viewport.width, viewport.height) / 4;
2380
+ const dx = sx - cx;
2381
+ const dy = sy - cy;
2382
+ if (dx * dx + dy * dy > threshold * threshold) {
2383
+ return false;
2384
+ }
2385
+ }
2386
+ return true;
2372
2387
  }
2373
2388
  _updateAutoHighlight(info) {
2374
2389
  const sourceTile = info.sourceTile;