AnsweredAssumed Answered

Multiple Draw objects causing tooltip cut-off

Question asked by bforbhavin on Nov 5, 2014
Latest reply on Nov 11, 2014 by khutchins-esristaff

It seems there is a bug in ArcGIS JS API (3.10) when instantiating multiple Draw objects and hovering over on the map. When it hover over, it shows tooltip cut-off (see attached).

 

Steps to reproduce:

1) Go to ArcGIS API for JavaScript Sandbox

2) Replace activateTool and createToolbar in this example with the following code

 

        function activateTool() {

          var tool = this.label.toUpperCase().replace(/ /g, "_");

          toolbar = new Draw(map);

          toolbar.activate(Draw[tool]);

          toolbar.on("draw-end", addToMap);

          toolbar.on("draw-complete", function(){

          });

          map.hideZoomSlider();

        }

 

 

        function createToolbar(themap) {

           //toolbar = new Draw(map);

          // toolbar.on("draw-end", addToMap);

        }

 

3) Run the code.

4) Click on Circle and hover over the map. It will show tooltip properly.

5) Click on Freehand Polygon and hover over the map. It will show tooltip cut-off (see attached).

 

Can dev team confirm whether it's a bug? Is it not valid to create multiple instances of Draw object? I created in my application on click of the tool. Also, I need to create drawing tool for multiple functionality. e.g. If I click on toolbar icon in my application for one line tool then it will allow to sketch the drawing, whereas another toolbar icon will allow line tool to perform measurement. Callback functions are configured differently in both the cases. Instead of keeping track of action, I preferred to create another Draw object in separate function.

Attachments

Outcomes