I found an unexpected behavior related with the Mapbox GL JS popup feature identifications.
I'm using the following event:
map.on('click', this._showPopup(e));
but when I make a double click and the zoom in is made, the popup is shown and close several times.
Is there any way to prevent this behavior?
A quick fix you can do is to disable doubleClickZoom mapbox options.
https://docs.mapbox.com/mapbox-gl-js/api/#map#doubleclickzoom
Related
I'm a working on a project with leaflet where a it shows three layer
you can enable o disable whenever you want to display all the markers from that layer.
Every marker has a popup that it opens when you click on the marker
The problema i have is that when you hit over on any layer and active it, the marker displays its popup.
Is there any way to not open it when you activate a layer? o at least to keep it close and just open when you click on it?
Thanks colleagues!
I revised the solution to instead target layer activation.
This will programmatically unbind popup from each marker in the layer, hence preventing popups from opening when layer is activated.
var layerGroup = L.layerGroup().addTo(map);
layerGroup.on("layeradd", function (event) {
event.layer.eachLayer(function (marker) {
marker.unbindPopup();
});
});
I use Charts framework to draw charts in MacOS application. I have CombinedChartView with candleData. When I click by mouse a candle, chartValueSelected executed and I can receive information about selected candle. I need to do the same using UIHoverGestureRecognizer instead of mouse click. How to get information about a chartValue that mouse is hover?
The only one way I found is to add UIHoverGestureRecognizer to BarLineChartViewBase.swift
I'd like to be able to trigger a mouse click event on this: https://www.fusioncharts.com/dev/fusiontime/fusiontime-component/time-marker so that the tooltip does not close.
Is there anyway to do this?
As of now FusionCharts do not have support for triggering timeMarkerClick or timeMarkerRollover event to keep the tool-tip of the time marker open without any actual timeMarkerClick or timeMarkerRollover action over it.
Hope this would help.
Is there a way to make a leaflet.js popup show up at specific zoom levels please, for example when map.getZoom() > 6 only. Hiding the popup or even setting its opacity to zero could also be viable options.
Thanks
Use the method/event handler map.on('zoomend') (https://leafletjs.com/reference-1.4.0.html#map-zoomend) to detect whenever the map finishes zooming. Then check the zoom value do see if you want to show the popup or not.
map.on('zoomend', function(){
if(map.getZoom() > 6){
showPopup();//your function here
}
});
I'm trying to bind a function to a anchor tag link inside a leaflet pop-up but it seems like you cant do this with leaflet. I would like to bind a on-click function to an ID or CLASS which opens a jquery dialog / modal with more information.
Is there an alternative solution to this?
Thanks!
Read the documentation for $.on: since Leaflet's popups are only created when a user clicks on a feature, you can't bind events on their contents off the bat, since they don't exist yet. If you use .on with a selector, you can bind to the event whenever it happens.