Why is there a delay on my TooltipDialog popup?

247
0
10-01-2019 08:39 AM
JustinBridwell2
Occasional Contributor II

I am "dijit/TooltipDialog" and "dijit/popup" in my web mapping app on a few geojson layers.

    

dialog = new TooltipDialog({    
    id: "tooltipDialog",    
    style: "position: above; width: 175px; font: normal normal normal 10pt Helvetica;z-index:100" 
}); 
dialog.startup();
....  
_getGeoJson: function (geojson) {        
    // Check data        
    if (geojson.type !== "FeatureCollection" || !geojson.features) {            
        console.error("GeoJsonLayer Error: Invalid GeoJSON FeatureCollection. Check url or data structure."); 
        return;        
    }        
    // Convert GeoJSON to ArcGIS JSON        
    var arcgisJson = this._terraformerConverter(geojson);        
    // Add graphics to layer        
    this._addGraphics(arcgisJson);        
    //Add tooltip on mouse-over        
    this.on("mouse-over", function (evt) {            
        var content = esriLang.substitute(evt.graphic.attributes);            
        dialog.setContent(content);             
        domStyle.set(dialog.domNode, "opacity", 0.9);            
        dijitPopup.open({                
            popup: dialog,
            x: evt.pageX,
            y: evt.pageY  
        });        
    });        
    //Remove tooltip on mouse-out        
    this.on("mouse-out", function (evt) {                
    //map.graphics.clear();                
        dijitPopup.close(dialog);        
    });      
}

All of this works fine...if the browser console (the developer's console) is open. No problems, tooltips display and disappear as you mouse over or mouse out of the respective layers. However, if the console is not open, there is a 10-30 second delay before the tooltips will appear and if the extent is changed, or you pan, or you zoom in/out, the delay also occurs. No bugs are being thrown and, like I said, it doesn't occur when the browser console is open, so its kinda hard to debug. Note: I am running this in an ASP.Net app from my local (its not on a server yet) using arcGIS Javascript API 3.29 and related dependencies. Why would this occur and how might I resolve it?

0 Kudos
0 Replies