Select to view content in your preferred language

Can't load popup defined in the service feature that's added to the map later

250
4
03-30-2026 03:13 AM
tsroyh
by
Emerging Contributor

Hello,

We're trying to open a popup defined in an external service, but the iOS/Swift (200.x) SDK doesn't seem to respect the `popupInfo` definition.

This is our setup:
- load map (eg basemap)
- after map is loaded, add external layer using `let featureTable = ServiceFeatureTable(url: url), let layer = FeatureLayer(featureTable: featureTable), map.addOperationLayer(layer)`
- after layer is loaded, go to a point defined in the layer and tap
- fields defined for that point are loaded/visible, but media/attachments are not

When inspecting the result of `IdentifyLayerResult`, the `popups` property is empty. When inspecting the service layer, after layer.load(), the `popupDefinition` is not set, popupsAreEnabled is set to true.

Any suggestions on what should we try? Is this use case supported?

Thank you,
Marius

0 Kudos
4 Replies
Ting
by Esri Regular Contributor
Esri Regular Contributor

2 ideas to try first:

- Can you try setting returnPopupsOnly to true in your identify method?

- Can you try your data with this example code snippet, PopupExampleView? If you can download and open the toolkit example project, and swap your data to try if it works.

0 Kudos
marius
by
Regular Contributor

I've tried both of the above, and I think the issue is related to the feature service, probably being treated different in by the Swift SDK than the web SDK.

The above works fine on the web

https://www.arcgis.com/apps/mapviewer/index.html?url=https://review.tabletcommand.com/fake/api/rest/...

However, I can't  import the same layer into a simple web map, in ArcGIS online.

Is there a way I can validate the feature service against the Swift SDK?

0 Kudos
marius
by
Regular Contributor

I've done further testing, and it seems that if you're trying to access the style/popover info from a feature service that's added to a basemap by URL, the popover definition does not come through. It comes through only if it's loaded by itemId.

e.g. for the following layer, https://services3.arcgis.com/zGXMcUaDlMGoFJXg/ArcGIS/rest/services/Some_Cities_-_Test_Marius/Feature..., I've configured the style to show the points as red triangles, and popup info to show the image/fields. If I add that layer to a new map, on the web https://www.arcgis.com/apps/mapviewer/index.html?url=xyz, or the iOS SDK (create new basemap, then add layer), the style/popup info are not transfered.

If in the same web portal map view (or iOS SDK), I create a map, and then add a layer by itemId ("025c29157a6a497eb75d12769f7eb61d"), the style/popup info are visible.

Is this the expected behaviour for the iOS SDK/map portal?

Thank you

Ting
by Esri Regular Contributor
Esri Regular Contributor

Hi folks, sorry for the late response as we were preparing for the next release for the last couple of weeks.

As Marius said, it is an expected behavior. The popup definition is stored in the portal item’s JSON as an override, so it will not be available in the feature table or layer unless it is loaded using the item ID. See the following JSONs from the feature server and the portal item you provided

See "drawingInfo" field for the difference in the point symbology. The feature layer uses RedSphere.png while the portal item overrides it with an esriSMSTriangle. So when you add the layer via URL, it shows the red dots, and when you add it via a portal item, it shows the red triangles.

"popupInfo" field is stored within the portal item, so only when you add it that way would you be able to get the popup definitions.

 

Let me know if you have further questions!

0 Kudos