During adaptive evolutionary processes substantial heterogeneity in selective pressure might act across local habitats in sympatry. Examples are selection for drug resistance in malaria or herbicide resistance in weeds. In such setups standard population-genetic assumptions (homogeneous constant selection pressures, random mating etc.) are likely to be violated. To avoid misinferences on the strength and pattern of natural selection it is therefore necessary to adjust population-genetic theory to meet the specifics driving adaptive processes in particular organisms. We introduce a deterministic model in which selection acts heterogeneously on a population of haploid individuals across different patches over which the population randomly disperses every generation. A fixed proportion of individuals mates exclusively within patches, whereas the rest mates randomly across all patches. We study how the allele frequencies at neutral markers are affected by the spread of a beneficial mutation at a closely linked locus (genetic hitchhiking). We provide an analytical solution for the frequency change and the expected heterozygosity at the neutral locus after a single copy of a beneficial mutation became fixed. We furthermore provide approximations of these solutions which allow for more obvious interpretations. In addition, we validate the results by stochastic simulations. Our results show that the application of standard population-genetic theory is accurate as long as differences across selective environments are moderate. However, if selective differences are substantial, as for drug resistance in malaria, herbicide resistance in weeds, or insecticide resistance in agriculture, it is necessary to adapt available theory to the specifics of particular organisms.