Select to view content in your preferred language

Slow layer on webmap. How to switch from json to pbf output format?

793
4
07-27-2023 07:44 AM
Labels (3)
matteorizzi
Occasional Contributor

Hi! I am using ArcGIS Maps SDK for Javascript and I have a problem by calling a webmap from ArcGIS Portal. In the webmap there is a couple of feature layer and they are very slow due to the fact that the webmap load them by using json format. In the Rest properties I can see both of them supports the PBF format but I am not figuring out how to force this change.

How can I switch from json to pbf output format? Should I change something in the service or in the map?

Thank you

0 Kudos
4 Replies
MauroSantarossa
Emerging Contributor

Hi, did you find a solution? I have the same problem

0 Kudos
MauroSantarossa
Emerging Contributor

Quick update
In my case: The issue stemmed from the FeatureService, which listed only 'json' in the supportedQueryFormats attribute, even though both individual FeatureLayers included 'pbf' in their supportedQueryFormats. I resolved this by using an interceptor to forcibly add 'pbf' to the supportedQueryFormats of the FeatureService, with a code like this:

      require(["esri/config"], (esriConfig) => {
        esriConfig.request.interceptors.push({
          urls: /FeatureServer/,
          after: function (response) {
            response.data.supportedQueryFormats = "JSON,PBF";
          }
        });
      });

 

0 Kudos
MKa
by
Frequent Contributor

I think I am having this same issue.  I am using OOB Experience Builder and getting PBF errors on my queries.  My feature service only has "Supported Query Formats: JSON" while my layers have  "Supported Query Formats: JSON, geoJSON, PBF".  

Where do i make your above change?

0 Kudos
MauroSantarossa
Emerging Contributor

Hi MKa,
unfortunately my solution is implemented on a javascript application and not on ExpBuilder. In any case you can place the portion of code at any time before loading your FeatureService.

0 Kudos