Select to view content in your preferred language

ESRI JS API 4.27: scale based symbology not systematically honoured depending on instantiation

780
5
06-14-2023 09:36 PM
NicolasGIS
Regular Contributor

Hello,

Using ArcGIS Enterprise 11.1, I published a scaled based symbology FeatureServer and MapServer:

https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/scale-based-symbol-classes.ht...

I created a JS API 4.27 application and noticed that my FeatureLayer does not honour this scaled based symbology. Digging a little more, I understood that it depends on its instantiation:

- Instantiation with portalItem, works:

const poiFLLayerByPortalItem = new FeatureLayer({
   portalItem: {
      id: "c3d95b4ce5df4882a6f73723492af00f"
    }
});
 
- Instantiation with a featureServer URL does not work:
 
const poiFLLayerByFLId = new FeatureLayer({
});
 
- Instantiation with a MapServer URL does not work either:
 
const poiFLLayerByMLId = new FeatureLayer({
    url: "https://ags.company.com/arcgis/rest/services/General/POI_TEST/MapServer/0"
});
 
It looks a bit weird to me: I would expect all featureLayer to be consistent in behaviour when consuming the same service. Is it a bug or somehow a feature I would miss ? Should a case be opened ?
 
Thanks,
 
Nicolas
 
PS: can share a URL illustrating this issue to JS API team if you want to have a quick look
0 Kudos
5 Replies
KristianEkenes
Esri Regular Contributor

Can you share the difference in renderer JSON saved to the service versus the renderer on the layer's portal item? It seems to be related to that.

0 Kudos
NicolasGIS
Regular Contributor

Thanks for your reply @KristianEkenes !

Indeed, renderers are not defined in the same way:

- ArcGIS Server REST API /FeatureServer/0: type esriPMS

ArcGIS Server /FeatureServer/0 rendererArcGIS Server /FeatureServer/0 renderer

- Portail REST API /item/id/data type CIMPointSymbol

Portal /item/data rendererPortal /item/data renderer

So it's kind of limitation of ArcGIS Server not support CIMSymbol I guess ? It's would be a pity ! 

Thanks !

0 Kudos
KristianEkenes
Esri Regular Contributor

It could be. I also don't think we save renderers directly to the service anymore (on the Online side anyway). It would be worth checking in with someone on the Pro/Enterprise side...

0 Kudos
NicolasGIS
Regular Contributor

Thanks for the reply.

I opened a case. Let's see if the routing works.

Personnaly, I found it a pity: I tend to prefer referencing service by URL which are more stable to me (can be republished). Also, creating a FeatureLayer from a MapService layer is really convenient as well.

Thanks,

0 Kudos
NicolasGIS
Regular Contributor

So support added my case to the following already logged BUG and limitation:

BUG-000154352
The symbology scale range display is not retained for a feature service in a Portal for ArcGIS web map.

To me this BUG title is bit misleading as it does work for a feature service in the webmap if it is added as Portal item (look for content in the Portal and then add the feature service item). It is only not supported if you had the service by URL (either FeatureServer or MapServer/id) as it does not retrieve the symbology described in the Portal item but instead directly from the ArcGIS Server.

It would have been better to enlarge a bit the scope of this BUG to ArcGIS Server services (both FeatureServer service and featureLayer created from a MapServer layer) rather than restricting it to some webmap use.

Anyway, thanks for having chimed in @KristianEkenes! Feel free to ping anyone from Pro/Enterprise side 🙂

0 Kudos