Select to view content in your preferred language

JS API 4.0 layer order in map and resulting maximum scale

1153
0
05-11-2016 02:41 AM
janjermei
Occasional Contributor

When I add several layers to a Map, the maximum zoom level depends on the order of the layers in the layers array:

var map = new Map({

        /*basemap: "streets",*/

        /*basemap: customBasemap ,*/

        layers: [infraLyr, baseLyr],

        /*layers: [baseLyr, infraLyr],*/

        spatialReference: new SpatialReference ({wkid: 31370})

      });

The baseLyr is a TileLayer and the infraLyr is a MapImageLayer.

When I use the sequence  "layers: [infraLyr, baseLyr]", I can zoom to the maximum scale of the infraLyr and the tiles of the baseLyr are interpolated outside the scale range of the baseLyr.

When I use the sequence "layers: [baseLyr, infraLyr]", I can only zoom to the maximum scale of the baseLyr.

It would be more logical to be able to zoom to the maximum scale of any of the layers present in the map, regardless of their sequence?

Tags (1)
0 Kudos
0 Replies