Select to view content in your preferred language

Arcade labels work in Map Viewer Classic but not in the new Map Viewer

1008
7
08-28-2024 07:34 AM
Labels (3)
bogdanpalade2
Regular Contributor

Hi!

In ArcGIS Online: I have a set of Arcade labels that works fine in the map viewer classic but they don't display at all in the new map viewer. Testing the expression in the new map viewer gives the correct (expected) output results. But nothing displays on the map or on the experience builder app that is using this web map. Here is the Arcade expression:

// Get the geometry of the feature
var geom = Geometry($feature);

// Extract the latitude and longitude
var lat = Round(geom.y, 6);
var lon = Round(geom.x, 6);

// Combine latitude and longitude into a label
return "Lat: " + Text(lat, "#.######") + "°, Lon: " + Text(lon, "#.######") + "°";

 

Anybody knows why this happens?

7 Replies
RussRoberts
Esri Notable Contributor

Thanks for reporting this. This looks to be an issue in the JS Maps SDK. I'll shoot this over to the team

 

bogdanpalade2
Regular Contributor

Hi! Sharing directly as a webmap keeps the arcade expression (minus the newline,  but well...) and displays in the new map viewer. This however does not solve the problem because I need my feature layer to be editable, but not enabled for public data collection.  

0 Kudos
DanielFox1
Esri Contributor

Hi @bogdanpalade2 I have just tested this arcade script and experience the same thing you are reporting, even in ArcGIS Pro the expression validates but there is nothing displaying when applied. I would recommend raising a support case with your distributor to determine if there is a bug for this matter or how they can help further.

0 Kudos
bogdanpalade2
Regular Contributor

Hi Daniel,

In my case, everything works fine in ArcGIS Pro. I have a feeling it is about how the different coordinate systems are treated in the new map viewer because this problem shows only when using the geometry property. 

0 Kudos
bogdanpalade2
Regular Contributor

Going deeper in the topic, looks like the problem is related to maps that are using GCS, i.e. not projected.

tikola
by Esri Contributor
Esri Contributor

And my impression is that issue happens when data and basemap projection differs. If basemap and data are in same projection this problem does not exist as told in topic header. This issue exist only in New Map Viewer - Classic Map Viewer has not this issue.

0 Kudos
tikola
by Esri Contributor
Esri Contributor

I have a strong feeling that my variant of this issue got fixed after latest february 2025 AGOL release. @bogdanpalade2 check your case now did it get solved?

My variant is that I use these functions to label sewer pipe up and downstream heights correctly in right ends of a pipe according flow direction (=line drawing direction). In practise I use feature($geometry).x value in function and it works. If you choose feature($geometry).z value it still fails. So my problem is solved but maybe not whole issue is solved. Works in plane but not in 3d - that is current impression.

Thanks @RussRoberts if it was your hands involved in this issue.

 

0 Kudos