AnsweredAssumed Answered

How to recenter map after displaying location?

Question asked by coracoleman14 on Apr 5, 2018

I used the "Display device location" sample code but would like to make it so that whenever the Spinner is on "Stop", the map is re-centered on the initial extent. How can I do this? I have tried so far in the switch statement for the "Stop" case this below, however it does not render the layers or basemap when it "zooms back" and I am confused:

if (!mLocationDisplay.isStarted())
// create the location point
Point centerPoint = new Point(48.6596, -113.7870, spatialReference);
// set the map views's viewpoint centered on Waterloo and scaled
aMapView.setViewpointCenterAsync(centerPoint, SCALE);