AGSPopupMediaInfo

2382
2
10-22-2015 11:21 PM
c_f_ong
New Contributor III

Hello

I've come back to this question again after a while. Still couldn't figure out how to set the correct path for an image (Logo.png - resource in local bundle) to be displayed in a popup. The code below doesn't work - keep showing "No image to display".

    AGSPopupInfo *info = [AGSPopupInfo popupInfoForGraphic:graphic];

    NSURL *url = [[NSBundle mainBundle] URLForResource:@"Logo" withExtension:@"png"];

    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:url.path, @"sourceURL", nil];

    AGSPopupMediaInfo *mediaInfo = [AGSPopupMediaInfo popupMediaInfoWithTitle:@"Title" caption:@"Caption" type:AGSPopupMediaInfoTypeImage value:dict];

    info.mediaInfos = [NSArray arrayWithObject:mediaInfo];

    self.popupVC = [[AGSPopupsContainerViewController alloc] initWithPopupInfo:info graphic:graphic usingNavigationControllerStack:NO];

Thanks.

Rgds

Ong CF

0 Kudos
2 Replies
RyanOlson1
Esri Contributor

The Popup expects the sourceURL to be an http based URL. Something like http://www.<some.domain>.com/logo.png

0 Kudos
c_f_ong
New Contributor III

Hello

Thanks for your reply. In that case, I'll create my own popup to show the local image.

Rgds

Ong CF

0 Kudos