[OpenLayers-Users] Displaying a static map

Christopher Schmidt crschmidt at metacarta.com
Mon Dec 4 20:51:05 EST 2006


On Mon, Dec 04, 2006 at 08:49:41PM -0500, Christopher Schmidt wrote:
> On Mon, Dec 04, 2006 at 08:43:31PM -0500, Xiaopeng Xiong wrote:
> > I started from the provided live demo at 
> > http://www.openlayers.org/dev/examples/lonlatfrompx.html
> > and I created a map without any control by using
> >     var map = new OpenLayers.Map('map', { controls: [] });
> > 
> > However, I have no idea on how to initialize the map to a specific area 
> > (e.g., around United States). Currently it displays the map of the whole 
> > world.
> > 
> > I will appreciate any help. Thank you.
> 
> map.zoomToExtent(
>   new penLayers.Bounds(-125.64,25.70,-70.18,50.93)
> );

Ack! Something ate my O!

 map.zoomToExtent(
   new OpenLayers.Bounds(-125.64,25.70,-70.18,50.93)
 );

That should work better :)

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list