AnsweredAssumed Answered

[JSAPI 4.7][PopupTemplate] mediaInfo image click to open link in new window

Question asked by Justdoit011 on Apr 18, 2018
Latest reply on Apr 20, 2018 by Justdoit011

I'm making a map with images shown in popup. Because the popup is relatively small in size, I only show thumbnail of the image in popup. When user click the image, I'd like to show a full-resolution image. The popup looks like below:

 

 

Here is the popup template:

{
  "popupInfo": {
    "title": "{Name}",
    "fieldInfos": [...],
    "mediaInfos": [{
      "title": "Image",
      "type": "image",
      "value": {
        "sourceURL": "{Thumbnail}",
        "linkURL": "{Image}"
      }
    }]
  }
}

By using "linkURL", I can put a link on the image inside popup. Is there a way to open the link in new window/new tab by default? Currently the link will be opened in place, which means that the map page will be redirected and user will not be able to access map page unless he/she click "Back" button in browser.

 

Here is an running example:

 

https://codepen.io/anon/pen/YLzoZP 

 

Maybe in the future we can add a new flag in "mediaInfos" json to tell popup opening the link in new window or not? Maybe we can make all links open in new window by default? Thanks.

Outcomes