/// <summary>
    /// Method that is called when you release the map.
    /// </summary>
    protected void OnMapBaseRelease()
    {
        if (waitZeroTouches && GetTouchCount() == 0)
        {
            waitZeroTouches = false;
        }
        if (GUIUtility.hotControl != 0)
        {
            return;
        }

        Vector2 inputPosition = GetInputPosition();
        bool    isClick       = (pressPoint - inputPosition).sqrMagnitude < 400;

        isMapDrag      = false;
        mapDragStarted = false;
        dragMarker     = null;

        if (longPressEnumenator != null)
        {
            StopCoroutine("WaitLongPress");
            longPressEnumenator = null;
        }

        lastInputPosition        = Vector2.zero;
        OnlineMaps.isUserControl = false;

        if (!isMapPress)
        {
            return;
        }
        isMapPress = false;
        if (OnMapRelease != null)
        {
            OnMapRelease();
        }

        OnlineMapsMarker marker = null;

        if (this is OnlineMapsControlBase3D &&
            OnlineMapsControlBase3D.instance.marker2DMode == OnlineMapsMarker2DMode.billboard)
        {
            OnlineMapsMarkerInstanceBase instanceBase = OnlineMapsControlBase3D.instance.GetBillboardMarkerFromScreen(inputPosition);
            if (instanceBase != null)
            {
                marker = instanceBase.marker as OnlineMapsMarker;
            }
        }
        else
        {
            marker = map.GetMarkerFromScreen(inputPosition);
        }

        OnlineMapsDrawingElement drawingElement = null;

        if (map.showMarkerTooltip == OnlineMapsShowMarkerTooltip.onPress && (map.tooltipMarker != null || map.tooltipDrawingElement != null))
        {
            map.tooltipMarker         = null;
            map.tooltipDrawingElement = null;
            map.tooltip = null;
        }

        if (marker != null)
        {
            if (marker.OnRelease != null)
            {
                marker.OnRelease(marker);
            }
            if (isClick && marker.OnClick != null)
            {
                marker.OnClick(marker);
            }
        }
        else
        {
            drawingElement = map.GetDrawingElement(inputPosition);
            if (drawingElement != null && drawingElement.OnRelease != null)
            {
                drawingElement.OnRelease(drawingElement);
            }
        }

        if (isClick && DateTime.Now.Ticks - lastClickTimes[0] < 5000000)
        {
            if (marker != null && marker.OnDoubleClick != null)
            {
                marker.OnDoubleClick(marker);
            }
            else if (drawingElement != null && drawingElement.OnDoubleClick != null)
            {
                drawingElement.OnDoubleClick(drawingElement);
            }
            else
            {
                if (OnMapDoubleClick != null)
                {
                    OnMapDoubleClick();
                }

                if (allowZoom && zoomInOnDoubleClick)
                {
                    ZoomOnPoint(1, inputPosition);
                }
            }

            lastClickTimes[0] = 0;
            lastClickTimes[1] = 0;
        }
        else if (isClick)
        {
            if (drawingElement != null && drawingElement.OnClick != null)
            {
                drawingElement.OnClick(drawingElement);
            }
            if (OnMapClick != null)
            {
                OnMapClick();
            }
        }

        if (map.bufferStatus == OnlineMapsBufferStatus.wait)
        {
            map.needRedraw = true;
        }
    }