The Legend widget in the ArcGIS JavaScript API (Both 3.18 and 4.1) seems hardcoded to always place low values at the bottom and high values at the top, regardless of the order in which they are configured in a map service. Cartographic authorities suggest that there isn't a correct order - valid arguments may be made for either sort order, at the discretion of the cartographer and the intended message. And some cartographers feel very strongly about the order in which their legend appears, and are unnerved when that order is reversed when incorporated into a mapping application or viewed in ArcGIS Online. We'd like to request that either the legend follow the order set in a map service, or that ArcGIS Online users (and developers using the API) be given the ability to set the legend class order they feel is most appropriate.
That's a great idea. And I am so surprised that it hasn't been implemented yet.
In version 4.34 of the SDK we've added an order property to the legendOptions of the ClassBreaksRenderer, FlowRenderer, PieChartRenderer, PointCloudClassBreaksRenderer, PointCloudStretchRenderer, PointCloudUniqueValueRenderer, and UniqueValueRenderer to specify whether individual legend item values are displayed in ascending or descending order.
This may not be supported in Map Viewer for this release but it has been added to the JS Maps SDK.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.