Select to view content in your preferred language

Limit popups to areas with features

1696
4
01-27-2016 08:22 AM
AshleyPeters
Occasional Contributor III

Good morning,

My problem is very similar to the one described in this thread. The one real difference is that I've got multiple services that I'm pulling in instead of a single service. I've also already have set my InfoTemplates in a slightly different manner:

var fishing = new ArcGISDynamicMapServiceLayer(fishingURL, fishingOptions);
    fishing.setInfoTemplates({
    1: { infoTemplate: inshoreInfoTemplate },
    2: { infoTemplate: offshoreInfoTemplate },
    3: { infoTemplate: offshoreInfoTemplate },
    4: { infoTemplate: navAidsInfoTemplate },
    5: { infoTemplate: rampsInfoTemplate},
    6: { infoTemplate: lakesInfoTemplate }
    });

Is creating an array the best way to go about turning the popups off in areas where there are no features, similar to what was suggested here?

I also have a single service with two base layers that I don't have popups set for. Is there a way to force 'no popups' for those?

Here's a link to the live version of this map that I am finalizing. I still have things I'm working on like the placement for the draw and measure tools, so be aware it's not perfect.

Thanks in advance!

Ashley

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

Ashley,

   If you can set the maps infoWindow "visibleWhenEmpty" property to false and the hideDelay (which by default is 1 second) to something like 300 and then when you click on the map in an area that does not have data the infoWindow will disappear quickly. Short of that I don't have any idea how to disable the infoWindow for certain areas.

0 Kudos
AshleyPeters
Occasional Contributor III

Thanks Robert. I had given that a try, but it basically flashes an empty popup on the screen. I find that more annoying than the popup that says 'No Information Available', so I'll probably end up leaving it as is.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ashley,

   Unfortunately this is just the work flow, as clicking on the map (behind the scenes) executes a Query to see if the clicked point on the map intersects with any feature that has a popup configured and if it does not intersect then the popup displays "No Information Available". Have you tried to take the hideDelay to 0 or 1?

0 Kudos
AshleyPeters
Occasional Contributor III

Yes, when I tried this as a possible solution last week, I set the hideDelay to 0. Instead of not appearing at all, the popup flashes onto the screen.

0 Kudos