Understanding the effects of landscape heterogeneity on spatial genetic variation is a primary goal of landscape genetics. Ecological and geographic variables can contribute to genetic structure through geographic isolation, in which geographic barriers and distances restrict gene flow, and ecological isolation, in which gene flow among populations inhabiting different environments is limited by selection against dispersers moving between them. Although methods have been developed to study geographic isolation in detail, ecological isolation has received much less attention, partly because disentangling the effects of these mechanisms is inherently difficult. Here, I describe a novel approach for quantifying the effects of geographic and ecological isolation using multiple matrix regression with randomization. I explored the parameter space over which this method is effective using a series of individual-based simulations and found that it accurately describes the effects of geographic and ecological isolation over a wide range of conditions. I also applied this method to a set of real-world datasets to show that ecological isolation is an often overlooked but important contributor to patterns of spatial genetic variation and to demonstrate how this analysis can provide new insights into how landscapes contribute to the evolution of genetic variation in nature.