VinayBa

Feature layer onclick and Layer on top of it

Discussion created by VinayBa on Feb 10, 2014
Latest reply on Feb 11, 2014 by VinayBa
HI All,

I am using feature-layer on-click in my application instead of map on-click in order to boost performance of the map. Since i am using snapshot mode and all graphics are loaded in the client i don't want to hit server again hence i thought of using feature-layer on-click functionality as when i tried to use map on-click things dint work as expected hence i started using feature layer on-click.My on click method is an below i am trying read some attribute of the graphic object clicked.

dojo.connect(featureLayer, "onClick", function(e){
       someMethod(e);
          });

function someMethod(evt){
        var graphic = evt.graphic;
        var countryName = graphic.attributes.CNTRY_NAME;
}



    WE need day night functionality in our application hence i used Day Night example which draws some polygon's on the map .The problem i am facing when i click on the map since i am using evt.graphic instead of getting featureLayer graphic object which as the attribute i think i am getting the ploygon which is drawn on the map.Hence i get below issue  
  attributes.CNTRY_NAME is not defined

Can anybody let me know how can i over come this scenario.

Outcomes