Select to view content in your preferred language

Popup Bugs

2191
11
Jump to solution
10-17-2016 07:41 AM
LloydBronn
Frequent Contributor

Lately the popup is getting stuck. I'll click a feature and get a result. If I click anywhere else on the map, even on a different layer, I'll get the same result from the first click. If I toggle the layer on and off. this usually goes away. I also have the info template set to only show visible layers. When I first click a feature, it shows me results from every layer. Again, if I toggle layers on and off, this problem goes away. 

Is anyone else having similar issues?

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

The issue is that even though the additional layers (First Day High Temp Below 32(F), etc) are not visible since their group layers are turned off, the layers are still marked as visible. If you put a breakpoint in the script to see the value of visArr on the first click, you'll get the result [0,1,2,4,5,6,8,9]. Note that layers 3 and 7 (the group layers) are not included. This is how the service is set up.

 

Adding this (line 2) in solved that problem

 

var analysisLayer = new ArcGISDynamicMapServiceLayer(analysisURL);
analysisLayer.setVisibleLayers([0, 1, 2]);

View solution in original post

0 Kudos
11 Replies
RobertScheitlin__GISP
MVP Emeritus

Lloyd,

  I have not seen that issue. Check if you are getting an error in your browsers web console. Sounds like you are having an issue setting the popups content before you show the popup and the old content is left in it.

0 Kudos
LloydBronn
Frequent Contributor

Here are the errors from the console:

init.js:448 dojo/parser::parse() error Error: Tried to register widget with id==dijit_layout_BorderContainer_0 but that id is already registered(…)(anonymous function) @ init.js:448


init.js:426 Uncaught Error: No region setting for layerList

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lloyd,

   So if you correct that error then your popup issue will likely go away. I can not help dirrect you to the errors origin with seeing your code though.

0 Kudos
LloydBronn
Frequent Contributor

 I tried to add a region setting to layerList, but it forced the TOC over to the side into a separate pane.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lloyd,

   Try this (line 2):

            function executeIdentifyTask(event) {
                map.infoWindow.clearFeatures();
                identifyParams.geometry = event.mapPoint;
0 Kudos
KenBuja
MVP Esteemed Contributor

You also have an error in your function arguments, with SimpleMarkerSymbol and SimpleLineSymbol in the wrong order

LloydBronn
Frequent Contributor

I fixed the order of the function arguments, but  "map.infoWindow.clearFeatures();" didn't fix the bug. The first time I click on the map the popup shows all the layers, even with only one layer visible. When I toggle the layer on and off the popup only shows the visible layer. 

0 Kudos
KenBuja
MVP Esteemed Contributor

The issue is that even though the additional layers (First Day High Temp Below 32(F), etc) are not visible since their group layers are turned off, the layers are still marked as visible. If you put a breakpoint in the script to see the value of visArr on the first click, you'll get the result [0,1,2,4,5,6,8,9]. Note that layers 3 and 7 (the group layers) are not included. This is how the service is set up.

 

Adding this (line 2) in solved that problem

 

var analysisLayer = new ArcGISDynamicMapServiceLayer(analysisURL);
analysisLayer.setVisibleLayers([0, 1, 2]);

0 Kudos
LloydBronn
Frequent Contributor

OK, thanks. That does help with the popup issue. But it also turns on all the visible layers on when the map loads. I have the service set up to only have the topmost layer or group toggled on at first.  

0 Kudos