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="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;" 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="font-size:11pt;font-family:Arial;color:#000099;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:underline;vertical-align:baseline;">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="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;"></span><br>
<span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;"><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="font-size:11pt;font-family:Arial;color:#000099;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:underline;vertical-align:baseline;">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>