Zoom To Features

This example displays a map with 25 bounded random points, and one large square polygon. Below the map are two buttons for zooming the map to features on the map. Clicking the "Zoom To Polygon" button will zoom the map in to the closest level that will allow the entire square to remain in view. Clicking the "Zoom To All Features" button will zoom the map out the closest level that allows for all features on the vector layer to be visible.