[OpenLayers-Users] Problems adding a WMS layer

James Lamanna james at touchtable.com
Tue Aug 21 11:43:39 PDT 2012


I also should mention that my map is intialized like this, with an 
ArcGISOnline base layer:

map = new OpenLayers.Map('map', {
         displayProjection: new OpenLayers.Projection('EPSG:4326'),
     });

var arcGISBase = new OpenLayers.Layer.XYZ("Basemap",
	"http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/${z}/${y}/${x}",
         {
             sphericalMercator: true,
             maxExtent: new 
OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
             transitionEffect: 'resize',
             resolutions: [156543.03390625, 78271.516953125, 
39135.7584765625,
                 19567.87923828125, 9783.939619140625, 4891.9698095703125,
                 2445.9849047851562, 1222.9924523925781, 611.4962261962891,
                 305.74811309814453, 152.87405654907226, 76.43702827453613,
                 38.218514137268066, 19.109257068634033, 9.554628534317017,
                 4.777314267158508, 2.388657133579254, 1.194328566789627,
                 0.5971642833948135, 0.25, 0.1, 0.05],
             serverResolutions: [156543.03390625, 78271.516953125, 
39135.7584765625,
                 19567.87923828125, 9783.939619140625,
                 4891.9698095703125, 2445.9849047851562,
                 1222.9924523925781, 611.4962261962891,
                 305.74811309814453, 152.87405654907226,
                 76.43702827453613, 38.218514137268066,
                 19.109257068634033, 9.554628534317017,
                 4.777314267158508, 2.388657133579254,
                 1.194328566789627, 0.5971642833948135],
             }
     );



On 8/21/2012 11:29 AM, James Lamanna wrote:
> Hi,
> I'm trying to add a WMS layer from national atlas:
>
> var wms = new OpenLayers.Layer.WMS(
> 'states',
> 'http://webservices.nationalatlas.gov/wms/boundaries',
> {
> layers: 'states',
> transparent: true,
> version: '1.3.0'
> });
>
> map.addLayer(wms);
>
> It doesn't seem to request any tiles until I zoom WAY out on the map,
> and then I get a request like this:
>
> http://webservices.nationalatlas.gov/wms/boundaries?LAYERS=states&TRANSPARENT=TRUE&VERSION=1.3.0&EXCEPTIONS=INIMAGE&SERVICE=WMS&REQUEST=GetMap&STYLES=&FORMAT=image%2Fpng&CRS=EPSG%3A900913&BBOX=-90,-180,19580220.616111,19580130.616111&WIDTH=256&HEIGHT=256
>
>
> Why are the coordinates for the BBOX in 2 different coordinate systems?
>
> Do I need to specify a resolutions list or what?
> It should be requesting tiles when I'm at a reasonable zoom level as well.
>
> Thanks.
>
> -- James
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list