From within a ExperienceBuilder 1.14 custom widget, using JS API 4.x, i am loading featurelayers from an internal mapservice. Using "new FeatureLayer(...)", etc.
The issue is that the some of the featurelayers are showing an incorrect renderer. When i manually query the featurelayer via REST, in the json results i see that the renderer that the mapservice is sending me is the same incorrect renderer that JS API is displaying.
However, when i display that mapservice with ArcGIS Online Map Viewer, MapViewer is displaying the correct renderer! So how is it that MapViewer somehow magically gets the correct renderer, but the mapservice refuses to provide it to anyone else?
I'm thinking that ESRI MapServer and/or JS API has a bug here, and MapViewer is somehow working around that ESRI bug using secret undocumented functionality.
Has anyone else run across this sort of issue?
Typically the problem shows up with line/polygon symbology where there's a lighter fill combined with a darker border. The incorrect renderer has only a SimplerRenderer with esriSLSSolid of the dark border color instead. Massively ugly and unreadable on the map.
Unfortunately, due to the internal data and internal app, i can't provide a reproduceable example here.
I think I have seen this issue before and it's not strictly speaking an error, but it can be some unexpected behavior. It is possible for a MapServer and the FeatureLayers inside it to have two different symbologies. Go to the REST page of the MapServer and click All Layers and Tables. This is the symbology you should see loading the MapServer as a MapImageLayer.
Now, go to the REST page of the FeatureLayer you are trying to load (.../MapServer/5). This is the symbology you will see if you load it as an individual FeatureLayer. Do they match?
You should see this same behavior in the MapViewer if you load the layers by the different urls. .../MapServer vs. .../MapServer/5
Thanks!
Yes, i've seen that sort of thing before with MapServer, but this time the MapService level (All Layers) still shows the same incorrect renderer. Bleah. But yet, MapViewer somehow magically grabs the correct renderer notwithstanding.
But it just occurred to me that i can launch MapViewer and monitor the network requests/responses, and maybe see what magic MapViewer is doing, you know that secret "UseCorrectRenderer=Yes" flag it's passing in...
If i can find anything useful amidst all the network noise!
Later: Hmm, If you can believe it, MapViewer seems to actually have MapServer render the layer on the server and pass it down as an image:
"...MapServer/export?bbox=-13626505.46942316%2C6047143.17598199%2C-13610186.163884297%2C6058838.041309605&bboxSR=102100&imageSR=102100&size=1708%2C1224&dpi=96&format=png32&transparent=true&layers=show%3A-1&f=image"
Well that's not very helpful of MapViewer. It's cheating!