I'm trying to fit my map to the largest bounds contained in several feature groups, however I'm having trouble getting the bounds of even one!
Here is my code;
map.fitBounds(group1); //Works fine
map.fitBounds(group2); //Works fine but overrules group1
so I planned to simply compare them all and keep the largest values and then do:
var maxN = -1;
var maxE = -1;
var maxW = -1;
var maxS = -1;
maxN = group1 .getBounds().min.x; //doesn't work
maxN = group1 .getBounds().getNorth().lat; //doesn't work
maxN = group1 .getBounds().__proto__.getNorth().lat; //doesn't work
//map.fitBounds(L.bounds(L.Point(maxN, maxW), L.Point(maxS, maxE)));
... but this is as far as I've gotten. I can't seem to use getBounds() of a feature group correctly. No matter what I try I can't get the lat/lngs to be returned. Can a more experienced user point me in the right direction? I'm having real trouble working my way to the variables from the leaflet documentation... I think I'm fundamentally misunderstanding something here.