Search code examples
javascriptjqueryarcgisesri

ArcGIS feature layer showing labels on arcgis tool not on web map


I am working on showing labels and features of feature layer on web map using javascript. Feature layer successfully showing labels in arcgis tool not on web map.

Can anyone help me to solve this issue? I am trying like this my code is here.

var featurelayer = new esri.layers.FeatureLayer(url of service, {
      mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
      outFields:["*"],      
      isVisible: true
});       
map.addLayer(featurelayer);

Solution

  • I myself got solution for this issue.

    Replaced feature layer with dynamic mapservice layer it solves the issue.

    Please find below code.

      var dynamic_layer= new 
     esri.layers.ArcGISDynamicMapServiceLayer(url of service,
             {
               mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
               outFields:["*"]
             });
    map.addLayer(dynamic_layer);
    

    Thanks kesava