esrifrank

How to add wms layer from geoserver?

Discussion created by esrifrank on Aug 6, 2013
Latest reply on Jan 23, 2014 by NSager-esristaff
I'm trying to add a wms layer that is served from an instance of geoserver using the AGSWMSLayer class but I haven't had any luck.

For example, using the layer preview option from the geoserver console we have a layer with the following URL format:


ourhostname/geoserver/esi/wms?service=WMS&version=1.1.0&request=GetMap&layers=esi:esi-environmental-sustainability-index-2005_human-sustenance&styles=&bbox=-180.0,-55.792,180.0,83.667&width=851&height=330&srs=EPSG:4326&format=image%2Fpng


I tried a number of ways for pulling in this layer including the following:


NSURL* wmsurl = [NSURL URLWithString: @"http://ourhostname/geoserver/esi/wms?service=WMS&version=1.1.0&request=GetMap&styles=&bbox=-180.0,-55.792,180.0,83.667&width=851&height=330&srs=EPSG:4326&format=image%2Fpng"];
   
AGSWMSLayer* wmsLayer = [[AGSWMSLayer alloc] initWithURL:wmsurl];
                            
[self.mapView addMapLayer:wmsLayer withName:@"esi:esi-environmental-sustainability-index-2005_human-sustenance"];


I'm also having a difficult time getting any error information to help with the debugging.

Any help sure would be appreciated.

Outcomes