Map using projection 4326 and width/height of 256 does not display properly

Viewed 39

Edit: Question is updated with more information.

I currently have maps that uses EPSG 4326 projection with tile height and width of 512. My code below does display the maps correctly (using OpenLayers 6.5.0):

tempTileLayer = new TileLayer({
                source: new XYZSource({
                url: url + '/tile/{z}/{y}/{x}',
                maxZoom: 18,
                projection: 'EPSG:4326',
                tileSize: 256, // the tile size supported by the ArcGIS tile service
                maxResolution: 180 / 256, // Esri's tile grid fits 180 degrees on one 512 px tile
                wrapX: true,
          })

However, I have another map that uses EPSG 4326 but tile height and width is 256. The map does not display correctly (notice that the tiles displayed discontinuously, with "vertical" separation between the mis-matched tiles):

enter image description here

The information for the "good" maps are as follows:

Spatial Reference: 4326  (4326)

Single Fused Map Cache: true

Tile Info:
Height: 512
Width: 512
DPI: 96
Levels of Detail: 21
Level ID: 0 [ Start Tile, End Tile ]
Resolution: 0.3515625065578945
Scale: 1.47748799285417E8
Level ID: 1 [ Start Tile, End Tile ]
Resolution: 0.17578125327894775
Scale: 7.38743996427087E7
Level ID: 2 [ Start Tile, End Tile ]
Resolution: 0.08789062663947399
Scale: 3.69371998213544E7
Level ID: 3 [ Start Tile, End Tile ]
Resolution: 0.043945313319736994
Scale: 1.84685999106772E7
Level ID: 4 [ Start Tile, End Tile ]
Resolution: 0.021972656659868472
Scale: 9234299.95533859
Level ID: 5 [ Start Tile, End Tile ]
Resolution: 0.010986328329934226
Scale: 4617149.97766929
Level ID: 6 [ Start Tile, End Tile ]
Resolution: 0.005493164164967124
Scale: 2308574.98883465
Level ID: 7 [ Start Tile, End Tile ]
Resolution: 0.0027465820824835504
Scale: 1154287.49441732
Level ID: 8 [ Start Tile, End Tile ]
Resolution: 0.0013732910412417797
Scale: 577143.747208662
Level ID: 9 [ Start Tile, End Tile ]
Resolution: 6.866455206208899E-4
Scale: 288571.873604331
Level ID: 10 [ Start Tile, End Tile ]
Resolution: 3.433227603104438E-4
Scale: 144285.936802165
Level ID: 11 [ Start Tile, End Tile ]
Resolution: 1.716613801552224E-4
Scale: 72142.9684010827
Level ID: 12 [ Start Tile, End Tile ]
Resolution: 8.583069007761132E-5
Scale: 36071.4842005414
Level ID: 13 [ Start Tile, End Tile ]
Resolution: 4.291534503880566E-5
Scale: 18035.7421002707
Level ID: 14 [ Start Tile, End Tile ]
Resolution: 2.1457672519402802E-5
Scale: 9017.87105013534
Level ID: 15 [ Start Tile, End Tile ]
Resolution: 1.0728836259701401E-5
Scale: 4508.93552506767
Level ID: 16 [ Start Tile, End Tile ]
Resolution: 5.364418129850712E-6
Scale: 2254.46776253384
Level ID: 17 [ Start Tile, End Tile ]
Resolution: 2.682209064925356E-6
Scale: 1127.23388126692
Level ID: 18 [ Start Tile, End Tile ]
Resolution: 1.3411045324626755E-6
Scale: 563.616940633459
Level ID: 19 [ Start Tile, End Tile ]
Resolution: 6.705522662313366E-7
Scale: 281.808470316729
Level ID: 20 [ Start Tile, End Tile ]
Resolution: 3.352761331156695E-7
Scale: 140.904235158365
Format: JPEG
Compression Quality: 90.0
Origin: X: -180.0
Y: 90.0
Spatial Reference: 4326  (4326)
Storage Info:
Storage Format: esriMapCacheStorageModeCompactV2
Packet Size: 128
Initial Extent:
XMin: -130.7812524395367
YMin: 4.054687511173704
XMax: 183.86719092977884
YMax: 108.82031446542626
Spatial Reference: 4326  (4326)

Full Extent:
XMin: -179.999999
YMin: -89.999999
XMax: 179.999999
YMax: 89.999999
Spatial Reference: 4326  (4326)

Units: esriDecimalDegrees

Supported Image Format Types: PNG32,PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,BMP


AntialiasingMode: None
TextAntialiasingMode: Force
Supports Dynamic Layers: false

Resampling: true

MaxRecordCount: 1000

MaxImageHeight: 4096

MaxImageWidth: 4096

Supported Query Formats: JSON, geoJSON, PBF

Supports Query Data Elements: true

Min Scale: 1.47748799285417E8

Max Scale: 140.904235158365

Supports Datum Transformation: true

The information for the "bad" map is as follows:

Height: 256

Width: 256
Levels of Detail: (Levels: 18)
      Level ID: 0
            resolution:0.351562506558
            scale: 147748799.285
      Level ID: 1 
            resolution:0.7578153279
            scale: 73874399.6427
      Level ID: 2 
            resolution:0.0878906266395
            scale: 36937199.8214
      Level ID: 3 
            resolution:0.0439453133197
            scale: 18468599.9107
      Level ID: 4 
            resolution:0.0219726566599
            scale: 9234299.97734
      Level ID: 5 
            resolution:0.0109863283299
            scale: 4617149.97767
      Level ID: 6 
            resolution:0.00549316416497
            scale: 2308574.98883
      Level ID: 7 
            resolution:0.00274658208248
            scale: 1154287.49442
      Level ID: 8 
            resolution:0.00137329104124
            scale: 577143.747209
      Level ID: 9 
            resolution:0.000686645520621
            scale: 288571.873604
      Level ID: 10
            resolution:0.00034332276031
            scale: 144285.936802
      Level ID: 11 
            resolution:0.000171661380155
            scale: 72142.9684011
      Level ID: 12 
            resolution:8.58306900776e-05
            scale: 36071.4842005
      Level ID: 13 
            resolution:4.29153450388e-05
            scale: 18035.7421003
      Level ID: 14 
            resolution:2.14576725194e-05
            scale: 9017.87105014

      Level ID: 15 
            resolution:1.07288362597e-05
            scale: 4508.93552507
      Level ID: 16 
            resolution:5.36441812985e-06
            scale: 2254.46776253
      Level ID: 17 
            resolution:2.68220906493e-06
            scale: 1127.2338817
Format:PNG
Compression Quality:75
Origin:
      X: -180
      Y: 90
Spatial Refferernce:4326

Initial Extent:
      Xmin: -180
      Ymin:-90
      Xmax:180
      Ymax90
      Spatial Refferernce:4326

Full Extent: 
      Xmin: -180
      Ymin:-90
      Xmax:180
      Ymax90
      Spatial Refferernce:4326

Units: esriMeters
Supported Image Format Types:PNG

They are both using projection EPSG 4326, and my code has specified that. I cannot figure out why the "good" map displays correctly and the "bad" map is displaying distorted. Any help or suggestion would be greatly appreciated. Thank you!

0 Answers
Related