Select to view content in your preferred language

Potential Inter Widget Popup Rivalry ? What does the Popupmanager do?

658
3
02-26-2020 03:09 PM
Arne_Gelfert
Frequent Contributor

Inside, a custom widget I'm working on I would like select a feature in the map and an associated popup to open up, all based on user selection in a list of records. This is what I've got:

showFeature : function(featureSet){
        this.inherited(arguments);
        this.map.graphics.clear();

        var resultFeatures = featureSet.features;
        graphic = resultFeatures[0];
        
        var symbol = new SimpleFillSymbol();
        symbol.setColor(new Color([255,0,51,0.5]));
        
        graphic.setSymbol(symbol); 
        this.map.graphics.add(graphic);

        var infoTemplate = new InfoTemplate("...some configuration here ...");
        graphic.setInfoTemplate(infoTemplate);

        this.map.infoWindow.setFeatures([graphic]);
        this.map.infoWindow.show(graphic.geometry);

When this runs, the feature is selected, highlighted - in other words, the graphic makes it onto the map.

But there is no sign of the Popup, except for this message in Dev Tools:

I do see the PopupManager.js in my app's folder but I have no idea what is role is. The app contains a number OTB widgets that someone else on my team configured. So I'm suspecting there is another Popup  template configured and my widget is getting confused. Any pointers or references to some documentation are appreciated.

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Arne,

  1. So the first question I have is the geometry from the query point geometry? The reason I ask is because this.map.infoWindow.show is expecting a point geometry.
  2. Is the geometry in the same spatial reference as the map (i.e. did you specify the outSpatialReference in your query class)?
  3. I almost never use InfoTemplate in my code as it has been superseded by PopupTemplate class. 
0 Kudos
Arne_Gelfert
Frequent Contributor

Well, without my taking another look, you've probably answered my question.

  • This was not a point geometry.
  • I don't think I specified an outSpatialReference
  • The only reason I started using InfoTemplate rather than PopupTemplate is because I stumbled upon and then started working with an example online that seemed to fit my needs. I don't really know how they're different. I will try and use PopupTemplate and report back.

Thanks, as always.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Arne,

   Then just get the geometries extent center then.

0 Kudos