Popup questions - only showing if I'm zoomed in very close, etc.

773
2
03-09-2019 08:09 PM
KarenEllett
Occasional Contributor

I am currently pulling in a map service as a MapImageLayer.  I'm using the IdentifyTask to display results in a popup; however, I'm having a few issues:

  1. I've noticed that if I have any custom actions in the popup, it no longer shows that action neatly next to the "Zoom To" action as though there's not room.  It hides it behind the "..." menu.  In order to have the custom actions shown directly in the popup and not have to click through, I have to set overwriteActions to true and get rid of "Zoom To" entirely.  Is there an option somewhere i can change, so that both can show?  
  2. When using the popup to show results of the identify task, it won't show the feature (list) menu.  There are still arrows so that I can cycle through results, but there's no longer the hamburger menu style button to show me a list of features to choose from.  If i set featureMenuOpen to true in the popup template, it IS there when I first click on something; but once I choose a feature, it disappears and I'm back to arrows only.  Any ideas on why that is, or how to re-enable the feature menu?
  3. For some of the layers in my MapImageService, when I click on the feature, it won't show a popup for it... unless i zoom in very, very close.  The layer itself shows up when I'm zoomed out, but when I click, it returns nothing.  One in particular is a polygon layer (parcels) and I can click in the middle of a very large one, so pixel tolerance shouldn't be an issue.  However, I still have to zoom in very close in order to get a popup for it.  Any suggestions on how to get popups to show for these without having to zoom in?  It doesn't matter if I have the layer options set to "visible" or "all", the behavior remains the same.

Relevant code snippets:

mapView = new MapView({
   container: app.containerMap,
   map: map,
   center: app.center,
   zoom: 9,
   padding: app.viewPadding,      
   popup: {
      highlightEnabled: true,
      featureNavigationEnabled : true
   }
});

var tLayer= new MapImageLayer({
   url: "https://server/arcgis/rest/services/tViewerr/tLayers/MapServer"
});
map.add(tLayer)

mapView.on("click", executeIdentifyTask);

function executeIdentifyTask(event){
   identifyURL = tLayer.url;
   identifyTask = new IdentifyTask(identifyURL);
   identifyParams = new IdentifyParameters();
   var identifyActions = [];
   identifyParams.tolerance = 15;

   identifyParams.returnGeometry = true;
   identifyParams.layerIds =    [2,3,4,5,6];
   identifyParams.geometry = event.mapPoint;
   identifyParams.mapExtent = mapView.extent;
   identifyTask.execute(identifyParams).then(function(response){
      var results = response.results;
      return results.map(function(result){
         var feature = result.feature;
         identifyActions = createIdentifyActions(result);
         var layerName = result.layerName;
         feature.popupTemplate = {
            title: layerName,
            content: "{*}",
            overwriteActions: true,
            actions: identifyActions
         };
      return feature;
   });
}).then(showPopup);

function showPopup(response){
   if (response.length > 0) {
      mapView.popup.open({
         features: response,
         location: event.mapPoint
      });
      mapView.popup.on("trigger-action", triggerPopupActions)
   }

}

Thank you!

2 Replies
WillFolsom
New Contributor

Hi there, I was wondering if there was any update on this. I too have noticed the hamburger disappear. Bug or no longer supported?

0 Kudos
Chris_Bean
New Contributor

Hey, any issues to fix this yet do we know? I'm pulling in a popup for a raster, from a layer hosted in the Atlas (URL), same issue occurring, pop up only shows when zoomed right in

0 Kudos