Select to view content in your preferred language

How to disable click on featureLayer ?

1715
8
07-22-2014 12:38 AM
Enguerranddes_Vaux
Regular Contributor

i would like to do it in order to edit graphics and not have the infoWindow pops up when i edit a graphic. thx for any help

I have try .disableMouseEvents(); but it's not working

0 Kudos
8 Replies
TimWitt2
MVP Alum

To solve that, I use right click to edit graphics. Would that be an option?

Advanced Draw - JSFiddle

0 Kudos
Enguerranddes_Vaux
Regular Contributor

it's a good option but i have to use the left click

0 Kudos
TimWitt2
MVP Alum

Can you post your code?

0 Kudos
Enguerranddes_Vaux
Regular Contributor

My listener :

this.graphicLayerObj.on("click",lang.hitch(this,function(evt){

                if(dom.byId("drawingContainer").innerHTML=="" && domStyle.get(widgetTool.drawingToolsNode,"backgroundColor")=="rgba(71, 71, 71, 0.4)"){

                    this.activateToolbar(evt.graphic);

                }

            }));

activateToolbar: function(graphic) {

            var tool = 0;

            tool = tool | Edit.MOVE;

            tool = tool | Edit.EDIT_VERTICES;

            tool = tool | Edit.SCALE;

            tool = tool | Edit.ROTATE;

            // enable text editing if a graphic uses a text symbol

            if (graphic.symbol.declaredClass === "esri.symbol.TextSymbol") {

                tool = tool | Edit.EDIT_TEXT;

            }

            //specify toolbar options

            var options = {

                allowAddVertices : true,

                allowDeleteVertices : true,

                uniformScaling : true

            };

            editToolbar.activate(tool, graphic, options);

        },

0 Kudos
TimWitt2
MVP Alum

Instead of turning off the click on featureLayer, you could disable the pop-ups while you edit, as outlined here?

0 Kudos
Enguerranddes_Vaux
Regular Contributor

I have 5 featureLayers how to do it for each ?

0 Kudos
TimWitt2
MVP Alum

How do you create your pop-ups?

0 Kudos
Enguerranddes_Vaux
Regular Contributor

i'm not creating them i get the map with the arcgisUtils.createMap(); method

0 Kudos