@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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "deck.gl layers supporting geospatial use cases and GIS formats",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "version": "9.3.0-alpha.2",
6
+ "version": "9.3.0-alpha.3",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -65,5 +65,5 @@
65
65
  "@luma.gl/core": "~9.3.0-alpha.6",
66
66
  "@luma.gl/engine": "~9.3.0-alpha.6"
67
67
  },
68
- "gitHead": "135d329f4a4b596ae2c16e4eb801eda30252f3bc"
68
+ "gitHead": "25b39cfc26abd50aa900796fae75c2b5fedada69"
69
69
  }
@@ -160,11 +160,29 @@ export default class Tile3DLayer<DataT = any, ExtraPropsT extends {} = {}> exten
160
160
  return info;
161
161
  }
162
162
 
163
- filterSubLayer({layer, viewport}: FilterContext): boolean {
163
+ filterSubLayer({layer, viewport, cullRect, isPicking}: FilterContext): boolean {
164
164
  // All sublayers will have a tile prop
165
165
  const {tile} = layer.props as unknown as {tile: Tile3D};
166
166
  const {id: viewportId} = viewport;
167
- return tile.selected && tile.viewportIds.includes(viewportId);
167
+ if (!tile.selected || !tile.viewportIds.includes(viewportId)) {
168
+ return false;
169
+ }
170
+
171
+ // When picking, skip tiles whose content center is far from the
172
+ // pick point on screen. Avoids unnecessary draw calls.
173
+ if (isPicking && cullRect && tile.content?.cartographicOrigin) {
174
+ const [sx, sy] = viewport.project(tile.content.cartographicOrigin);
175
+ const cx = cullRect.x + cullRect.width / 2;
176
+ const cy = cullRect.y + cullRect.height / 2;
177
+ const threshold = Math.max(viewport.width, viewport.height) / 4;
178
+ const dx = sx - cx;
179
+ const dy = sy - cy;
180
+ if (dx * dx + dy * dy > threshold * threshold) {
181
+ return false;
182
+ }
183
+ }
184
+
185
+ return true;
168
186
  }
169
187
 
170
188
  protected _updateAutoHighlight(info: PickingInfo): void {