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(); } }
/// <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(); }