AnsweredAssumed Answered

IdentifyTask always return no information available

Question asked by choilon on Nov 19, 2015
Latest reply on Nov 20, 2015 by rscheitlin

Hi folks,


I am trying to create simple web to show map with time slider and identify function. The time slider works fine, but the identify function always returns "no information available". I have no clue what's wrong.

Here is the code:

<!DOCTYPE html>



    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <!--The viewport meta tag is used to improve the presentation and behavior of the samples

      on iOS devices-->

    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">

    <title>Well completion dates for the Hugoton Gas Field Over Time</title>


    <link rel="stylesheet" href="">

    <link rel="stylesheet" href="">


      html, body, #mapDiv {







      #mapDiv {

        position: relative;




      #bottomPanel {

        left: 50%;

        margin: 0 auto;

        margin-left: -500px;

        position: absolute;

        bottom: 2.5em;





        border-radius: 4px;

        border: solid 2px #ccc;

        background-color: #fff;

        display: block;

        padding: 5px;

        position: relative;

        text-align: center;

        width: 1000px;

        z-index: 99;





    <script src=""></script>


      var map;


        "esri/map", "esri/layers/ArcGISDynamicMapServiceLayer",






        "esri/TimeExtent", "esri/dijit/TimeSlider",

        "dojo/_base/array", "dojo/dom", "esri/Color",


      ], function(

       Map, ArcGISDynamicMapServiceLayer, SimpleFillSymbol,

        SimpleLineSymbol, IdentifyTask, IdentifyParameters, Popup,

        TimeExtent, TimeSlider,

        arrayUtils, dom, Color, domConstruct

      ) {


        var identifyTask, identifyParams;



        var popup = new Popup({

          fillSymbol: new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,

            new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,

              new Color([255, 0, 0]), 2), new Color([255, 255, 0, 0.25]))

        }, domConstruct.create("div"));


        map = new Map("mapDiv", {

          basemap: "streets",

          center: [-101.15, 37.604],

          zoom: 9,

          infoWindow: popup



        map.on("load", mapReady);


        var opLayer = new ArcGISDynamicMapServiceLayer("");




        //apply a definition expression so only some features are shown

        var layerDefinitions = [];

        layerDefinitions[0] = "FIELD_KID=1000148164";




        //add the gas fields layer to the map




        map.on("layers-add-result", initSlider);


        function mapReady () {

          map.on("click", executeIdentifyTask);

          //create identify tasks and setup parameters

          identifyTask = new IdentifyTask("");



          identifyParams = new IdentifyParameters();

          identifyParams.tolerance = 3;

          identifyParams.returnGeometry = true;

          identifyParams.layerIds = [0, 2];

          identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_ALL;

          identifyParams.width = map.width;

          identifyParams.height = map.height;




        function executeIdentifyTask (event) {

          identifyParams.geometry = event.mapPoint;

          identifyParams.mapExtent = map.extent;



          var deferred = identifyTask


            .addCallback(function (response) {

              // response is an array of identify result objects

              // Let's return an array of features.

              return, function (result) {

                var feature = result.feature;

                var layerName = result.layerName;



                feature.attributes.layerName = layerName;

                var parcelTemplate = new InfoTemplate("Illegal Dumping Request","Address");


                return feature;










        function initSlider() {

          var timeSlider = new TimeSlider({

            style: "width: 100%;"

          }, dom.byId("timeSliderDiv"));



          var timeExtent = new TimeExtent();

          timeExtent.startTime = new Date("1/1/1921 UTC");

          timeExtent.endTime = new Date("12/31/2009 UTC");


          timeSlider.createTimeStopsByTimeInterval(timeExtent, 2, "esriTimeUnitsYears");





          //add labels for every other time stop

          var labels =, function(timeStop, i) {

            if ( i % 2 === 0 ) {

              return timeStop.getUTCFullYear();

            } else {

              return "";






          timeSlider.on("time-extent-change", function(evt) {

            var startValString = evt.startTime.getUTCFullYear();

            var endValString = evt.endTime.getUTCFullYear();

            dom.byId("daterange").innerHTML = "<i>" + startValString + " and " + endValString  + "<\/i>";






  <body class="claro">



    <div id="mapDiv">

      <div id="bottomPanel">

        <div id="timeInfo">

          <div>Hugoton Gas Field Wells from <span id="daterange">1921 to 2009</span> (Completion date)</div>

          <div id="timeSliderDiv"></div>