Select to view content in your preferred language

ArcGis Esri Featured Layer Not loading, Failed to load layer

557
0
04-26-2022 12:21 PM
abdulqayyum
New Contributor

Hi all i am facing error in arcgis esri feature layer Here is the code i also read the arcgis api documnetation but never found any solution about this error,

`import FeatureLayer from "@arcgis/core/layers/FeatureLayer"
import GraphicsLayer from "@arcgis/core/layers/GraphicsLayer"

export default class MyLayer {
  constructor(contourServiceUrl, apiToken) {
    this.layer = new FeatureLayer({
                      apiKey: apiToken,
                      url: contourServiceUrl,
                      minScale: 5000,
                      maxScale: 0,
                      labelingInfo: [{
                        // autocasts as new LabelClass()
                        symbol: {
                          type: "text",  // autocasts as new TextSymbol()
                          color: "white",
                          font: {  // autocast as new Font()
                            size: 8,
                            weight: "bold"
                          }
                        },
                        labelPlacement: "center-along",
                        labelExpressionInfo: {
                          expression: "$feature.contourelevation"
                        }
                      }]});

                      this.graphicLayer = new GraphicsLayer()
                   }
                  }`

The Error

**[esri.layers.FeatureLayer] #load() Failed to load layer (title: 'New paltz ny contours', id: '180673c6dc2-layer-1')**

 
Tags (1)
0 Kudos
0 Replies