ArcGIS API for JavaScript 4.6 - referenceLayers

880
2
Jump to solution
02-01-2018 11:26 PM
Zdenekprocner
New Contributor II

hello,
I have a question about Basemap - JS API 4.
My TileLayer has LODs 0 - 19. The last three LODs are empty (on purpose).

I create the Basemap and
1- The API v. 3 has a map of all LODs - I can also zoom into empty levels (0-19 LOD)
2 -The API v. 4.6 has a map of only non-empty levels (LOds)

When I use it in Basemap properties referenceLayers,it does not work. I have it again  (0-16 LOD)

layer_for_DISPLAY = new TileLayer({
        url: "http://xxxxx/MapServer",
        id: "myID_1",
        title: "myName_1"
      });
/*LODs 0 - 19, last three LODs are empty */

layer_for_LODs = new TileLayer({
        url: "http://yyyyyy/MapServer",
        id: "myID_2",
        title: "myName_2"
      });

/*LODs 0 - 19, non empty LODs */

/* JS API 4 */

myBasemap = new Basemap({
        baseLayers: [layer_for_DISPLAY],
 referenceLayers: [layer_for_LODs],
        title: "myNameBM",
        id: "myIDBM",
        thumbnailUrl: ""
      });


Is it wrong?

The reason is that I after load  (dynamic) MapImageLayer, which is displayed on all scale.

Thank you,
Zdenek Procner

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Zedenek,

   You can set the maps constraints lods property to contain the lods you want:

https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints 

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Zedenek,

   You can set the maps constraints lods property to contain the lods you want:

https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints 

0 Kudos
Zdenekprocner
New Contributor II

Hello Robert,

You are right.

app.mapView.constraints.lods  = layer_for_LODs.tileInfo.lods

It is interesting that layer "layer_for_DISPLAY" (TileLayer)  only in empty Lods is behaving as MapImageLayer and it is rendered

Zdenek

0 Kudos