Geoserver

5/24/2015 2:22:42 AM
Total Posts 1

Geoserver

I have used following code to view a data layer from geoserver.

 

Dim wms As WmsLayer = New WmsLayer(http://101.56.189.169:8080/geoserver/wms)

wms.AddLayer("UrbanArea") 

map.AddLayer(wms)

map.ImageFormat = ImageFormat.Png

map.ImageOpacity = 0

 

But nothing is viewed.

Coul any one tell me what is the problem.

Thanks

 

5/24/2015 9:37:28 AM
Total Posts 28

Re: Geoserver

Please try this code

 

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
map.ImageOpacity = 0;
map.BackColor = Color.Transparent;
map.ImageFormat = ImageFormat.Gif;
AddWmsLayer();

}

protected void AddWmsLayer()
{
WmsLayer wms = new WmsLayer("http://123.49.36.82:9090/geoserver/BD/wms", new AspMap.Rectangle(88.0,26.63, 92.68,20.59));
wms.AddLayer("district");
wms.ImageFormat = ImageFormat.Gif;
// add the WMS layer to the map
AspMap.Layer wmsLayer = map.AddLayer(wms);
// set the coordinate system of the map to the coordinate system of the WMS layer
map.CoordinateSystem = CoordSystem.WGS1984;
// limit the full extent of the map to the extent of the WMS layer
map.Extent = wmsLayer.Extent;
}

5/25/2015 2:09:59 AM
MVP
Total Posts 323

Re: Geoserver

The http://101.56.189.169:8080/geoserver/wms server is not available.

If you try to show a single WMS layer only(without local layers), you have to specify the extent of the WMS layer and use second constructor of the WmsLayer class. But, the 101.56.189.169:8080 server is not available, so it is impossible to get meta information about the WMS service.