Rank-based estimation under asymptotic dependence and independence, with applications to spatial extremes