Constrain Slippy Map within Bounding Box

Is it possible to display a map of a local area say a city, whilst constraining the slippy & zoom features of said map to specified bounding box and not to exceed them?