[OpenLayers-Dev] Setting Zoom bounds

Chip Taylor ctaylor at preparedresponse.com
Tue Jul 10 08:48:35 EDT 2007


I am new to OpenLayers and am attempting to use it to integrate Mapserver
WMS into a Dot.Net 2.0 application.  The map I am interested in seeing is
only of the continental US.  My Mapserver Mapfile declares the extents as
EXTENT -127.0 26.0 -66.0 49.0 which should cover the CONUS.  In my
OpenLayers declarations I have the following:

var options = {maxExtent: new OpenLayers.Bounds(-127.0, 26.0, -66.0,
49.0),numZoomLevels: 20};
           

var map = new OpenLayers.Map('pnlDynamic',options, { controls: [] });

My "zoom in" is sufficient to see the detail I require, but in zooming out,
the image goes well beyond the extents specified, with my map of the US
becoming very tiny in the middle of a field of blue.  How can I control the
zoom so that I can zoom in to sufficient detail, but only zoom out to the
extent specified?
 

Chip Taylor
Lead GIS and Web Developer
Prepared Response, Inc. 
1142 Broadway, Suite 400
Tacoma, WA 98402
253-272-1483 office
253-948-2525 cell
253-272-1562 fax
www.preparedresponse.com

STATEMENT OF CONFIDENTIALITY 
The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain confidential or privileged information. If you are not the intended
recipient, please notify Prepared Response, Inc. immediately at (206)
223-5544 and destroy all copies of this message and any attachments.

 





More information about the Dev mailing list