private void Update()

in SupportingScripts/Runtime/Scripts/MapRenderer/Interaction/MapMouseInteractionHandler.cs [27:95]


        private void Update()
        {
            var mousePosition = Input.mousePosition;

            var zoomSpeed = 0.0f;
            if (IsPixelOverCamera(mousePosition) && !IsPointerOverGameObject())
            {
                zoomSpeed = 10 * _zoomSpeed * Input.GetAxis("Mouse ScrollWheel");
            }

            if (_isMouseDown && (_isInteracting || zoomSpeed > 0 || HasInitialPointMovedPastThreshold(mousePosition)))
            {
                // If this is the first frame of the interaction, invoke the interaction started event.
                if (!_isInteracting)
                {
                    _isInteracting = true;
                    MapInteractionController.OnInteractionStarted?.Invoke();
                }

                var ray = Camera.ScreenPointToRay(mousePosition);
                MapInteractionController.PanAndZoom(ray, _interactionTargetCoordinate, _interactionTargetAltitude, zoomSpeed);
            }
            else
            {
                // Zoom may still occur via the scroll wheel even if the mouse isn't down.
                if (zoomSpeed != 0)
                {
                    // If this is the first frame of the interaction, invoke the interaction started event.
                    if (!_isInteracting)
                    {
                        _isInteracting = true;
                        MapInteractionController.OnInteractionStarted?.Invoke();
                    }

                    var ray = Camera.ScreenPointToRay(mousePosition);
                    MapInteractionController.Zoom(zoomSpeed, ray, true);
                }
                else
                {
                    // There is no zoom interaction, so if this is the first frame of no interaction happening, invoke the interaction ended event.
                    if (_isInteracting)
                    {
                        _isInteracting = false;
                        MapInteractionController.OnInteractionEnded?.Invoke();
                    }
                }

                // If an interaction (i.e. a scroll wheel zoom) isn't occurring, check for tap and hold.
                if (!_isInteracting)
                {
                    if ((Time.time - _lastMouseDownTime) > TapAndHoldThresholdInSeconds)
                    {
                        var ray = Camera.ScreenPointToRay(mousePosition);
                        if (MapRenderer.Raycast(ray, out var hitInfo))
                        {
                            MapInteractionController.OnTapAndHold.Invoke(hitInfo.Location);
                            _lastMouseDownTime = float.MaxValue;
                        }
                    }
                }
            }

            if (_isInteracting)
            {
                // If we were panning or zooming the map, reset the last mouse up/down times used to track double tap and tap and hold.
                _lastMouseDownTime = float.MaxValue;
                _lastMouseUpTime = float.MinValue;
            }
        }