AnsweredAssumed Answered

this.map.infoWindow ERROR

Question asked by warleymendes@gmail.com on Jan 10, 2018
Latest reply on Jan 10, 2018 by warleymendes@gmail.com

Hi Guys, 

I'm implementing a widget on the Web AppBuilder.
In this widget I'm trying to create a simple infoWindow, but i'm getting the follow erro:

 

Uncaught TypeError: Cannot read property 'infoWindow' of undefined
   at Object.<anonymous> (Widget.js?wab_dv=2.4:169)
   at Object.c [as onMouseOut] (init.js:119)
   at Object._onMouseOutHandler (init.js:962)
   at SVGGElement.<anonymous> (init.js:63)

 

I've found the code on link:

Show info window on mouse hover | ArcGIS API for JavaScript 3.23 

 

My code:

dojo.connect(this.map.graphics, "onMouseMove", function(evt) {
   var g = evt.graphic;

   this.map.infoWindow.setTitle("Matrícula: "+ g.attributes["gisc_core.UGISC.LIGACAO.MATRICULA"]);
   this.map.infoWindow.setContent(
      "Nome: "+ g.attributes["gisc_core.cadastro.vwLigacaoSicat.NOME"] +
      "<br>Status: "+ (g.attributes["gisc_core.UGISC.LIGACAO.SIT_LIGACAO_AGUA"] == "1"? "Ativa": "Cortada")
   );

   this.map.infoWindow.show(evt.screenPoint,this.map.getInfoWindowAnchor(evt.screenPoint));
});

dojo.connect(this.map.graphics, "onMouseOut", function() {this.map.infoWindow.hide();} )

 

How can I create a  infoWindow on the Web AppBuilder?

 

Thanks,

Waley

Outcomes