Select to view content in your preferred language

Apply the all layer styles to our app

34
0
2 hours ago
RomanHryn
New Member

Hi! We are new in Arc Gis and we use SDK to maintain the VUE 2 project. We have a list of different layers that we fetch and then switch on/off via toggles. Once the layer is switched on I create a new FeatureLayer and then add it to the map instance. 
So it looks like this in the end

      const layerObject = {
        url: customLayerObj.url
        // renderer: CONSTANTS.CUSTOM_LAYER_CONFIG
      }
      this.mapFilters[customLayerObj.name] = new FeatureLayer(layerObject)
      this.mapFilters[customLayerObj.name].refreshInterval = customLayerObj.refresh_rate
      this.view.map.add(this.mapFilters[customLayerObj.name])



In the dashboard, we create polygons, dot layers, etc. We define styles for polygons, dots - colours and specific Arcade filters - range when the layer lives for example. But once we turn on the toggle it displays layers (e.g. polygons in a very default way - check attachments) without any styles or filters applied.

There is a way to define the styles config on the client with renderer (see commented line of code) and it works. But we have huuuge amount of layers with different colours and conditions. We cannot predict what we will add. Is there a way to get all layers how they are with filters and conditions straight from the API? So the view of the layer in the app will reflect the view of the layer in the dashboard without any client configs.

  

 

 

 

RomanHryn_2-1721836047111.pngRomanHryn_0-1721836364921.png

 

 

 

0 Kudos
0 Replies