Select to view content in your preferred language

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

265
5
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?

0 Kudos
5 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

 

0 Kudos
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.

0 Kudos