Select to view content in your preferred language

Label display issue on JSAPI v4.20 application and new Map Viewer of ArcGIS online

983
6
Jump to solution
03-25-2022 06:58 AM
SailiTang1
Regular Contributor

Hi,

I used JSAPI v3.26 to develop a web application before and it has been running well, and also, the map service that is being used by this app looks good in Map Viewer Classic of ArcGIS online. As I know, the maps should have the same display in Map Viewer Classic and JSAPI V3.26, also the same display in Map Viewer and JSAPI V4.x. Please see the screenshots below. The image 1 is the screenshot that my map was opened in Map Viewer and JSAPI V4.x app. The label “05-Bedford South” is in the wrong place (It is within the polygon ED04). The image 2 is the screenshot of Map Viewer Classic and JSAPI V3.26 app, and this label is within the polygon ED05 and it is correct. They are opening the same feature service, but the label display is the different. Do you have any idea about the issue in the Image 1 and how to fix it? Thanks for the help.

I have been told that it is better to move JSAPI V3.26 to JSAPI V4.x because JSAPI V3.x will retire. So, I rewrote my app using JSAPI 4.20 but found the issue below and the label display was bad.

Cheers,

Saili

Image 1: Open in Map Viewer

SailiTang1_0-1648216498226.png

Image 2: Open in Map Viewer Classic

SailiTang1_1-1648216498262.png

 

0 Kudos
1 Solution

Accepted Solutions
RussRoberts
Esri Notable Contributor

Yup this is the labeling centroid issue that I mentioned above. I'll tag this post to the development issue. 

View solution in original post

6 Replies
RussRoberts
Esri Notable Contributor

If you can share the map we can take a look. I believe the difference you are seeing is the label for the polygon appearing at the centroid location which is something we have on the roadmap to improve the placement of in the 4.x API.

SailiTang1
Regular Contributor

Thanks for your reply. This is the feature service: https://services6.arcgis.com/SLbygoAaBbarfQVN/arcgis/rest/services/BND_ElectoralBoundaries_UT83/Feat...

It sounds like map settings need some changes if we move 3.x API to 4.x, right?

Thanks again

Saili

0 Kudos
RussRoberts
Esri Notable Contributor

Yup this is the labeling centroid issue that I mentioned above. I'll tag this post to the development issue. 

SailiTang1
Regular Contributor

Thanks for addressing this issue. So, there are no way to fix it on users' end, are there? Such as changing some settings on ArcGIS Pro and republish it or changing Visualization settings on ArcGIS online?

0 Kudos
RussRoberts
Esri Notable Contributor

Correct, there is nothing in the web map spec that would drive the placement offset placement to be driven by the centroid or distance from centroid at this time.

SailiTang1
Regular Contributor

Thanks for your response. I decided to stay on API v3.x.

0 Kudos