how to add a popup for image service, Javascript?

1878
6
11-12-2014 12:08 PM
MarceloOyuela
New Contributor III

Hello understand how to add a popup for a feature layer, but not for a image service layer. The image contains attribute table.

Regards

0 Kudos
6 Replies
TimWitt2
MVP Alum
0 Kudos
MarceloOyuela
New Contributor III

Yea, like that

0 Kudos
TimWitt2
MVP Alum

Check out the attached code. You will need an identify task.

0 Kudos
MarceloOyuela
New Contributor III

But my service it's a image service, regards

0 Kudos
MarceloOyuela
New Contributor III

i want to add a popup to this:

<script>

      var map;

      require([

        "esri/map", "esri/layers/ArcGISImageServiceLayer",

        "esri/layers/ImageServiceParameters", "dojo/parser", "dojo/domReady!"

      ], function(

        Map, ArcGISImageServiceLayer,

        ImageServiceParameters, parser

      ) {

        parser.parse();

        map = new Map("map", {

          basemap: "topo",

          center: [-71.2, 19

          ],

          zoom: 9

        });

        var params = new ImageServiceParameters();

        params.noData = 0;

        var imageServiceLayer = new ArcGISImageServiceLayer("http://portalgis.cathalac.org/arcgis/rest/services/Yaque/combine_wm/ImageServer", {

          imageServiceParameters: params,

          opacity: 0.75

        });

        map.addLayer(imageServiceLayer);

      });

    </script>

0 Kudos
LuisPedraz
New Contributor

Hi Marcelo,

you need to use esri.task.ImageServiceIdentifyTask. More info in the api documentation:

imageserviceidentifytask | API Reference | ArcGIS API for JavaScript

Good luck!

0 Kudos