Exemple #1
0
        public void Drag(GPoint pt)
        {
            renderOffset.X = pt.X - dragPoint.X;
            renderOffset.Y = pt.Y - dragPoint.Y;

            UpdateCenterTileXYLocation();

            if (centerTileXYLocation != centerTileXYLocationLast)
            {
                centerTileXYLocationLast = centerTileXYLocation;
                UpdateBounds();
            }

            if (IsDragging)
            {
                LastLocationInBounds = Position;
                Position             = FromLocalToLatLng((int)Width / 2, (int)Height / 2);

                OnMapDrag?.Invoke();
            }
        }
Exemple #2
0
        /// <summary>
        /// darg map by offset in pixels
        /// </summary>
        /// <param name="offset"></param>
        public void DragOffset(GPoint offset)
        {
            renderOffset.Offset(offset);

            UpdateCenterTileXYLocation();

            if (centerTileXYLocation != centerTileXYLocationLast)
            {
                centerTileXYLocationLast = centerTileXYLocation;
                UpdateBounds();
            }

            {
                LastLocationInBounds = Position;

                IsDragging = true;
                Position   = FromLocalToLatLng((int)Width / 2, (int)Height / 2);
                IsDragging = false;
            }

            OnMapDrag?.Invoke();
        }