POST
|
Thanks for your quick reply, Riyas. One thing I found just now was, the basic map viewer seems reads layers information from the response.ItemData.operationallayers, so to make my layers appear in the legend and layers picker, I also need add according infomation to the response.ItemData.operationallayers object... Now I found it's not easy to generated a qualified "operational layer" object, my code is like below:
response.itemInfo.itemData.operationalLayers.push({
id : "testLayer",
title : "Test Layer",
visilbility: true,
layer : gl,
url : "",
opacity : 0.75
});
It misses some properties compare with the "operational layer" object in server response, e.g. the resourceInfo propety. So there were exceptions, in debugger it shows: "TypeError: Unable to get property 'on' of undefined or null reference at k (http://js.arcgis.com/3.10/init.js:213:276) at _layerEvent (http://localhost/ArcGISMeshupApp/js/TableOfContents.js:223:13) at _setLayerEvents (http://localhost/ArcGISMeshupApp/js/TableOfContents.js:289:25) at _createList (http://localhost/ArcGISMeshupApp/js/TableOfContents.js:189:17) at _init (http://localhost/ArcGISMeshupApp/js/TableOfContents.js:352:13) at startup (http://localhost/ArcGISMeshupApp/js/TableOfContents.js:59:17) at _addLayers (http://localhost/ArcGISMeshupApp/js/main.js:399:21) at Anonymous function (http://localhost/ArcGISMeshupApp/js/main.js:154:25) at Anonymous function (http://js.arcgis.com/3.10/init.js:174:14) at k (http://js.arcgis.com/3.10/init.js:195:425)" I'm not sure whether there are any official means to generate this "operational layer" object? Riyas Deen
... View more
08-19-2014
12:43 AM
|
0
|
0
|
696
|
POST
|
Thanks Riyas. The problem with the first solution is, the map is not from us, and we are merely trying to add custom layers on top of it. So I guess I would take you solution #2. Just to confirm, according to your code above, the response from ArcGIS online/ArcGIS server portal contains the esri/map object, so I can inject my custom layers at that point right?
... View more
08-18-2014
11:19 PM
|
0
|
2
|
696
|
POST
|
Hi Riyas, Thanks for your kind reply, I'm also currently looking for this information. However, the problem our project facing is, we are using the Basic Viewer instead of the Map object (esri/map), and the basic viewer seems use the web map internally which doesn't accpet CSVLayer or any other feature layers as parameters directly. So my question is, how can we make the Basic Viewer recognize my customized feature layer? BTW, I took a look at the code which generates the map (the createMap function in esri/arcgis/utils script), but seems the script is minimized, do you have source map for the script? Thanks in advance.
... View more
08-18-2014
12:24 AM
|
0
|
4
|
696
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|