[OpenLayers-Users] NationalAtlas.gov WMS usage

Pierre GIRAUD bluecarto at gmail.com
Sat Oct 18 18:19:18 EDT 2008


I played with this a bit, and the following worked for me :

map = new OpenLayers.Map('map', {
                projection: new OpenLayers.Projection("EPSG:2163"),
                units: "m",
                maxResolution: 'auto',
                maxExtent: new OpenLayers.Bounds(-5720171, -2783739.25,
                                                 4279073, 4487617),
                controls: [
                       new OpenLayers.Control.PanZoomBar(),
                       new OpenLayers.Control.ScaleLine(),
                       new OpenLayers.Control.MousePosition(),
                       new OpenLayers.Control.Navigation()
               ],
               numZoomLevels: 20
            });

            map.addLayer(new OpenLayers.Layer.WMS("National Atlas States",
               "http://nationalatlas.gov/natlas/WMSProcess.asp",
               {layers: 'grid,states', format:'gif', exceptions:
'Blank', version: '1.0.0'}
            ));


            map.zoomToMaxExtent();

Hope this helps,
Pierre

On Fri, Oct 17, 2008 at 11:10 PM, BigJimInDC <bigjimindc at gmail.com> wrote:
>
> Being very new to GIS and OpenLayers, I'm not sure that I have a clue as to
> what to do with that information.  Any idea as to how I would modify the
> supplied code to make it all work?
>
> Thanks!
>
>
> Christopher Schmidt-2 wrote:
>>
>> On Fri, Oct 17, 2008 at 01:43:11PM -0700, BigJimInDC wrote:
>>
>> http://nationalatlas.gov/infodocs/ogcwms.html
>>
>> Says SRS is: EPSG:2163  and bounding box is
>>
>> -5720171
>> -2783739.25
>> 4279073
>> 4487617
>>
>> So you'll need to set up a different projection for your map data in
>> order to use it.
>>
>> -- Chris
>>
>>> Here is also the code that I'm trying to get working:
>>>
>>>      map = new OpenLayers.Map('map', {
>>>              controls: [
>>>                      new OpenLayers.Control.PanZoomBar(),
>>>                      new OpenLayers.Control.ScaleLine(),
>>>                      new OpenLayers.Control.MousePosition(),
>>>              ],
>>>              numZoomLevels: 20,
>>>              tileSize: new OpenLayers.Size(512, 512)
>>>      });
>>>
>>>      map.addLayer(new OpenLayers.Layer.WMS("National Atlas States",
>>>              "http://nationalatlas.gov/natlas/WMSProcess.asp",
>>>              {layers: 'grid,states', type:'gif'}
>>>      ));
>>>      map.setCenter(new OpenLayers.LonLat(-76.77246, 38.9746), 9);
>>>
>>>
>>>
>>> Christopher Schmidt-2 wrote:
>>> >
>>> > On Fri, Oct 17, 2008 at 01:31:21PM -0700, BigJimInDC wrote:
>>> >>
>>> >> Any ideas on how to make this work?  They have a ton of data layers
>>> that
>>> >> would be useful to have easy access to, but as a new OpenLayers user,
>>> >> I've
>>> >> had some difficulty in getting it to work, and Google hasn't turned up
>>> >> anything useful either.
>>> >
>>> > It's typically best if you provide something you've tried that hasn't
>>> > worked. Also, information about the WMS would be useful; not all of us
>>> > have any idea what your'e talking about. (I don't, for example :))
>>> >
>>> > Regards,
>>> > --
>>> > Christopher Schmidt
>>> > MetaCarta
>>> > _______________________________________________
>>> > Users mailing list
>>> > Users at openlayers.org
>>> > http://openlayers.org/mailman/listinfo/users
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://n2.nabble.com/NationalAtlas.gov-WMS-usage-tp1346818p1346877.html
>>> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at openlayers.org
>>> http://openlayers.org/mailman/listinfo/users
>>
>> --
>> Christopher Schmidt
>> MetaCarta
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>>
>
> --
> View this message in context: http://n2.nabble.com/NationalAtlas.gov-WMS-usage-tp1346818p1346982.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



More information about the Users mailing list