[OpenLayers-Users] Displaying a static map

Christopher Schmidt crschmidt at metacarta.com
Mon Dec 4 20:49:41 EST 2006


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)
);

Should get you the right area -- tweak as needed.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list