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

[Bug] GoogleMapsOverlay is missing the right click event #7661

Closed
1 of 6 tasks
digitalkoicodes opened this issue Feb 18, 2023 · 4 comments
Closed
1 of 6 tasks

[Bug] GoogleMapsOverlay is missing the right click event #7661

digitalkoicodes opened this issue Feb 18, 2023 · 4 comments
Labels

Comments

@digitalkoicodes
Copy link

Description

When using the Icon layer on google maps, right click events do not happen

Flavors

  • React
  • Python/Jupyter notebook
  • MapboxLayer
  • GoogleMapsOverlay
  • CartoLayer
  • DeckLayer/DeckRenderer for ArcGIS

Expected Behavior

onClick to emit with right clicks having rightButton = true in the event

Steps to Reproduce

Here's an example codepen:

https://codepen.io/mjtworks/pen/abwNJVW

The event should happen with right or left click

Environment

  • Framework version: 8.8.21

Logs

No response

@Pessimistress
Copy link
Collaborator

@felixpalmer I think we may be able use addDomListener instead of map's own events

@felixpalmer
Copy link
Collaborator

There is a rightclick event, we just ignore it. The button pressed can be obtained via event.srcEvent.domEvent.button

@Pessimistress
Copy link
Collaborator

Fixed in v8.9.3.

@moonbe77
Copy link

moonbe77 commented Aug 27, 2024

I'm using GoogleMapsOverlay with TS and i can't get around that ts error

import { GoogleMapsOverlay } from '@deck.gl/google-maps'
	overlay.setProps({
			// useDevicePixels: true,
			onClick: (layer, event) => {
				const isRightClick = event.srcEvent.domEvent.button === 2  // Property 'domEvent' does not exist on   type 'TouchEvent | MouseEvent | PointerEvent'.  Property 'domEvent' does not exist on type 'TouchEvent'.ts(2339)}

any suggestion on how to get the correct type for the onClick > event, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants