1. Home >
  2. Documentation >
  3. Misc >
  4. autofit
 

autofit

This function extends map bounds to contain each overlay added (markers, circle ...)

Usage

Parameters

  • None

Notice

This function is not and auto-zoom, it loop on each overlay previously added to extend a google.maps.LatLngBounds and then fit the map on it thanks to the google.maps.Map.fitBounds function.

Example

Because this function doesn't take any options, the object can be reduce into a string

$('#test').gmap3(
  { circle:{
      options: {
        center: [37.772323, -122.214897],
        radius : 2500000,
        fillColor : "#008BB2",
        strokeColor : "#005BB7"
      }
    },
    autofit:{}
  }
);
$('#test').gmap3(
  { circle:{
      options: {
        center: [37.772323, -122.214897],
        radius : 2500000,
        fillColor : "#008BB2",
        strokeColor : "#005BB7"
      }
    }
  },
  "autofit"
);
Close