lcatania

MapView Initial Extent

Discussion created by lcatania on Jul 31, 2012
Latest reply on Feb 21, 2013 by sauegr01
I have tried to set the initial extent of the mapview to the world, but it seems to be overridden by the extent of the first layer loaded into the mapview.  How to I get around this?  All my layers are WGS_1984 Geographic. I have set a the initial extent in the xml as well as added onStatusChanged listener on each layer:


public void onStatusChanged(Object arg0, STATUS status) {
                /*
                 * Check if layer's new status = INITIALIZED. If it is,
                 * initialize UI elements
                 */
                if (status.equals(OnStatusChangedListener.STATUS.INITIALIZED)) {
                    System.out.println("onStatusChanged: "
                        + arcGISLocalTiledLayer.getUrl());
                    mapView.setExtent(new Envelope(-180, -90, 180, 90));
                }
            }

Outcomes