I'm trying to find a way to center and zoom to a country using Mapbox. I am able to get a country its coordinates using the geocoder, however, the zoom levels differ per country. (E.g. the zoom level for Spain is not the same level for the U.S.A.)
function showMap(err, data) {
console.log(data);
console.log(err);
if (err == true) {
console.log("Couldn't find this place!");
} else {
map.fitBounds(data.lbounds);
}
}
var geocoder = L.mapbox.geocoder('x',map);
geocoder.query("Spain", showMap);
Would I need an additional layer with fusion tables to achieve this?
Thanks for any help!