简体   繁体   中英

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);

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM