I added dblclick
handler http://jsfiddle.net/yGaQM/2/:
this.map.on('dblclick', function (e) {
console.log(e);
// debugger;
});
And I found that e.containerPoint
which used for zoom have different values with different scrolling.
Look at L.DomEvent.getMousePosition
where calculated e.containerPoint
:
getMousePosition: function (e, container) {
var body = document.body,
docEl = document.documentElement,
x = e.pageX ? e.pageX : e.clientX + body.scrollLeft + docEl.scrollLeft,
y = e.pageY ? e.pageY : e.clientY + body.scrollTop + docEl.scrollTop,
pos = new L.Point(x, y);
return (container ? pos._subtract(L.DomUtil.getViewportOffset(container)) : pos);
}
So you can try check this method and replace it for your code to using e.clientX
and e.clientY
instead e.pageX
and e.pageY
: http://jsfiddle.net/yGaQM/3/.
I think this because leafled was not planned for fixed position usage. For example when you scroll page then map also will scrolled for normal mode (as example on http://leafletjs.com/). When you trying make it fixed map doesn't scrolled with page scroll (in your case) but scrolling still considered for position detection.