How can I show the popup on bottom middle of the page when clicking MapboxGL marker? - mapbox

I want to show a popup on the bottom middle of the page when clicking a marker.
I have used the following code
new mapboxgl.Popup({ anchor: 'top' })
This shows popup on the bottom of the marker. But I want to show the popup at the bottom middle of the page

Popups are more for attaching to the map at some lat/lng, if you want to trigger something to show/hide based on a click, I would create a separate div then show/hide it appropriately and set the text of it as needed.
map.on('click', 'mylayer', function (e) {
// show or hide your div
// feature that was clicked would be e.features[0]
} );
For the "show or hide your div" part, you could reference:
How can I hide/show a div when a button is clicked?

Related

Material UI Tooltip title text content has a button that opens a dialog, dialog disappear after opening

I am trying to use the tooltip which has a title text content, say:
title={<>
Some text
<Button onClick={onOpen}>Click Me!</Button>
</>}
and that button's onClick will set the state to open a mui dialog, i've also set the Tooltip's interactive prop to be true. When the button inside the Tooltip's title content is click, the dialog pops up briefly then goes away. I believe that is also due to Tooltip fading away using the interactive prop.
Is there anyway to get the dialog to stay meanwhile having the tooltip title content disappear? Is material ui's tooltip component meant to be use this way?
Thanks for the help.

showing popupMenu menu on top of everything else

I am trying to create a popup menu that can be shown on top of all the other widgets I have on the screen, not something like the dialog but, I need the menu to show on top of a bottom panel of a sliding panel widget.
right now it shows underneath it and clearly is the right beaver from a code perspective, but from a UI perspective that is not good and it does hide some menu options rendering them unTappable, here is pic (a third option in the menu is being blocked) :
The menu is spawn from the three dots and is positioned exactly on top of them, it usually has 3 options. Right now, since the red bar on the bottom is a slide panel, it is positioned on top of everything and can be slides up from any page, only 2 options appear. my question is how do I make the menu go on top of the red bar, or at least maybe make it open upward instead of downward like it does here.
To make widget at the top of everything you can use Overlay, but I am not sure it is the best solution for you
I found how to do it.
The trick is to use the rootNavigation. rootNavigation is available on the showMenu method.
var Choice = await showMenu<ContextMenuOptions>(context: context, position: position,
items: items, useRootNavigator: true);

How can I change the + icon position when using material table editable feature

In material-table row can be added by clicking on + icon on top right corner. I want to replace that icon at the bottom of the screen as a button "ADD". But material-table accept the icon object and there is not other prop to do it. Is there any way I can do it? I am using material-table editable feature https://material-table.com/#/docs/features/editable

How to keep a popup visible if show popup is on hover, not click. It hides as soon as you leave the marker

I am using clustering, and when the mouse hovers over one cluster it shows a popup.
The user needs to click on a link on that popup.
But as soon as the mouse leaves the marker, the popup closes.
What's an easy way to do this?
I've read and found there is this mousemove event, but i'm afraid that will be triggered many times and slow things down.
map.on('mousein ', 'clusters', function (e) {
var coordinates = e.features[0].geometry.coordinates.slice();
var id = e.features[0].id;
map.getSource('users').getClusterLeaves(id, 50, 0, function(error, features){
const html = features
new mapboxgl.Popup()
.setLngLat(coordinates)
.setHTML(html)
.addTo(map);
})
});
Right now, it hides the popup as soon as you leave the marker.
I want the popup to be shown if user hover over marker and corresponding popup.

Enable element on click event when ionic loading show

I want to make menu button at the top left corner in my app can be clicked when ionic loading show, I have move back drop margin to make menu button not overlapped by ionic loading backdrop, here is my code :
.backdrop {
margin-top:50px;
}
.loading {
pointer-events:auto;
}
Here is one of my code to call ionic loading in app.js :
$ionicLoading.show({
template: 'Loading Data'
});
I have also set pointer-events to auto, but my button menu can't be clicked, anybody can help ?