AnsweredAssumed Answered

PopUp on FeatureLayer with severeal overlapping graphics

Question asked by michaellodes on Sep 21, 2017
Latest reply on Nov 1, 2017 by TSolow-esristaff

Hi all,

I am working with JavaScript 4.4. With a FeatureLayer from URL clicking on overlapping graphics, the popUpTemplate shows all popUps (1 to 4... for example). Using a FeatureLayer with client side graphics ("source: features"), the popUpTemplate shows just the information about the feature lying on the top of them. Is it a bug?

 

You can see my code below. Compare the two layers defined in my code by commenting and uncommenting please.


Best Regards,

Michael

 

require([
  "esri/Map",
  "esri/views/MapView",
  "esri/layers/FeatureLayer",
  "esri/renderers/SimpleRenderer",
  "esri/symbols/SimpleMarkerSymbol",
  "esri/geometry/Point",
  "dojo/domReady!"
], function(
  Map, MapView, FeatureLayer, SimpleRenderer, SimpleMarkerSymbol, Point
) {


var features = [     
    {            
   
     geometry: new Point({
        latitude: 38.726941, 
        longitude: -101.883768

      }),  
      attributes: {
        ObjectID: 1
       
    }
  },
         
          {            
   
     geometry: new Point({
        latitude: 38.711841, 
        longitude: -101.883668

      }),  
      attributes: {
        ObjectID: 2
       
    }
  },

{            
   
     geometry: new Point({
        latitude: 38.781641, 
        longitude: -101.883968

      }),  
      attributes: {
        ObjectID: 3
    }
  },
{            
   
     geometry: new Point({
        latitude: 38.726991, 
        longitude: -101.883748

      }),  
      attributes: {
        ObjectID: 4
    }
  }
               
];



var renderer = new SimpleRenderer({
   
     symbol: new SimpleMarkerSymbol({
        color: [139,69,19],
        size: "15pt",
        outline: { // autocasts as new SimpleLineSymbol()
          color: [255, 255, 255],
          width: 2
        }
      })
   
    });


//  var layer = new FeatureLayer({
//
//    url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/US_counties_employment_2016/FeatureServer/0",
//    outFields: [ "CIVLBFR_CY", "NOT_LABORFORCE_16", "COUNTY", "STATE", "POP_16UP", "UNEMPRT_CY", "UNEMP_CY", "EMP_CY" ],
//    renderer: renderer,
//    popupTemplate: {
//      title: "Title",
//      content: "Test"
//  }
//  });

var layer = new FeatureLayer({
    fields: [
        {
        name: "ObjectID",
        alias: "ObjectID",
        type: "oid"
        }
    ],
    objectIdField: "ObjectID",
    geometryType: "point",
    source: features, 
    renderer: renderer,
    popupTemplate: {
      title: "Title",
      content: "Test"
    }
 
});




  var map = new Map({
    basemap: "gray",
    layers: [ layer ]
  });

  var view = new MapView({
    container: "viewDiv",
    map: map,
    center: [-101.883768, 38.726941],
    zoom: 6
  });





});

Outcomes