Select to view content in your preferred language

Dynamic Layer Parameter

665
2
Jump to solution
08-22-2012 06:24 AM
sapnas
by
Frequent Contributor
I'm working on some of the wpf sample codes and in one of the sample code the application utilizes dynamic layer. I browsed to the dynamic layer url (http://servicesbeta4.esri.com/arcgis/rest/services/USA/MapServer/dynamicLayer) from internet explorer and passed in the following layer parameter. Clicking "get dynamic layer" button causes 'layer' param invalid error. I followed the instruction from http://resources.arcgis.com/en/help/rest/apiref/dynamicLayer.html link and did not find any issue. Am I missing any attributes in the layer parameter.

[HTML]
{"source":{
"type":"dataLayer",
  {
      "type": "dataLayer",
      "dataSource":    
   {
         "type": "table",
         "workspaceId": "MyDatabaseWorkspaceIDSSR2",
         "dataSourceName": "egdb.DBADMIN.USLakes"
           }
      }
}
}
[/HTML]
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
TanuHoque
Esri Regular Contributor
here is the correct syntax:

{     "source": {         "type": "dataLayer",         "dataSource": {             "type": "table",             "workspaceId": "MyDatabaseWorkspaceIDSSR2",             "dataSourceName": "egdb.DBADMIN.USLakes"         }     } }

View solution in original post

0 Kudos
2 Replies
TanuHoque
Esri Regular Contributor
here is the correct syntax:

{     "source": {         "type": "dataLayer",         "dataSource": {             "type": "table",             "workspaceId": "MyDatabaseWorkspaceIDSSR2",             "dataSourceName": "egdb.DBADMIN.USLakes"         }     } }
0 Kudos
XuejinRuan
Occasional Contributor

Hi Tanu,

I have a table with a few columns as below:

XuejinRuan_0-1715030863643.png

 

It will return proper response when I use the following syntax:

{"source": {
 "type": "dataLayer",
 "dataSource": {
  "oidFields": "ObjectID",
  "query": "SELECT * FROM dbo.test2_datetime2",
  "type": "queryTable",
  "geometryType": "esriGeometryPoint",
  "workspaceId": "can_2023"
 }
}}

 

However, if do not use SELECT *, instead, if I include spatial column name in my select statement, it will return an error:

XuejinRuan_1-1715030982148.png

 

Do you have any idea what is going on?

 

Thank you!

 

 

0 Kudos