How to add wms layer from geoserver?

5065
2
08-06-2013 11:47 AM
FrankPascuzzi
New Contributor
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,-5..."];
   
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.
0 Kudos
2 Replies
Noah-Sager
Esri Regular Contributor
This is not exactly the same case, but the logic should be pretty similar in this post: WMTS Services
0 Kudos
Noah-Sager
Esri Regular Contributor
If anyone else is curious, there is a new knowledge base technical article covering this topic:

HowTo: Consume open source (WMS and WMTS) services with the ArcGIS Runtime SDK for iOS
0 Kudos