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

GoogleMapsOverlay support non-interleaved mode for vector maps #6804

Merged
merged 6 commits into from
Apr 7, 2022

Conversation

felixpalmer
Copy link
Collaborator

For #6296

Background

Change List

  • Add interleaved prop to GoogleMapsOverlay (default false to provide back-compatibility)
  • Implement rendering path for vector maps on separate overlaid canvas
  • Test updates

@coveralls
Copy link

coveralls commented Apr 5, 2022

Coverage Status

Coverage decreased (-0.03%) to 81.937% when pulling e0963e6 on felix/google-vector-interleaved into 1e65c97 on master.

@zakjan
Copy link
Contributor

zakjan commented Apr 5, 2022

Thanks, I can confirm this works.

pointerEvents: 'none' is unfortunate (because it prevents mouse events and tooltips from working), but it's in the Mapbox overlay as well, so I guess it's acceptable

@felixpalmer
Copy link
Collaborator Author

Thanks, I can confirm this works.

pointerEvents: 'none' is unfortunate (because it prevents mouse events and tooltips from working), but it's in the Mapbox overlay as well, so I guess it's acceptable

I tested it and mouse events do work, as we proxy them:

function handleMouseEvent(deck, type, event) {
const mockEvent = {
type,
offsetCenter: getEventPixel(event, deck),
srcEvent: event
};
switch (type) {
case 'click':
// Hack: because we do not listen to pointer down, perform picking now
deck._lastPointerDownInfo = deck.pickObject({
...mockEvent.offsetCenter,
radius: deck.props.pickingRadius
});
mockEvent.tapCount = 1;
deck._onEvent(mockEvent);
break;
case 'dblclick':
mockEvent.type = 'click';
mockEvent.tapCount = 2;
deck._onEvent(mockEvent);
break;
case 'mousemove':
mockEvent.type = 'pointermove';
deck._onPointerMove(mockEvent);
break;
case 'mouseout':
mockEvent.type = 'pointerleave';
deck._onPointerMove(mockEvent);
break;
default:
return;
}
}

Did you come across something that was broken?

@zakjan
Copy link
Contributor

zakjan commented Apr 7, 2022

Did you come across something that was broken?

Ok, sorry my mistake, the canvas I tested it with was overlayed by another element. Events works 👍

@felixpalmer felixpalmer merged commit 1cf1eb0 into master Apr 7, 2022
@felixpalmer felixpalmer deleted the felix/google-vector-interleaved branch April 7, 2022 16:49
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.

4 participants