Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(carto): Support picking with MVT tile-relative coordinates #8926

Merged

Conversation

donmccurdy
Copy link
Collaborator

Changes:

  • VectorTileLayer should override geometry only for binary tiles, not MVT tiles
  • Update test/modules/carto/layers/vector-tile-layer.spec.ts
  • Remove unused test/modules/carto/layers/carto-tile-layer.spec.ts

Related:

@coveralls
Copy link

coveralls commented May 28, 2024

Coverage Status

coverage: 89.903% (+0.006%) from 89.897%
when pulling b76cc26 on donmccurdy/fix-carto-vectortilelayer-getpickinginfo
into 303d1da on master.

@donmccurdy donmccurdy removed the request for review from padawannn May 29, 2024 15:17
@donmccurdy
Copy link
Collaborator Author

Let's hold this PR until next week, to get a review from @felixpalmer as well.

@@ -151,6 +151,12 @@ export default class VectorTileLayer<
getPickingInfo(params) {
const info = super.getPickingInfo(params);

// MVT tiles use tile-relative coordinates, handled by MVTLayer#getPickingInfo.
if (this.state.mvt) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this fixes the issue, I notice that it code path below will mean that binaryToGeojson is invoked twice. We could do better, either by invoking super.super.getPickingInfo here (https://stackoverflow.com/a/49056678) or modifying the MVTLayer to move isWGS84 to state and overriding it in VectorTileLayer. @donmccurdy could you give this a try in a follow-up PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, thanks! Opened a followup PR in #8932.

@donmccurdy donmccurdy force-pushed the donmccurdy/fix-carto-vectortilelayer-getpickinginfo branch from 49a78e7 to b76cc26 Compare June 3, 2024 20:32
@donmccurdy donmccurdy merged commit 12e837f into master Jun 3, 2024
4 checks passed
@donmccurdy donmccurdy deleted the donmccurdy/fix-carto-vectortilelayer-getpickinginfo branch June 3, 2024 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] The data is not being correctly converted back to GeoJSON in VectorTileLayer
4 participants