Description This function returns a list of thumbnail JSON objects. the number of thumbnails in a set will depend upon the configuration parameter of thumbnailSet value. The thumbnail images are encoded as base64 string. The function is a JavaScript Promise. Below is a sample code snippet that describes how to bind the thumbnail data in your web page. You can also chain your custom logic as chained function of JavaScript Promise.
var fileName = PanoramaAPI.fileName;
if (fileName != "") {
         PanoramaAPI.getThumbnailJSON().then(function (data) {
            if (data == null) {
                htm = "Error to retrive Thumbnail"
                $("#divToBindThumbnails").html('<p class="api-error">' + htm + '</p>');
            }
            else {
                var dataObj = JSON.parse(data);
                var htm = "";
                $.each(dataObj.ThumbnailList, function (index, value) {
                    var thumbListArr = value;
                    $.each(thumbListArr, function (index, value) {
                        htm += '<li id="pageid_' + thumbListArr.ThumbPage + '"><img id="thumbpageid_' + thumbListArr.ThumbPage + '" src="data:image/png;base64,' + thumbListArr.Thumbnail + '"/><br/>' + thumbListArr.ThumbPage + '</li>'
                        return false;
                    });
                    $("#divToBindThumbnails").html('<ul>' + htm + '</ul>');
                });
               CallYourFunction();
            }
            }).catch(function (error) {
              console.log("Error Message:", error);
           });
        } 
Syntax PanoramaAPI.getThumbnailJSON()
Parameters NA
Returns GetThumbnailResult:JavaScriptObject { "GetThumbnailResult": { "ThumbnailList": [{ "Thumbnail": "Base 64 string of the thumbnail", "ThumbPage": 1, "Message": null, "errorStatus": false, "errorType": null }], "Message": "CAD_Thumbnail", "CurrentPageNumber": 1, "TotalPageNumber": 1 } }

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment