You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I customize the javascript adding the following options:
disable mouse scrolling only for iframe map if (window !== window.parent){ }
use the ctrl to scroll (like google) if (event.type==='mousewheel' && event.ctrlKey === false){}
add modal to explain how to use the scroll
function testConfirm() {
var $dialog = $('<div></div>')
.html("EXPLICATION HOW TO USE SCROLL") //need to be translated
.dialog({
resizable: false,
title: "Nota bene",
modal: true,
buttons: {
/*Cancel: function() {
$(this).dialog("close");
},*/
"Close": function() {
//some stuff
$(this).dialog("close");
}
}
});
$dialog.dialog('open');
}
lizMap.events.on({
uicreated: function(e) {
$('#map').bind('mousewheel', function(event){
//se sono in un iframe window.frameElement è != null quindi entro qua dentro, altrimenti no e la mappa si comporta come al solito
//if (window.frameElement){
if (window !== window.parent){
if (event.type==='mousewheel' && event.ctrlKey === false){
//console.log(window.frameElement);
console.log('window');
console.log(window);
console.log('window.parent');
console.log(window.parent);
console.log(event.type);
//console.log(mouseWheelZoom);
//$('#map').popover('show');
testConfirm();
//alert('Per lo scroll sulla pagina effettuare lo scroll al di fuori della mappa, per effettuare lo zoom della mappa tenere premuto il tasto CTRL');
return false;
//return platformModifierKeyOnly(event);
} else
//if(event.ctrlKey === true)
{
console.log(event.originalEvent.detail);
//event.preventDefault();
if(event.originalEvent.detail > 0) {
console.log('OK');
alert('Per lo zoom tenere premuto il tasto CTRL');
return false;
}else {
console.log('Up');
//return alert('Per lo zoom tenere premuto il tasto CTRL');
}
return true;
}
} // fine check iframe
});
}
});
I hope it can be useful for further integration in the main code. Let me know if I can do more.
Hi,
As suggered by @mdouchin it could be interesting to add an option for disable mouse scrolling on map in lizmap plugin.
Actually I'm using this JS code in repo.
The text was updated successfully, but these errors were encountered: