function [lonrange, latrange] = map_range(x, y)
lonrange = [min(x) max(x)];
latrange = [min(y) max(y)];
ymid = mean(latrange);
xmid = mean(lonrange);
xsc = cos(ymid * pi/180);
h = diff(latrange);
w = diff(lonrange)*xsc;
s = max([h w]);
h = max([h, s/2])*1.3;
w = max([w, s/2])*1.3;

lonrange = xmid + 0.5 * [-w, w] / xsc;
latrange = ymid + 0.5 * [-h, h];

latrange(1) = max([-80, latrange(1)]);
latrange(2) = min([80, latrange(2)]);
