Select to view content in your preferred language

Multi-layer feature service with Custom Data Feeds

316
0
10-28-2024 01:37 PM
MarynaBerg
New Contributor

I am struggling to create a multi-layer feature service with Custom Data Feeds. Function getData returns a geojson of this structure: 

const geojson = {
      type: "MultiLayerFeatureCollection",
      layers: [
        {
          layerName: "Agriculture Layer 0",
          type: "FeatureCollection",
          features: layer0Features,
          metadata: layer0Metadata
        },
        {
          layerName: "Agriculture Layer 1",
          type: "FeatureCollection",
          features: layer1Features,
          metadata: layer1Metadata
        }
      ]
    };
 
I see the layers being read properly (with all the fields etc) when i access them on localhost:8080/nbfsprovider/rest/services/:host/:id/FeatureServer/layers, but when i try to access them individually localhost:8080/nbfsprovider/rest/services/:host/:id/FeatureServer/0 it does not seem like they are read: there is no data and only one field registered - OBJECTID. 
 
Since I have a possibility to check layers, then I suppose that it should be possible to create a feature class with multiple layers. So I guess the problem should be somewhere in the json structure passed as the output of the model.js.
0 Kudos
0 Replies