0

When adding the feature layer with URL, enabling defaultPopUpTemplate does not open any pop-up. When I click on the feature the feature gets highlighted however, nothing opens up.

I am attaching the code:

    require(["esri/config", "esri/Map", "esri/views/MapView", "esri/layers/FeatureLayer"], function(esriConfig, Map, MapView, FeatureLayer){
    
    esriConfig.apiKey = ""

    var map = new Map({
        basemap: "arcgis-topographic"
    });

    var view = new MapView({
        map: map,
        center: [77.18108, 28.53337],
        zoom: 15,
        container: "viewDiv"
    })

    view.popup.defaultPopupTemplateEnabled = true;

    const floralayer = new FeatureLayer({
        url: "XXXXXXX",
    });

    map.add(floralayer)
    
    });

How can I do this?

6
  • It should work. Without your actual feature layer it's impossible to say why it does not work for you. Any errors in the browser debugger console or network section?
    – TomazicM
    Sep 22 at 20:53
  • I have tried with a service from sample server 6, still facing the same issue, I guess there is something that I am missing.
    – gis
    Sep 28 at 9:35
  • Which version of JS SDK are you using?
    – TomazicM
    Sep 28 at 11:47
  • See simple JSFiddle: jsfiddle.net/TomazicM/sjancrf2. Works without problems.
    – TomazicM
    Sep 28 at 12:16
  • I am using 4.27, this looks good however, can you try adding feature service instead of map service and then check. I tried replacing the URL present in JS Fiddle with this, sampleserver6.arcgisonline.com/arcgis/rest/services/…, however, the features are not loading.
    – gis
    Sep 29 at 9:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.