public BitmapSize?GetOffsetFromCoordinates(MapPoint coordinates) { BitmapTile targetTile = _collection.FirstOrDefault(tile => tile.ContainsCoordinates(coordinates)); if (targetTile == null) { return(null); } BitmapRect bounds = GetSquareBitmapBounds(targetTile.Tile); BitmapSize tileOffset = targetTile.GetOffsetFromCoordinates(coordinates, _totalSize, _zoom); return(new BitmapSize(bounds.Left + tileOffset.Width, bounds.Top + tileOffset.Height)); //return targetTile == null ? null : (BitmapSize?)targetTile.GetOffsetFromCoordinates(coordinates, _totalSize, _zoom); }
private bool CheckBoundsIntersect(BitmapRect bounds) { return(bounds.Top + bounds.Height >= 0 && bounds.Top <= _totalSize.Height && bounds.Left + bounds.Width >= 0 && bounds.Left <= _totalSize.Width); }
public BitmapTile(MapTile tile, BitmapRect bounds) { _tile = tile; _square = tile.GetActualSquare(); _bounds = bounds; }