nsw.rezexpert.com - Unable to zoom out the map
Categories
(Web Compatibility :: Site Reports, defect, P3)
Tracking
(Webcompat Priority:P3, Webcompat Score:4)
People
(Reporter: railioaie, Unassigned)
References
()
Details
(Keywords: webcompat:platform-bug, webcompat:site-report, Whiteboard: [webcompat-source:web-bugs])
User Story
platform:android impact:workflow-broken configuration:general affects:all branch:release diagnosis-team:dom user-impact-score:80
Environment:
Operating system: Android 14
Firefox version: Firefox Mobile 136.0
Preconditions:
Clean profile
Steps to reproduce:
- Navigate to: https://nsw.rezexpert.com/book?business_code=500594
- Zoom in / out the map
Expected Behavior:
The map is responding as expected
Actual Behavior:
Unable to zoom out the map
Notes:
- Reproduces regardless of the status of ETP
- Reproduces in firefox-nightly, and firefox-release
- Does not reproduce in chrome
Created from https://github.com/webcompat/web-bugs/issues/149852
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Repeated exceptions when pinch-to-zoom happens: Uncaught ReferenceError: fNewCenter is not defined, but the same exceptions happen on Chrome and it does not prevent the proper zooming, so it's a red herring here.
The zoom logic is in https://nsw.rezexpert.com/s2files/phpinclude/combinefiles.php?bid=501670&p=book&rwitid=1&lv=0&bdv=1&bcv=1&scv=0&sccv=0&ms=1&md=1
oStage.getContent().addEventListener(
'touchmove',
function (p_eEvent) {
var oTouch1 = p_eEvent.touches[0];
var oTouch2 = p_eEvent.touches[1];
if (oTouch1 && oTouch2) {
m_iTouchEventCount++;
p_eEvent.preventDefault();
var fDistance;
var fScale;
var p1 = {
x: oTouch1.clientX,
y: oTouch1.clientY,
};
var p2 = {
x: oTouch2.clientX,
y: oTouch2.clientY,
};
fDistance = fnGetDistance(p1, p2);
if (!m_fLastDistance) m_fLastDistance = fDistance;
var iValue = 0;
if (m_fLastDistance > fDistance) {
iValue = parseInt( - 1) * mc_iMapScaleInterval;
} else {
iValue = mc_iMapScaleInterval;
}
if (parseInt(m_iTouchEventCount) == 1) fnGlobal_adjustMapScale(iValue, false, null);
else m_iTouchEventCount = 0;
m_fLastDistance = fDistance;
m_fLastCenter = fNewCenter;
} else {
m_iTouchEventCount = 0;
if (m_bMapMouseDrag) {
p_eEvent.preventDefault();
var iPrevScrollLeft = divMap.scrollLeft();
var iPrevScrollTop = divMap.scrollTop();
divMap.scrollLeft(iPrevScrollLeft + (m_fMapX - oTouch1.clientX));
divMap.scrollTop(iPrevScrollTop + (m_fMapY - oTouch1.clientY));
var sMB = $('.sMB');
if (sMB.is(':visible')) {
if (parseInt(iPrevScrollLeft) != parseInt(divMap.scrollLeft())) sMB.css('left', sMB.position().left - (m_fMapX - oTouch1.clientX) + 'px');
if (parseInt(iPrevScrollTop) != parseInt(divMap.scrollTop())) sMB.css('top', sMB.position().top - (m_fMapY - oTouch1.clientY) + 'px');
}
m_fMapX = oTouch1.clientX;
m_fMapY = oTouch1.clientY;
}
}
},
false
);
Basically it remembers the last distance between two touch points, and decides to either zoom in or out by a fixed value mc_iMapScaleInterval. For some reason we get touch event twice with the same distance and timestamp, which confuses the script. I'm trying to get a minimal repro.
Comment 3•6 months ago
|
||
Revisiting,
Unfortunately the script doesn't zoom strictly based on the distance, but rather:
- Was the last distance farther than the current distance? then zoom out with a constant scale.
- If not, zoom in with constant scale.
Unfortunately this means having a same distance will cause zoom-in. A platform bug coming.
Updated•6 months ago
|
Updated•3 months ago
|
Comment 4•8 days ago
|
||
Now zooming in/out on the map works on a latest Fenix nightly. It's slow though.
Description
•