Failed to resolve layer view when loading custom tile layers as basemap

2682
2
08-14-2019 10:07 PM
SachithSilva
New Contributor

Hi,

I got an error when loading Tile layers as a custom base-map with  projected coordinate systems( spatial reference 25833 ) in ArcGisJS API 4.10.Error is as below

 dojo.js:310 [esri.views.2d.layers.TileLayerView2D] #resolve() Failed to resolve layer view (layer title: 'xxxxx',   id: 'xxxxxx') 

 message: "The spatial reference of this layer does not meet the requirements of the view"

 name: "layerview:spatial-reference-incompatible"

Is there any limitation to load projected coordinate type spatial references Tile layer in arcgis js api.

Thank you !!

0 Kudos
2 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

Services with spatial reference in UTM zones (25833) can be used as basemaps. I am assuming your workflow is like the following. I have tested the following workflow with a cached map service with wkid of 25833 and confirmed that it works in 4.10.

var layer = new TileLayer({
  url:  "yourrurl"
});


var basemap = new Basemap({
  baseLayers: [layer]
});

var map = new Map({
  basemap: basemap
});

Could you please provide a simple test case if you cannot get it work? 

Thanks, 

-Undral

ShifanCheng
New Contributor

I have met the similar problem too.

I have adopted an image tile layer as basemap, and want to add a scene layer to the map. It seems that I could only load one layer, the basemap or the scene layer, or it would report an error that indicates the failure of creating a layer view for my scene layer due to  'spatial-reference-incompatible'.

However, if I only load the layer which contains a 3D building Object, it could load the picture we need.

By the way, the basemap and scene layer use the same projected coordinate system, a customized coordinate system 4547.

Here is my test code:

 

var imgBasemap = new Basemap({
baseLayers: [imageLayer],
title: "影像底图",
id: "imgBasemap"
});

const map = new Map({
// basemap: imgBasemap,
ground:new Ground({
layers:[imageLayer]
})
});
map.spatialReference = imgBasemap.spatialReference;

const view = new SceneView({
container: "viewDiv", // Reference to the DOM node that will contain the view
map: map, // References the map object created in step 3

// Add scene layer
var sceneLayer = new SceneLayer({
url: url
});


map.add(sceneLayer);

 

I have omitted the definition of URL and basemap due to the privacy concern. They are offered by the third party. 

May you give me some advice?

Thanks,

-Shifan

 

0 Kudos