only show tooltip on desktop
This commit is contained in:
@ -926,6 +926,10 @@
|
|||||||
clearNodeOutline();
|
clearNodeOutline();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function isMobile() {
|
||||||
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
||||||
|
}
|
||||||
|
|
||||||
function isValidLatLng(lat, lng) {
|
function isValidLatLng(lat, lng) {
|
||||||
|
|
||||||
if(isNaN(lat) || isNaN(lng)){
|
if(isNaN(lat) || isNaN(lng)){
|
||||||
@ -1176,11 +1180,7 @@
|
|||||||
var marker = L.marker([node.latitude, node.longitude], {
|
var marker = L.marker([node.latitude, node.longitude], {
|
||||||
icon: icon,
|
icon: icon,
|
||||||
tagName: node.node_id,
|
tagName: node.node_id,
|
||||||
})
|
}).on('click', function(event) {
|
||||||
.bindTooltip(tooltip, {
|
|
||||||
interactive: true,
|
|
||||||
})
|
|
||||||
.on('click', function(event) {
|
|
||||||
// close tooltip on click to prevent tooltip and popup showing at same time
|
// close tooltip on click to prevent tooltip and popup showing at same time
|
||||||
event.target.closeTooltip();
|
event.target.closeTooltip();
|
||||||
});
|
});
|
||||||
@ -1189,6 +1189,13 @@
|
|||||||
marker.addTo(nodesLayerGroup);
|
marker.addTo(nodesLayerGroup);
|
||||||
nodesClusteredLayerGroup.addLayer(marker);
|
nodesClusteredLayerGroup.addLayer(marker);
|
||||||
|
|
||||||
|
// show tooltip on desktop only
|
||||||
|
if(!isMobile()){
|
||||||
|
marker.bindTooltip(tooltip, {
|
||||||
|
interactive: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// show node info sidebar when clicking node marker
|
// show node info sidebar when clicking node marker
|
||||||
marker.on("click", function(event) {
|
marker.on("click", function(event) {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user