AnsweredAssumed Answered

visibleAreaEnvelope not set after zoom

Question asked by kehlawler on Apr 28, 2014
Latest reply on Apr 29, 2014 by kehlawler
I'm trying to retrieve the visibleAreaEnvelope set after performing a zoom operation such as zoomToEnvelope or zoomToResolution etc.  The following code performs the zoom as expected, however when I query the visibleAreaEnvelope it is always the envelope that was in existence before the zoom (in my case the max envelope).   Does the zoom have to finish before the new envelope is available?  If so, I can't find any way to determine when the map has been fully updated. 

e.g.  //In this example centre has been set to the GPS location in WKID:102100 map units

        double zoomRes = [agsMapView minResolution];
        while (zoomRes < 2)
            zoomRes *= 2;
        AGSSpatialReference *srs = [AGSSpatialReference spatialReferenceWithWKID:102100];
        [agsMapView zoomToResolution:zoomRes withCenterPoint:[AGSPoint pointWithX:centre.x y:centre.y spatialReference:srs] animated:NO];
        AGSEnvelope *envelope1 = [webMapView.agsMapView visibleAreaEnvelope];

Outcomes