bounds viewport

MA | Maine | Main st | 1 Main st | USA | Europe


was introduced in v3.28 Feb 2010

It constructs a rectangular instance of Polygon. 'bounds' option defines the position and dimensions.

V3 geocoder returns geometry.viewport and geometry.bounds as LatLngBounds objects. Targets without bounds, like street numbers, return geometry.viewport only. Rectangle is used for visualizing those.


Clear Map button triggers following script:
All the polygons are pushed to overlays array. There could be markers too.

pop() method returns the last element of an array. It also removes that from the array. So that while-loop removes the overlays both from the map and from the array.



More experiments