AnsweredAssumed Answered

JS 4.3: mapview initial extent

Question asked by YoumDev on May 16, 2017
Latest reply on Oct 2, 2017 by KEkenes-esristaff

I'm using the ESRI Javascript API for 4.3 and my MapView is not respecting the initial extents of what I'm trying to set as the initial extents. I can change the extents after the map loads, but this does some snap zooming after the map loads which feels wrong. Am I missing something? Here is my basic map:

 

require([
  "esri/Map",
  "esri/views/MapView",
  "esri/layers/FeatureLayer",
  "esri/layers/MapImageLayer",
  "esri/Basemap",
  "dojo/domReady!"
], function (Map, MapView, FeatureLayer, MapImageLayer, Basemap) {

 

    var roadLayer = new MapImageLayer({
        url: a basemap service
    });

 

    var map = new Map({
        layers: "topo"
    });

 

    var view = new MapView({
        container: "mapDiv",  // Reference to the scene div created in step 5
        map: map,  // Reference to the map object created before the scene
        zoom: 5,  // Sets the zoom level based on level of detail (LOD)
        center: [ -122.3321, 47.6062 ]  // Sets the center point of view in lon/lat
    });

 


    map.add(roadLayer);

 

  
});

Outcomes