[OpenLayers-Users] Setting bounds disables map

Michael Shishcu micklesh at gmail.com
Wed Oct 14 01:33:00 EDT 2009


Hi, David

well, just thought: your extent is 16617, 777514, 348089, 959747, but center
you are setting as (-71.1491479425792,42.5394078098106), which does not fall
into your extent

regards, michael

2009/10/14 David Lozzi <dlozzi at delphi-ts.com>

>  Hello,
>
>
>
> See my code below. When I specify maxExtent: bounds in the new map, my maps
> don’t appear. All of the added controls appear but no maps. IE shows
> download 75 items then down to Done, but there is nothing to see.
>
>
>
>         var lon = 50;
>
>         var lat = 0;
>
>         var zoom = 0;
>
>         var map, layer;
>
>         var markers;
>
>         var icon;
>
>
>
>         function init(){
>
>             var bounds = new OpenLayers.Bounds(
>
>                     16617, 777514,
>
>                     348089, 959747
>
>                 );
>
>             OpenLayers.DOTS_PER_INCH = 72;
>
>
>
>             var options = {
>
>                 controls: [
>
>                     new OpenLayers.Control.Navigation(),
>
>                     new OpenLayers.Control.PanZoomBar(),
>
>                     new OpenLayers.Control.ScaleLine(),
>
>                     new OpenLayers.Control.MousePosition(),
>
>                     new OpenLayers.Control.LayerSwitcher()
>
>                 ],
>
>                 numZoomLevels: 20,
>
>                 maxExtent: bounds,
>
>                 maxResolution: 1294.8125,
>
>                 projection: "EPSG:26986",
>
>                 units: 'm'
>
>             };
>
>             map = new OpenLayers.Map( 'map',{maxExtent: bounds,
> numZoomLevels: 10,controls: [
>
>                     new OpenLayers.Control.Navigation(),
>
>                     new OpenLayers.Control.PanZoomBar(),
>
>                     new OpenLayers.Control.LayerSwitcher()
>
>                 ]});
>
>
>
>             //MassGIS Layers are available at
> http://lyceum.massgis.state.ma.us/wiki/doku.php?id=wms:layers
>
>             format = 'image/png';
>
>
>
>             // setup tiled layer
>
>             tiled = new OpenLayers.Layer.WMS(
>
>                 "Roads and Boundaries", "
> http://giswebservices.massgis.state.ma.us:80/geoserver/wms",
>
>                 {
>
>                     layers:
> 'massgis:GISDATA.NAVTEQRDS_ARC,massgis:GISDATA.NAVTEQRDS_ARC_STATE'
>
>
>
>                 }
>
>             );
>
>             markers = new OpenLayers.Layer.Markers( "Markers" );
>
>
>
>             var size = new OpenLayers.Size(10,17);
>
>             var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
>
>             icon = new OpenLayers.Icon('/_layouts/DHQMap/img/marker.png'
> ,size,offset);
>
>
>
>             map.addLayers([tiled, markers]);
>
>             map.setCenter(newOpenLayers.LonLat(-71.1491479425792,42.5394078098106), 14);
>
>         }
>
>
>
>
>
> *David Lozzi*
>
> *Product Development Manager*
>
> Delphi Technology Solutions, Inc.
>
> (978) 988-8007 x204 - www.delphi-ts.com
>
>
>
> Blog <http://www.delphi-ts.com/blogs/lozzi>  -  LinkedIn<http://www.linkedin.com/in/davidlozzi>
> - Twitter <http://www.twitter.com/davidlozzi>
>
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091014/987840be/attachment.html


More information about the Users mailing list