How do I set default Extents on iOS application

3022
9
11-07-2011 10:43 AM
KevinJordan2
New Contributor
We have managed to successfully create and view maps on the iPhone and iPad but when I open them using the standard basemap we see the whole world.  Our map is saved in Arcmap at the set extents of our data but we lose that zoomed extent in the iPhone map.  How do I set it to default to the extent of our data?
0 Kudos
9 Replies
RussRoberts
Esri Notable Contributor
On the ArcGIS for iOS application the extent can be set when you create the map on your mobile content server.ArcGIS Online grabs the extent that the map view you are currently at when you save the map to your online content.

Hope this helps
Russ
0 Kudos
KevinJordan2
New Contributor
How do I set the extents in the mobile content server?
0 Kudos
KevinJordan2
New Contributor
Let me rephrase that.  I see the section on the mobile content server when you are creating a new application that I assume you use to specify the extents.  My question is how do I know what to set it to and what format does it need to be in?
0 Kudos
NimeshJarecha
Esri Regular Contributor
It has to be envelope coordinates (xmin,ymin,xmax,ymax) in the base layer's spatial reference.

Hope this helps!

Regards,
Nimesh
0 Kudos
KevinJordan2
New Contributor
Still not working. Here's what I did.  I opened the mxd and went to the layer with the biggest extents.  I right clicked and went to layer properties and the clicked on the Source Tab to get the Left, Right, Top, Bottom Coordinates.  I keyed them into the extents line on the Mobile Content Server using the format mentioned above, xmin,ymin,xmax,ymax.  Everything appeared to work, or at least I didn't get any errors.  But when I open the map on the iPhone it is still zooming all the way out.  Did I do something wrong?
0 Kudos
KevinJordan2
New Contributor
So where do I get the envelope coordinates (xmin,ymin,xmax,ymax)?
0 Kudos
NimeshJarecha
Esri Regular Contributor
The envelope coordinates MUST be in BASE LAYER's spatial reference. Is it the case?

Regards,
Nimesh
0 Kudos
DarrenMackiewicz
Occasional Contributor
Nimesh,
The iOS API 2.1 says:

"The envelope property on AGSMapView has been deprecated and replaced by visibleArea to take into account map rotation."

When I change to :

AGSEnvelope *env = self.mapView.visibleArea;

I get this error:

Incompatible pointer types initializing 'AGSEnvelope *' with an expression of type 'AGSPolygon *'
0 Kudos
NimeshJarecha
Esri Regular Contributor
Darren,

The original question of this post is different than your question and you should have created a new post.

The visibleArea returns AGSPolygon and you are trying to save it as AGSEnvelope. Hence the error. If you want envelope then change code line as following,

AGSEnvelope *env = self.mapView.visibleArea.envelope;

Hope this helps!

Regards,
Nimesh
0 Kudos