question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] Full control over blocking click, drag and zoom

See original GitHub issue

Right now you can add classes to markers no prevent clicking and dragging over them but this insufficient for my use case. I have two cases where I need to set globally if the map should be clickable, draggable and zoomable. The first one is when the map has an overlay over it, something like a modal or popup. The second use case is displaying static but dynamic-generated maps.

@mariusandra would you mind adding these 3 props to the API? I’ll come up with a PR for this ASAP if so.

I’m thinking about using something like

<Map
  blockClick={true}
  blockDrag={true}
  blockZoom={true}
/>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mariusandracommented, Feb 7, 2017

Hey, in my example all those flags would be true by default and it would be up to the user to set them to false to disable them. So nothing breaks with the current API.

I think clickable={false} reads better than blockClick={true}, but of course just <Map blockClick /> is clear as well. The problem comes when you have a dynamic variable setting the state, as in: <Map blockClick={!clicksEnabled} />. In that case it becomes hard to intuitively grasp the code due to the double negative.

Looking at what others (google maps, leaflet) do, it appears the convention is to specify things like scrollWheel: true, draggable: true, keyboard: true, touchZoom: true, etc.

So I would go for this way.

0reactions
lucasavila00commented, Feb 21, 2017

I’m sorry for the delay. I ended up getting lost on this and using a transparent overlay over the map solves the issue. If this is requested by more use cases then I’ll work on a pr. I’m closing this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Requesting or giving remote control - Zoom Support
The remote control feature allows you to take control of another participant's screen in a meeting when they've given you permission.
Read more >
Participant controls in a meeting - Zoom Support
You can drag the minimized window around your screen as needed. When you are ready to maximize the meeting window again, click the...
Read more >
Using host and co-host controls in a meeting - Zoom Support
Host controls allow you as the host to control various aspects of a Zoom meeting, such as managing the participants. The co-host feature......
Read more >
Adjusting your video layout during a virtual meeting
Other video layout controls include rearranging the gallery view order ... return to the full Zoom window click the arrow on the right...
Read more >
Controlling slides shared by another participant - Zoom Support
On the sharing toolbar, click Slide Control . Note: This option will only be available when you are in full-screen presentation mode. Select...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found