set up initial extent initExtent=

4257
2
02-12-2012 11:27 AM
forestknutsen1
MVP Regular Contributor
this is the XML code form the HelloWorldMap

<!-- MapView layout and initial extent -->
<com.esri.android.map.MapView
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
initExtent = "-1.3296373526814876E7 3930962.41823043 -1.2807176545789773E7 4201243.7502468005">
</com.esri.android.map.MapView>

where would I find info on the units that the initExtent uses? looks like lat and long but formatted somehow. . .

com.esri.android.map MapView interface I see methods for setExtent but nothing for initExtent am I looking in the right place?  probably it is something that I don't understated with XML vs java.

Thanks for any help
0 Kudos
2 Replies
SaurabhGupta
New Contributor II
The units for your extent can be found from REST service directory of your MapService.

And if you want to set the initExtent via Java than XML then you can define that in the constructor of your MapView object.

MapView

public MapView(android.content.Context context,
               SpatialReference spatialreference,
               Envelope extent)

    The constructor is used if you are instantiating the MapView using Java code (see the class description for an example of this usage).

    Parameters:
        context - The Context the view is running in, through which it can access the current theme, resources, , and so on.
        spatialreference - the spatial reference to initialize the map with.
        extent - the initial map extent to display.
ElezaKollannur
New Contributor II

Thanks for posting this. Was stuck for a bit trying to set extend dynamic map service in Android

0 Kudos