MapImageLayer dataSource query

532
1
04-08-2021 01:14 AM
yersenokan
New Contributor

I am trying  post a query  to MapImageLayer but no data is displayed on the map.

 

 

var layer = new MapImageLayer({
                                url: "url",
                                sublayers: [{
                                    id: 1,
                                    source: {
                                     
                                        type: "data-layer",
                                      
                                        dataSource: {
                                            type: "query-table",
                                            query: "query?where=globalid=%27{248879D5-1651-4E4A-993A-CEA27FD17382}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&havingClause=&gdbVersion=&historicMoment=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=xyFootprint&resultOffset=&resultRecordCount=&returnTrueCurves=false&returnExceededLimitFeatures=false&quantizationParameters=&returnCentroid=false&sqlFormat=none&resultType=&featureEncoding=esriDefault&datumTransformation=&f=html"
                                        }
                                    }
                               
                                }]
                            });

 

0 Kudos
1 Reply
Noah-Sager
Esri Regular Contributor

Hi @yersenokan, it's difficult to tell without more information. One thing I notice is that the workspaceId is not defined in the code snippet. Do you have a simplified app that shows the issue? If you could share a link to a Codepen, that would be very useful.

For other resources, the doc on QueryTable might be useful: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#Quer...

And this sample shows how it looks in action: https://developers.arcgis.com/javascript/latest/sample-code/layers-dynamicdatalayer-query-table/

 

0 Kudos