ESRI JavaScript API FeatureLayer Click Event

2075
0
10-28-2014 09:19 AM
BrandonColeman
New Contributor III

I am using FeatureLayers in the API to load in a layer. I have an info template set for the layer for identifying individual features.

I am trying to disconnect the click event from the layer while I am drawing a polygon for another tool. However, I haven't found a good way to disconnect that handler since it isn't one I assign.

I have tried layer.disableMapEvents() which didn't work. I don't have an info template set for the map itself either, so I don't think that one is firing.

I have searched through some other posts here, and so far the only solution I have found is to attach another handler to the map click event and call map.infoWindow.hide() while I am doing the drawing. This still goes through the identify process but keeps the window away.

I also tried calling the map.graphics.disableMouseEvents(), but that doesn't work either.

I am looking for a way to either handle the map click event myself and disconnect ESRI's standard way for the FeatureLayer. I just want to be able to shut off identifying of features temporarily.

A way to disconnect the event and hook it up again would be great. That would help if I want to attach it to another mouse event, too.

 

Posted on ESRI JavaScript API FeatureLayer Click Event - Geographic Information Systems Stack Exchange  also

0 Kudos
0 Replies