JHnet
JHnet

Reputation: 471

How to set the extent of an OpenLayers Map?

I want to pan and zoom an OpenLayers.Map to a given OpenLayer.Bounds.

What is a quick way to do this action?

I want to see everything that is in the bounds on the map.

Cheers!

Upvotes: 4

Views: 8266

Answers (1)

vncook
vncook

Reputation: 186

Please try OpenLayers.Map.zoomToExtent(OpenLayers.Bounds) which will zoom to the passed in bounds and recenter the map.

Upvotes: 7

Related Questions