Having Problems with Creating/Publishing and Consuming mobile maps for iOS

5183
14
Jump to solution
07-23-2012 05:55 AM
SpencerV
New Contributor III
Hi,

I'm working with a team that is seeking to develop a custom GIS app based off of the ArcGIS mobile API for iOS. We are using ArcGIS for Server 10.1 and are having some issues with retrieving maps that have been published. So far we have been creating very simple maps to test the publishing and retrieving experience on an iPad.

At this time we have a map published with a single feature layer that we want to be able to display and edit within ArcGIS mobile for iOS and eventually do the same in our custom application. While we were publishing this map we enabled "Feature Access" as well as "Mobile Data Access." Once the map is published we tried to move it to the mobile content directory on our server. We used a simple JSON syntax that we found in various tutorials. Below is a sample of the syntax that we used. Of course, we replaced the url with one linking back to our server.
{    "version":"1.1",    "baseMap":{       "baseMapLayers":[          {             "url":"https://services.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer"          }       ],       "title":"Topography"    },    "operationalLayers":[       {          "url":"http://OurServer/ArcGIS/rest/services/Gas_Stations/MapServer",          "visibility":true,          "opacity":0.75,          "title":"Environmental Sensitivity"       }          ] }


We are able to see the map in ArcGIS Mobile on the iPad and when we open it the base map that we are pulling from esri is displayed but no features are displayed. In addition, when we go to the content tab within the app there is no content listed. We then tried to pull the map into our custom app to have similar results. I was hoping that someone would be able to give a bit of guidance or help.

Thanks!
0 Kudos
1 Solution

Accepted Solutions
NimeshJarecha
Esri Regular Contributor
I would like to clarify few things. There is a difference between web map and a layer. Web map is collection of layers. Please read web map documentation.

If you want to access your gas stations layer then your code should be,

AGSCredential *credential = [[[AGSCredential alloc] initWithUser:@"USERNAME" password:@"PASSWORD"]autorelease];
NSURL *url = [NSURL URLWithString:@"http://yourserver/ArcGIS/rest/services/Gas_Stations/MapServer"];
AGSDynamicMapServiceLayer *layer = [AGSDynamicMapServiceLayer dynamicMapServiceLayerWithURL:url credential:cred];
[self.mapView addMapLayer:layer withName:@"Gas_Stations"];

Let me know if this works...

Regards,
Nimesh

View solution in original post

0 Kudos
14 Replies
NimeshJarecha
Esri Regular Contributor
Are you able to access the service url (http://OurServer/ArcGIS/rest/services/Gas_Stations/MapServer) in iPad browser (Safari)?

Regards,
Nimesh
0 Kudos
SpencerV
New Contributor III
Thanks for the help.

When I type the above URL I get the error:

"Error: Error handling service request: Could not find a service with JNDI name
'esri/services/miamipois/MapServer/gas_stations' in the configured clusters. Service may be stopped or ArcGIS
Server may not be running.
Code: 500"

We have been researching a lot of info today and we tried a few things. We were able to use "Add Item" to add our map to the "MobileWeb/Maps" directory using a new JSON. We were able to get this map to load on the ArcGIS mobile app when it loaded in "Gis Conections/OurServer/Maps" but have still be unsuccessful in getting it into our custom app.

Another thought, when we seek to add our map to our custom app should we be using the "MobileServer" link from the services folder or the link from "arcgis/mobile/content/MobileWeb/Maps"?

Thanks,
Spencer
0 Kudos
NimeshJarecha
Esri Regular Contributor
Seems that your ArcGIS server is not accessible from your iPad. Is your iPad connected (wi-fi) to the same network as your server?

Regards,
Nimesh
0 Kudos
SpencerV
New Contributor III
Yes it is. It is connected via WiFi to the same network as the Server. We are able to access the server's web adapter as well as accessing the mobile map via ArcGIS mobile for ios.
0 Kudos
NimeshJarecha
Esri Regular Contributor
Okay..can you please go to URL http://OurServer/ArcGIS/rest/services in iPad Safari browser? And see the service listed which you are trying to access in your web map?

Regards,
Nimesh
0 Kudos
SpencerV
New Contributor III
I went to the URL and was able to view the services that we have published to our server. For the gas stations map we are trying to view we see /Gas_Stations (MapServer) and /Gas_Stations (MobileServer).
0 Kudos
NimeshJarecha
Esri Regular Contributor
Now if you are able to browse the Gas_Stations/MapServer service then why did it give following error earlier? Did you try the same service? Is this service secured? Are you trying access it with web adaptor?

"Error: Error handling service request: Could not find a service with JNDI name
'esri/services/miamipois/MapServer/gas_stations' in the configured clusters. Service may be stopped or ArcGIS
Server may not be running.
Code: 500"

Regards,
Nimesh
0 Kudos
SpencerV
New Contributor III
We are able to navigate through the string of directories. We made a mistake with the url when trying it as we left out the "MapServer" portion. We are able to access /Gas_Stations/MapServer via Safari on the iPad as you requested earlier.
0 Kudos
NimeshJarecha
Esri Regular Contributor
Good! Are you using the same /Gas_Stations/MapServer url in the web map stored at http://yourserver/arcgis/mobile/content/MobileWeb/Maps? Is it a secured service?

Regards,
Nimesh
0 Kudos