/// <summary> /// Method that is called when you press the map. /// </summary> protected void OnMapBasePress() { isMapPress = false; if (waitZeroTouches) { if (GetTouchCount() <= 1) { waitZeroTouches = false; } else { return; } } dragMarker = null; if (!HitTest()) { return; } #if !IGUI && ((!UNITY_ANDROID && !UNITY_IOS) || UNITY_EDITOR) if (map.notInteractUnderGUI && GUIUtility.hotControl != 0) { return; } #endif Vector2 inputPosition = GetInputPosition(); if (EventSystem.current != null) { PointerEventData pe = new PointerEventData(EventSystem.current); pe.position = inputPosition; List <RaycastResult> hits = new List <RaycastResult>(); EventSystem.current.RaycastAll(pe, hits); if (hits.Count > 0 && hits[0].gameObject != gameObject) { return; } } if (OnMapPress != null) { OnMapPress(); } lastClickTimes[0] = lastClickTimes[1]; lastClickTimes[1] = DateTime.Now.Ticks; bool hit = GetCoords(out lastPositionLng, out lastPositionLat); lastInputPosition = pressPoint = inputPosition; if (!hit) { return; } isMapPress = true; 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); } bool allowMapLongPress = true; if (marker != null) { if (marker.OnPress != null) { marker.OnPress(marker); } if (marker.OnLongPress != null) { allowMapLongPress = false; } if (map.showMarkerTooltip == OnlineMapsShowMarkerTooltip.onPress) { map.tooltipMarker = marker; map.tooltip = marker.label; } if (Input.GetKey(KeyCode.LeftControl)) { dragMarker = marker; } } else { OnlineMapsDrawingElement drawingElement = map.GetDrawingElement(inputPosition); if (drawingElement != null) { if (drawingElement.OnPress != null) { drawingElement.OnPress(drawingElement); } if (map.showMarkerTooltip == OnlineMapsShowMarkerTooltip.onPress) { map.tooltipDrawingElement = drawingElement; map.tooltip = drawingElement.tooltip; } } } if (dragMarker == null) { isMapDrag = true; if (allowMapLongPress) { longPressEnumenator = WaitLongPress(); StartCoroutine("WaitLongPress"); } } else { lastClickTimes[0] = 0; } if (allowUserControl) { OnlineMaps.isUserControl = true; } }