Closed Bug 1953164 Opened 1 year ago Closed 8 days ago

nsw.rezexpert.com - Unable to zoom out the map

Categories

(Web Compatibility :: Site Reports, defect, P3)

ARM
Android

Tracking

(Webcompat Priority:P3, Webcompat Score:4)

RESOLVED FIXED
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:

  1. Navigate to: https://nsw.rezexpert.com/book?business_code=500594
  2. 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

Webcompat Score: --- → 1
Severity: -- → S3
User Story: (updated)
Webcompat Priority: --- → P3
Webcompat Score: 1 → 3
Priority: -- → P3
Severity: S3 → S2
User Story: (updated)
Webcompat Score: 3 → 4

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.

Revisiting,

Unfortunately the script doesn't zoom strictly based on the distance, but rather:

  1. Was the last distance farther than the current distance? then zoom out with a constant scale.
  2. If not, zoom in with constant scale.

Unfortunately this means having a same distance will cause zoom-in. A platform bug coming.

User Story: (updated)
Webcompat Priority: P3 → P2
Webcompat Score: 4 → 6
User Story: (updated)
Webcompat Priority: P2 → P3
Webcompat Score: 6 → 4

Now zooming in/out on the map works on a latest Fenix nightly. It's slow though.

Status: NEW → RESOLVED
Closed: 8 days ago
User Story: (updated)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.