I am very new to ArcGIS in general, any help is appreciated!
I have a dynamic map service that has only one layer that shows the asset related work order. This layer is a spatial view created by joining a feature class table(a gis asset table) to a non spatial database table(work order) on a matching field ASSET_NAME. I want to set up the the pop up window so when user click on the map, the work order associated to the clicked asset will pop up.
I have searched this forum and found the following thread:
This example works with our other dynamic map services that do not have layers from spatial views. But for the dynamic map service that has spatial view as the query layer, i can't seem to get it to work:
function queryCounties(e) { // build an extent around the click point var pad = map.extent.getWidth() / map.width * 3; var queryGeom = new esri.geometry.Extent(e.mapPoint.x - pad, e.mapPoint.y - pad, e.mapPoint.x + pad, e.mapPoint.y + pad, map.spatialReference); var q = new esri.tasks.Query();
// use the deferred returned from the query task to set // the popup features map.infoWindow.setFeatures([def]); // show the popup map.infoWindow.show(e.screenPoint, map.getInfoWindowAnchor(e.screenPoint)); } dojo.ready(init); </script> </head> <body class="tundra"> <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline',gutters:false" style="width: 100%; height: 100%; margin: 0;"> <div id="map" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'"> </div> </div> </body> </html>
i am able to see query result from rest point of the map service,for example
However, when I run my code, it seems there is no feature returns and the pop up window just say"no information available". here is what I get from Chrome's network window: