How to disable map events for elements in the DOM? - leaflet

The map has some default events, like when you use the scroll wheel on your mouse the map will zoom in and out.
I would like to know how to disable this behavior for certain elements in the DOM?
For example, using the mouse scroll wheel on top of the layers element. This does not trigger the map zoom event.
I want to replicate this behavior for a custom div element I have created. Currently when you hover the mouse on top of the element and use the mouse wheel it will zoom the map in and out.
The purpose of this is to allow for mouse scrolling on a div on top of the map which has an overflow scroll property on it.
I tried inspecting the layer element to see what is causing the map events to be disabled here.

Related

How to use Flutter's InteractiveViewer in a way that it doesn't hijack all the gesture input?

I'm creating some kind of image editor (kinda like Canva). For zooming in, out, and panning, I use InteractiveViewer. But the thing is, once I start using InteractiveViewer, I noticed that my other gestures for the elements inside the canvas (e.g. tap and drag on an element should drag the element around) are not working. Tapping and dragging now become panning the whole canvas.
This is still the case even if I turn off panning and scaling (panEnabled: false, scaleEnabled: false). Thankfully single tap is still working because InteractiveViewer does not use that, but I need the entire gesture input when the user makes input that's not intended for the InteractiveViewer. For example, if the user taps on an element so it becomes selected, then all the gesture input should go to the tapped element instead of to InteractiveViewer.
I once thought of a solution to just simply not using InteractiveViewer when there's an element selected, but that causes the user to immediately lose the zoom and pan previously set before. I need solution so that the InteractiveViewer can preserves the zoom and pan setting while letting all the gesture input goes through to the elements inside. How can I do that?

Place gui elements below thumbstick in roblox

The thumbstick on lower left controls player movement in roblox for touch enabled devices. I would like to place some gui elements in that same corner (under the thumbstick) which are just for display like frames or text labels (not buttons or input elements). Its a good place in my opinion to put things that the player might want to glance at occasionally but not interact with directly.
When I place these elements it blocks the normal thumbstick behavior. The thumbstick is drawn on top of the gui elements like I want but I cant click the part of the thumbstick that is on top of other gui elements. When I inspect an active game I can see the thumbstick is at z index 1 and I put my gui elements at zindex -1 so really not sure why its blocking things.
NM found the elements were marked selectable and active. I disabled those thumbstick works now.

Manage gestures priority between two widgets

I'm experimenting using the google maps for flutter plugin but I'm running into a problem managing the gesture priority.
My map, which need to handle gestures is rendered inside a PageView which also listen to some gestures. The thing is, It appears that the gesture handler of PageView take the priority over the map one, so if I drag vertically on the map, the map move but if I drag horizontally on the map, the page will switch instead of the map moving.
Is there a way to manage the priority between gesture handlers of widget to fix this sort of problems?

Pixelwise scrolling for LO/OO Writer

In LO/OO Writer vertical scrolling can be done e.g. by moving the text cursor up/down, using the mouse wheel, clicking the up/down arrows on the vertical scrolling bar, etc.
Touch scrolling (on touch screens) is not supported, unfortunately. Therefore I wrote a tool (in Autohotkey) which enables touch scrolling. It is working fine, but the scrolling is not as smooth as in other programs supporting touch scrolling: the content of the window is moved in steps of approx. one line.
In my tool I am using the best 'control' for scrolling I could find: touch point movements are remapped to clicks on the up/down arrows on the vertical scrolling bar.
MY QUESTION: Is there (could there be) another 'control' in LO/OO Writer which would allow smoother (pixelwise) scrolling of the displayed content?
Thank you very much in advance for your answers! (Please only answers referring to LO/OO Writer.)
Clicking and dragging the scrollbar allows higher granularity than the up/down arrows. The scroll amount adjusts if the document is zoomed in.
On the downside, using the scrollbar is much more difficult than a simple click on the arrows. There is a discussion at https://autohotkey.com/board/topic/51041-click-drag-scrollbars/.
If it is a touch screen, perhaps you could require the user to touch the scrollbar, so the touch location would give the vertical position of the scrollbar. Then use MouseClickDrag starting from that position.

disabling 'grab' panning for bing maps control

How do I disable just the grab aspect of panning for bing maps AJAX control 7.0?
I have tried this -
var map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), { credentials: "bing maps credentials", mapTypeId: Microsoft.Maps.MapTypeId.road, disablePanning: true});
But setting the disablePanning property in the map options not only disables grab panning but also zoom panning. Zoom becomes not completely disabled but instead will only zoom in and out on the center of the map. No doubt you will have come accross zoom panning where you can use the mouse scroll wheel to zoom in on the map under the cursor and therefore can pan around by zooming in and out and moving the cursor. I would like to have zoom panning enabled but grab panning (where the user depresses the mouse and drags it around) to be disabled.
I am aiming for functionality very similar to when using the my places editor on the main bing maps site. When using the polyline tool to draw on the map grab panning is disabled and zoom panning is enabled just as I would like. I am actually intending on creating a custom drawing tool similar to the polyline tool in the my places editor.
I have been studying the api but have not discovered how to do it yet. I have also tried to discover how it is done on the main bing maps site but as the javascript code is all minified I am finding it very difficult. I have managed to gleen that the polyline tool hijacks the mouse, but that is about all.
Surely there must be a simple way of doing this. How is it done?
I don't think there is a map option you can set to achieve the behavior you want(enable zoom panning/disable grab panning). However, there is an easy way to hack it. The panning is initiated by the user clicking down on the map and moving the mouse. So if you can supply your own mousedown event handler for the map, and in its implementation prevent the default behavior of the mousedown, you should be good to go. Turns out the handled property on MouseEventArgs does just this:
Microsoft.Maps.Events.addHandler(yourMapObj, 'mousedown', function (mouseEvent) {
mouseEvent.handled = true; //A boolean indicating whether the event is handled. If this property is set to true, the default map control behavior for the event is cancelled.
});
With this, mousedown events on the map are processed by you and ignored by the map. So when the user tries to pan the map using the mouse, nothing happens. They can still click and zoom around as usual. Keep in mind if you have other elements on the map such as pushpins and shapes, this will prevent the mousedown event from reaching them. So any mousedown event handlers you registered on them will not get called. You can handle this either by unregistering the above handler when you want the other mousedown events to be called(preferable), or interogate the target property on your MouseEventArgs to see what fired the mousedown(messy).