# bbox

type | Array ( GeoJSON bounding box )
default | [ -180, -85, 180, 85 ]

init

`

    $( selector ).geomap( { bbox: [ -71, 40, -69, 44 ] } );

`

get

`

    var bbox = $( selector ).geomap( "option", "bbox" );

`

set

`

    $( selector ).geomap( "option", "bbox", [ -122, 42, -118, 46 ] );

`

The bbox property calculates or modifies the bounding box of the map view the user currently sees. The geomap widget creates the bounding box based on the current center point, map zoom and size of the map view.

When you set a new bbox, the center and zoom properties are set as close as they can be based on the services you've added and the size of the map view.

For example, if you have a cached service with specific zoom levels, the map widget will have to pick a zoom level even though it may result in a bbox that is quite different from the one passed. When your services are fully dynamic, i.e., they allow arbitrary zoom levels, the final bbox will not likely match the one passed either due to ratio differences between the requested bbox and the map view's size. The map will attempt to pick a bounding box that best fits the one you request.

This property is a JavaScript array consisting of four values which can be thought of as: minx, miny, maxx and maxy of the current map view in map units and in that order. By default the values are in geodetic coordinates, e.g., bbox[0] is the longitude of the left of the current map view, bbox[1] is the latitude of the bottom, bbox[2] is the longitude of the right and bbox[3] is the latitude of the top. You can change the default when you initialize the widget by passing projected coordinates as the bbox option.

Setting a new bbox will refresh the map services.

If you attempt to initialize both center and bbox at the same time when creating a geomap widget, center will override bbox.

If you attempt to initialize both zoom and bbox at the same time when creating a geomap widget, bbox will be applied and zoom will modify the final bbox.