AnsweredAssumed Answered

Identify still showing

Question asked by rhyck.m on Sep 17, 2014
Latest reply on Sep 17, 2014 by rhyck.m

I would like to deactivate the identify when doing measurement.



here is my function identify code:


 function initFunctionality() {
        //map.on("click", doIdentify);
        dojo.connect(map, "onClick", doIdentify);
        identifyTask = new IdentifyTask(".../MapServer");

        identifyParams = new IdentifyParameters();
        identifyParams.tolerance = 3;
        identifyParams.returnGeometry = true;
        identifyParams.layerIds = [21, 54, 36];
        identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_ALL;
        identifyParams.width = map.width;
        identifyParams.height = map.height;

        map.infoWindow.resize(650, 200);
        map.infoWindow.setTitle("Utilities Identify Results");

        symbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,
          new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
            new Color([255, 0, 0]), 2),
          new Color([255, 255, 0, 0.25]));



and I am calling this function on the following event:

 //dojo.connect(map, "onLoad", initFunctionality);
    //map.on("load", initFunctionality);
    map.on("layers-add-result", initFunctionality);


This makes the identify window showing up each time I click on the map. I would like to only call the identify only when I click on the identify button on the toolbar to activate the identify function. But when I try to call the initFunctionality() from a button click event, the identify won't work. for some reason, it is only working when called from map.on("load") or map.on("layers-add-result").