Select to view content in your preferred language

Create layer with custom TileInfo

599
0
10-19-2021 03:03 PM
BethLott
Occasional Contributor

I am converting an app from 4.6 to 4.20. There is code that creates a Layer for the Basemap using a custom TileInfo object. There are 349 levels of detail (LODs) in it. This code does not work AT ALL in 4.20. Is there any way to adjust it to work for 4.20? The client really likes the smaller incremented zoom compared to the map's zoom.

 
 var map = new Map({
        basemap: new Basemap({
                               baseLayers: [
                                  new Layer({
                                      tileInfo: new TileInfo({
                                          rows: 256,
                                          cols: 256,
                                          dpi: 96,
                                          format: "PNG8",
                                          compressionQuality: 0,
                                          spatialReference: new SpatialReference(4326),
                                          lods: [
                                              new LOD({ level: -1, scale: 924464800.868618, resolution: 244500.98490512499 }), new LOD({ level: 0, scale: 9244648.868618, resolution: 2445.98490512499 }), new LOD({ level: 1, scale: 4622606.558603, resolution: 1223.06709809791 }), new LOD({ level: 2, scale: 3081925.788598, resolution: 815.427829088879 }), new LOD({ level: 3, scale: 2311585.4035955, resolution: 611.608194584365 }), new LOD({ level: 4, scale: 1849381.172594, resolution: 489.316413881657 }), new LOD({ level: 5, scale: 1541245.018593, resolution: 407.788560079851 }), new LOD({ level: 6, scale: 1321147.76573514, resolution: 349.554378792848 }), new LOD({ level: 7, scale: 1156074.82609175, resolution: 305.878742827595 }), new LOD({ level: 8, scale: 1027684.76192467, resolution: 271.908803743509 }), new LOD({ level: 9, scale: 924972.710591, resolution: 244.73285247624 }), new LOD({ level: 10, scale: 840935.577681636, resolution: 222.497983257566 }), new LOD({ level: 11, scale: 770904.6335905, resolution: 203.968925575338 }), new LOD({ level: 12, scale: 711647.680898, resolution: 188.290492151913 }), new LOD({ level: 13, scale: 660856.007161571, resolution: 174.851834931836 }), new LOD({ level: 14, scale: 616836.55659, resolution: 163.204998674435 }), new LOD({ level: 15, scale: 578319.537339875, resolution: 153.014016949209 }), new LOD({ level: 16, scale: 544333.932119176, resolution: 144.021974250481 }), new LOD({ level: 17, scale: 514124.505256333, resolution: 136.029047407166 }), new LOD({ level: 18, scale: 487095.018063263, resolution: 128.877481284201 }), new LOD({ level: 19, scale: 462768.4795895, resolution: 122.441071773532 }), new LOD({ level: 20, scale: 440758.754303714, resolution: 116.617653644832 }), new LOD({ level: 21, scale: 420749.913134818, resolution: 111.323637164195 }), new LOD({ level: 22, scale: 402480.971198, resolution: 106.489969942744 }), new LOD({ level: 23, scale: 385734.44108925, resolution: 102.059108323081 }), new LOD({ level: 24, scale: 370327.6333892, resolution: 97.9827156329904 }), new LOD({ level: 25, scale: 356105.964743, resolution: 94.2198916113687 }), new LOD({ level: 26, scale: 342937.753033556, resolution: 90.7357952950522 }), new LOD({ level: 27, scale: 330710.127874786, resolution: 87.5005630013297 }),
]
                                      })
                                  })
                                ]
                            }),
                        });

 

Tags (3)
0 Kudos
0 Replies