<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19120"></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=210005419-14092011>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=210005419-14092011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=210005419-14092011>the wms and layer you request have a extent and scale
limitation. It's only available for a defined extent and up a defined
scale.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=210005419-14092011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=210005419-14092011>In your example you center the map on lon=5 and lat=40
with zoom=5. That's far away.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=210005419-14092011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=210005419-14092011>try</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=210005419-14092011>map.setCenter(new
OpenLayers.LonLat(-90,44),13);</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=210005419-14092011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=210005419-14092011>To get some usefull information for wms server use this
service</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=210005419-14092011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><A
href="https://geoportal.bayern.de/getcapabilities/index.html">https://geoportal.bayern.de/getcapabilities/index.html</A></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2
face=Arial></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=210005419-14092011>There you can see, that the requested layer have a
scalehint of 37. That means, you have to use a very high
zoomlevel.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=210005419-14092011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=210005419-14092011>Arnd</SPAN></FONT></DIV><BR>
<DIV dir=ltr lang=de class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>Von:</B> openlayers-users-bounces@lists.osgeo.org
[mailto:openlayers-users-bounces@lists.osgeo.org] <B>Im Auftrag von
</B>Surendran Neelakantan<BR><B>Gesendet:</B> Dienstag, 13. September 2011
23:02<BR><B>An:</B> openlayers-users@lists.osgeo.org<BR><B>Betreff:</B>
[OpenLayers-Users] Canot Load WMS layer<BR></FONT><BR></DIV>
<DIV></DIV>Hi list<BR><BR>I am trying to load WMS and WFS overlay
from a remote site. I tried many ways but faild it would be great if some
one show me how to load these layers from the remote site.<BR><BR><A
href="http://ukypssgis.ca.uky.edu/landusenrcs_V3/testing/007/opelayers-wms1.html">Here
is the link</A> <BR><BR><BR>Direct urls are working<BR><BR><SPAN
style="BACKGROUND-COLOR: transparent; FONT-VARIANT: normal; FONT-STYLE: normal; FONT-FAMILY: Arial; COLOR: #000000; FONT-SIZE: 11pt; VERTICAL-ALIGN: baseline; FONT-WEIGHT: normal; TEXT-DECORATION: none"
id=internal-source-marker_0.007740399847825374> WMS</SPAN> request<BR><A
href="http://sdmdataaccess.nrcs.usda.gov/Spatial/SDM.wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:4326&WIDTH=800&HEIGHT=600&FORMAT=image/gif&LAYERS=MapunitPoly&BBOX=-84.513702,37.993728,-84.449329,38.044441"><SPAN
style="BACKGROUND-COLOR: transparent; FONT-VARIANT: normal; FONT-STYLE: normal; FONT-FAMILY: Arial; COLOR: #000099; FONT-SIZE: 11pt; VERTICAL-ALIGN: baseline; FONT-WEIGHT: normal; TEXT-DECORATION: underline">http://sdmdataaccess.nrcs.usda.gov/Spatial/SDM.wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:4326&WIDTH=800&HEIGHT=600&FORMAT=image/gif&LAYERS=MapunitPoly&BBOX=-84.513702,37.993728,-84.449329,38.044441</SPAN></A><SPAN
style="BACKGROUND-COLOR: transparent; FONT-VARIANT: normal; FONT-STYLE: normal; FONT-FAMILY: Arial; COLOR: #000000; FONT-SIZE: 11pt; VERTICAL-ALIGN: baseline; FONT-WEIGHT: normal; TEXT-DECORATION: none"></SPAN><BR><SPAN
style="BACKGROUND-COLOR: transparent; FONT-VARIANT: normal; FONT-STYLE: normal; FONT-FAMILY: Arial; COLOR: #000000; FONT-SIZE: 11pt; VERTICAL-ALIGN: baseline; FONT-WEIGHT: normal; TEXT-DECORATION: none"><BR><BR>WFS
request<BR></SPAN><A
href="http://sdmdataaccess.nrcs.usda.gov/Spatial/SDMNAD83Geographic.wfs?SERVICE=WFS&request=GetFeature&version=1.0.0&typeName=Mapunitpoly&SRS=EPSG:4326&BBOX=-84.513702,37.993728,-84.449329,38.044441"><SPAN
style="BACKGROUND-COLOR: transparent; FONT-VARIANT: normal; FONT-STYLE: normal; FONT-FAMILY: Arial; COLOR: #000099; FONT-SIZE: 11pt; VERTICAL-ALIGN: baseline; FONT-WEIGHT: normal; TEXT-DECORATION: underline">http://sdmdataaccess.nrcs.usda.gov/Spatial/SDMNAD83Geographic.wfs?SERVICE=WFS&request=GetFeature&version=1.0.0&typeName=Mapunitpoly&SRS=EPSG:4326&BBOX=-84.513702,37.993728,-84.449329,38.044441</SPAN></A><BR><BR> <BR>This
is the code I have tried<BR><BR>
var lon = 5;<BR> var lat =
40;<BR> var zoom =
5;<BR> var map,
layer;<BR><BR> function
init(){<BR>
map = new OpenLayers.Map( 'map' );<BR>
<BR> //layer =
new OpenLayers.Layer.WMS( "OpenLayers
WMS",<BR>
// "<A
href="http://vmap0.tiles.osgeo.org/wms/vmap0">http://vmap0.tiles.osgeo.org/wms/vmap0</A>",
{layers: 'basic'} );<br/><BR>var wmsurl="<A
href="http://sdmdataaccess.nrcs.usda.gov/Spatial/SDM.wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:4326&WIDTH=800&HEIGHT=600&FORMAT=image/gif&LAYERS=MapunitPoly&BBOX=-84.513702,37.993728,-84.449329,38.044441">http://sdmdataaccess.nrcs.usda.gov/Spatial/SDM.wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:4326&WIDTH=800&HEIGHT=600&FORMAT=image/gif&LAYERS=MapunitPoly&BBOX=-84.513702,37.993728,-84.449329,38.044441</A>"<BR><BR>
<BR> layer =
new OpenLayers.Layer.WMS( "OpenLayers
WMS",<BR>
"<A
href="http://sdmdataaccess.nrcs.usda.gov/Spatial/SDM.wms">http://sdmdataaccess.nrcs.usda.gov/Spatial/SDM.wms</A>",
{layers: "MapunitPoly"<BR>
//request
:"GetMap",<BR>
//version:"1.1.1",<BR>
//service:"WMS"<BR>
//TRANSPARENT:"TRUE",<BR>
//format:"image/gif",<BR>
//bbox:"-84.513702,37.993728,-84.449329,38.044441"<BR>
//srs:"EPSG:4326"<BR><BR>
}
);<BR><BR><BR><BR><BR>var wfslayer= = new OpenLayers.Layer.Vector("WFS",
{<BR> strategies: [new
OpenLayers.Strategy.Fixed()],<BR> protocol: new
OpenLayers.Protocol.WFS({<BR>
url: "<A
href="http://sdmdataaccess.nrcs.usda.gov/Spatial/SDMNAD83Geographic.wfs">http://sdmdataaccess.nrcs.usda.gov/Spatial/SDMNAD83Geographic.wfs</A>",<BR>
featureType:
"MapunitPoly",<BR>
//featureNS: "<A
href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</A>",<BR>
srsName:
"EPSG:42326",<BR>
version:
"1.0.0"
<BR>
})<BR>});<BR>
map.addLayer(layer,wfslayer);<BR><BR>
map.setCenter(new OpenLayers.LonLat(lon, lat),
zoom);<BR>
map.addControl( new OpenLayers.Control.LayerSwitcher()
);<BR> }<BR>
<BR><BR>It would be great if some one can show me the correct
syntax.<BR><BR><BR>Surendran<BR><BR><BR></BODY></HTML>