<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by iStaging on Medium]]></title>
        <description><![CDATA[Stories by iStaging on Medium]]></description>
        <link>https://medium.com/@istaging_RD?source=rss-9c85020ec5cb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*qrAoR1dVyGtO6w1X</url>
            <title>Stories by iStaging on Medium</title>
            <link>https://medium.com/@istaging_RD?source=rss-9c85020ec5cb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 15:24:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@istaging_RD/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[VRMaker SDK — 創建您的虛擬物件！]]></title>
            <link>https://medium.com/@istaging_RD/vrmaker-sdk-%E5%89%B5%E5%BB%BA%E6%82%A8%E7%9A%84%E8%99%9B%E6%93%AC%E7%89%A9%E4%BB%B6-9681033f9f28?source=rss-9c85020ec5cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/9681033f9f28</guid>
            <category><![CDATA[vr-maker]]></category>
            <dc:creator><![CDATA[iStaging]]></dc:creator>
            <pubDate>Fri, 29 Jun 2018 01:47:25 GMT</pubDate>
            <atom:updated>2020-07-16T07:50:34.482Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>概论</strong></h3><p>VR Maker 为360°虚拟实境平台，用您的手机就能在任何空间拍出具专业水平的VR实境。 VR Maker SDK可近一步与您的服务系统进行整合，为既有服务增加制作VR内容的功能，以下为各产业的应用范例：</p><ul><li>电商平台可自行开立虚拟店铺，并且发布专属活动与商品购买资讯。</li><li>房仲可建立VR虚拟实境看屋，让潜在买家1秒穿越到远端建筑，体验并感受现场3D环景视觉震撼。</li><li>教师可制作3D教学内容，让学生跨越时空限制，立即上山下海。</li><li>旅行社可制作旅游景点的3D导览功能，消费者预先实地游览，看喜欢再出发。</li></ul><p>參考档案之路径:</p><ul><li><strong>VREditor: </strong><a href="https://github.com/iStaging/vreditor-sdk">https://github.com/iStaging/vreditor-sdk</a></li><li><strong>VRViewer: </strong><a href="https://github.com/iStaging/vrviewer-sdk">https://github.com/iStaging/vrviewer-sdk</a></li><li><strong>Document: </strong><a href="https://evs-doc.istaging.com.cn/">https://evs-doc.istaging.com.cn</a></li></ul><p><strong>VRMarker SDK 包含两个 SDKs:</strong></p><ul><li><strong>VREditor: </strong>您可以创建以及编辑 360/VR 全景图</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*96aWTVQ0xp4FQCmM33Snkg.png" /></figure><ul><li><strong>VRViewer: </strong>您可以透过网页与手机，向客户展示您的3D内容</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*Li1Q9eIHGXEhR2NJDS7Zkw.png" /></figure><h4>特色介紹:</h4><ul><li><strong>全景图: </strong>您可以自行创建360全景图。</li><li><strong>实境体验: </strong>客户可透过手机或VR眼镜，体验实境观看。</li><li><strong>客制化设定: </strong>您可以为您的全景图加上客制化设定。</li><li><strong>编辑功能: </strong>您可以对您的全景图进行创建、编辑、与删除。</li><li><strong>可点击的标签(marker): </strong>您可以为您的全景图添加站点、资讯标签、其他网站的连结、或是影片。</li><li><strong>可自定义的颜色主题：</strong>添加主要颜色以匹配您的网站或应用程序。</li></ul><h3><strong>前置作业 …</strong></h3><p>首先，您需联系我们 iStaging: <a href="/service/mailto:gary.chan@istaging.com.cn">gary.chan@istaging.com.cn</a>，以注册一个VRMaker SDK的平台帐号。然后，您会获得一个平台帐号的金钥(platform account token)，并且header 携带此金钥呼叫 <a href="https://evs-doc-test.istaging.com.cn/pages/api.html#sign-up-tenant">sign up tenant api</a> ，注册您自己的用户帐号(tenant account)。</p><p>然後请确认您的 node.js 版本，建议您升级至 8.5.0 以上。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*KboifQzCStiMogd8XDQcFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*tqLR5-zUnqS37xVLd9wXbg.png" /></figure><p>注册完成用户帐号(tenant account)，我们就可以开始了。</p><h4>VREditor SDK</h4><ol><li>由 <a href="https://github.com/iStaging/vreditor-sdk">github</a> 下载SDK，并进行安装</li></ol><pre>npm install // or yarn</pre><p>2. 于 public/zh-cn/index.js 输入用户帐号(tenant account)</p><pre>VREditor.init({<br>  username: &#39;&#39;, // enter the tenant account username you signup.<br>  password: &#39;&#39;,<br>  ...<br>})</pre><p>3. 启动 Node server (预设为 port 3000)。</p><pre>npm start // or yarn</pre><p>于浏览器开启连结http://localhost:3000，您就会可以看到以下画面:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*BwHDFHpIImmqHYud8kH_sw.png" /></figure><p><strong>提醒: </strong>请协助下载webVR 工具 A-Frame (使用0.7.1版，并且引用顺序需优先于 vreditor-sdk.js ):</p><pre>// By ES6:</pre><pre>// CSS<br><a href="http://twitter.com/import">@import</a> url(https://medium.com/&#39;vreditor-sdk/dist/vreditor-sdk.css&#39;)</pre><pre>//JS<br>import &#39;aframe&#39;<br>import VREditor from &#39;vreditor-sdk&#39;</pre><pre>// CDN:</pre><pre>// CSS<br>&lt;link href=&quot;<a href="https://github.com/iStaging/vrviewer-sdk/blob/master/dist/vreditor-sdk.css">https://github.com/iStaging/vrviewer-sdk/blob/master/dist/vreditor-sdk.css</a>&quot; rel=&quot;stylesheet&quot;&gt;&lt;/link&gt;</pre><pre>// JS<br>&lt;script src=&quot;https://aframe.io/releases/0.7.1/aframe.min.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;<a href="https://github.com/iStaging/vreditor-sdk/blob/master/dist/vreditor-sdk.js">https://github.com/iStaging/vreditor-sdk/blob/master/dist/vreditor-sdk.js</a>&quot;&gt;&lt;/script&gt;</pre><p>于 public/zh-cn/index.js 检查下方资讯，然后对 VREditor 进行初始化:</p><pre>&lt;body&gt;<br>  &lt;div id=&quot;vreditor-sdk&quot;&gt;&lt;/div&gt;<br>&lt;/body&gt;<br>​<br>&lt;script&gt;<br>  VREditor.init({<br>    serverURL: &#39;http://localhost:3000&#39;, // enter your API server, here we provide a sample node server.<br>    el: document.getElementById(&#39;#vreditor-sdk&#39;),<br>    lang: &#39;en&#39;,<br>    primaryColor: &#39;#4a90e2&#39; // your theme color<br>  })<br>&lt;/script&gt;</pre><p><strong>注意：</strong>primaryColor应具有十六进制格式。</p><h4>VRViewer SDK</h4><ol><li>由 <a href="https://github.com/iStaging/vrviewer-sdk">github</a> 下载SDK，并进行安装</li></ol><pre>npm install // or yarn</pre><p>2. 启动 Node server (预设为 port 3001)</p><pre>npm start // or yarn</pre><p>于浏览器开启连结http://localhost:3001，您就会可以看到以下画面:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*Wc5keFiFsU05iROySNrLYg.png" /></figure><p><strong>提醒: </strong>请协助下载全景图浏览工具KRPano (使用最新版本，并且引用顺序需优先于vreditor-sdk.js)以及Three.js(使用71以上的版本，并且引用顺序需优先于KRPano） 。另外，KRPano 并无免费提供，需额外花费购买(我们于范例程式内使用测试版)。</p><pre>// By ES6:</pre><pre>// CSS<br><a href="http://twitter.com/import">@import</a> url(https://medium.com/&#39;vrviewer-sdk/dist/vrviewer-sdk.css&#39;)</pre><pre>// JS<br>import VRViewer from &#39;vrviewer-sdk&#39;</pre><pre>// CDN:</pre><pre>// CSS<br>&lt;link href=&quot;<a href="https://github.com/iStaging/vrviewer-sdk/blob/master/dist/vreditor-sdk.css">https://github.com/iStaging/vrviewer-sdk/blob/master/dist/vrviewer-sdk.css</a>&quot; rel=&quot;stylesheet&quot;&gt;&lt;/link&gt;</pre><pre>// JS<br>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/three.js/71/three.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;krpano.min.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;<a href="https://github.com/iStaging/vrviewer-sdk/blob/master/dist/vreditor-sdk.css">https://github.com/iStaging/vrviewer-sdk/blob/master/dist/vrviewer-sdk.</a>js&quot;&gt;&lt;/script&gt;</pre><p>然后，我們擷取網址後方的<strong>物件 id(panoCollection id)</strong>，並進行VRViewer的初始化 (請記得創建一個對應id的div):</p><pre>&lt;body&gt;<br>  &lt;div id=&quot;vrviewer-sdk&quot;&gt;&lt;/div&gt;<br>&lt;body&gt;<br>  &lt;div id=&quot;vrviewer-sdk&quot;&gt;&lt;/div&gt;<br>&lt;/body&gt;<br>​<br>&lt;script&gt;<br>const apiServerUrl = &#39;<a href="https://evs-test-api.istaging.com.cn&/#39;">https://evs-test-api.istaging.com.cn&#39;</a><br>const pathnameArray = location.pathname.split(&#39;/&#39;)<br>const collectionId = pathnameArray[pathnameArray.length - 1]<br>axios({<br>  method: &#39;get&#39;,<br>  url: `${apiServerUrl}/api/v1/openlink/${collectionId}`<br>}).then((response) =&gt; {<br>  if (response.status === 200) {<br>    const panoCollection = response.data<br>    console.log(&#39;panoCollection: &#39;, panoCollection)</pre><pre>VRViewer.init({<br>      el: &#39;#vrviewer-sdk&#39;,<br>      lang: &#39;en&#39;,<br>      panoCollection: panoCollection,<br>      setting: {<br>        .. check the document<br>      }<br>    })<br>  }<br>}).catch((error) =&gt; {<br>  console.log(error)<br>})<br><br>&lt;/script&gt;</pre><p><strong>提醒: </strong>因为需同时执行 VREditor SDK 以及 VRViewer SDK，请设定不同的 port。 (例如 3000 与 3001)</p><p>现在一切就绪，您可以开始使用 VREditor SDK，创建<strong>物件(panoCollection)、全景图(panorama)、</strong>以及<strong>标签(marker)</strong>了。</p><h3><strong>步骤 1: 创建物件(panoCollection)</strong></h3><p>于主画面 (物件清单，<em>panoCollection </em>list), 点击左上方 “创建物件” 按钮。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*BwHDFHpIImmqHYud8kH_sw.png" /></figure><p>输入名称并且点击 “储存” 按钮:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*FZXEAb_UY_Qk1oH1bB_A_Q.png" /></figure><p>Node server会收到此<strong>物件 id (panoCollection id)</strong>。请记下此 id，后续将会用于 vrviewer-sdk。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*wYevLGR9mNl0i3vxhcY98Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*2odo0LZ_WtCc1aNfQQu4nw.png" /></figure><p>然后，您会进入 <strong>物件(panoCollection)</strong> 的资料编辑页面，并且可以上传个人图片与此 物件(panoCollection) 的缩图:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*QGDr02Ol2wMtyR_RvhY8rw.png" /></figure><p><strong>提醒: </strong>名称为必填，并且名称栏与描述栏有字数限制。</p><h3><strong>步骤 2: 创建全景图(panorama)</strong></h3><p>现在，您已拥有一个 <strong>物件(panoCollection) </strong>，可以来加入 <strong>全景图(<em>panorama</em>)</strong>。点击 “全景图” 分页:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*bdTISn0iZLf2SXGZitKwVg.png" /></figure><p>当点击 “新增全景图” 按钮，您会看到:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*UKCVxTMxdRNbT4fNHbuxVw.png" /></figure><p>点击 “浏览” 按钮，选择一或多张<strong>全景图(<em>panorama)</em></strong>，然后点击 “新增全景图”。以下为完成结果:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*xx7G09wImzOIt1EvqVs40A.png" /></figure><p><strong>提醒: </strong>您可以点击右侧的编辑图示更换 全景图 (或点击垃圾桶图示进行删除)。</p><h3><strong>步骤 3: 创建标签(marker)</strong></h3><p>现在您已完成一个有全景图的物件，可以开始加入<strong>标签(maker)</strong>了。点击“标签编辑器”分页:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*xx7G09wImzOIt1EvqVs40A.png" /></figure><p>您会看到:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*0o1JptmHMOQcqFwR9pmJsA.png" /></figure><p>点击 站点 <strong>图示</strong>(<strong>point</strong>，左方第一个图示)。您会看到:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*0Xq6K27U-s4KzD_CEoORJQ.png" /></figure><p>若您于清单内点击希望切换的 <strong>全景图(<em>panorama)</em></strong>，您会看到:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*Ndrgw8Mhji8RQXtvi4Xi7A.png" /></figure><p>若您点击“储存视角”，之后点击此 <strong>站点(point)</strong>，将会切换至此<strong>全景图(<em>panorama)</em></strong>的此视角。</p><p>现在，点击第2个图示(由上至下)。此为 <strong>产品标签(product tag)</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*8_33MStU6NfrnnMNo-TKVg.png" /></figure><p>您可以使用 <strong>产品标签(product tag) </strong>导入既有的产品资讯。但是，您需要先透过呼叫 iStaging 的 <a href="https://evs-doc-test.istaging.com.cn/pages/api.html#create-product-tag">create product tag API</a> (需于header携带platform-account-token)导入您的产品资讯。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*cAwnBy6lU6WscLSXgYyO-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*0jIMRWysqjhUbRLYIN2wNw.png" /></figure><p>然后，您可以于标签编辑器输入您的 product ID 并按下“导入资料”，取得产品资讯。 (提醒: 于VRViewer SDK，产品标签(product tag) 将会显示与 标签(tag) 一致的图示。)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*JsOU62lL8Rdc98YlkjEKhg.png" /></figure><p>若要清除产品资讯，可点击输入框右方的 X 。或是点击 “储存”，保留此<strong>产品标签(product tag)</strong>。</p><p>接着，点击 <strong>自定义标签</strong> (<strong>custom tag</strong>，由上而下第3个图示):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*a0ruJjCIKlFSfbM09V2IcA.png" /></figure><p>您可以透过 <strong>自定义标签(custom tag)</strong> 以及 VRViewer SDK 的callback functions，客制化您的各种专属活动。如同 <strong>产品标签(custom tag)</strong> ，您需要先呼叫 iStaging 的 <a href="https://evs-doc-test.istaging.com.cn/pages/api.html#create-custom-tag">create custom tag API</a> (需于header携带platform-account-token) 导入您的 <strong>自定义标签(custom tag)</strong>。然后，您就可以取得专属于您 <strong>自定义标签(custom tag)</strong> 的种类(type) 和 图示(icon)。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*dKzOQxO9lfXe2Rd0oSybtA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*a7N8v1mQev1M48OJWkgP2g.png" /></figure><p>您现在可以于图示清单选择任一已上传的 自定义标签(custom tag)，并点击“储存”保留变更。</p><p><strong>重要提醒: </strong>您必须于VRViewer SDK撰写<strong>自定义标签(custom tag)</strong>的 call back functions，否则点击将会无任何反应。以下为电商的javascript 范例程式。假设您已经创建一个<strong>自定义标签(custom tag)</strong>，其 type为 DiscountCoupon :</p><p>html:</p><pre>&lt;!-- custom-popup-section --&gt;<br>    &lt;div class=&quot;custom-popup-section hide&quot;&gt;<br>      &lt;div class=&quot;custom-popup-section-inner&quot;&gt;<br>        &lt;div class=&quot;custom-popup-section-close&quot;&gt;<br>          &lt;i class=&quot;fas fa-times fa-2x&quot;&gt;&lt;/i&gt;<br>        &lt;/div&gt;<br>        &lt;!-- discount-coupon-section --&gt;<br>        &lt;div class=&quot;custom-popup-content-section discount-coupon-section&quot;&gt;<br>          &lt;h2 class=&quot;discount-coupon-title&quot;&gt;<br>            折價卷<br>          &lt;/h2&gt;<br>          &lt;hr&gt;<br>          &lt;div class=&quot;discount-coupon-content&quot;&gt;<br>            &lt;div class=&quot;discount-coupon-item&quot;&gt;<br>              &lt;p&gt;滿$1,000 折 100&lt;/p&gt;<br>              &lt;p&gt;折扣代碼: &lt;span class=&quot;vrsdk-color-yellow&quot;&gt;HAPPY99&lt;/span&gt;&lt;/p&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;discount-coupon-item&quot;&gt;<br>              &lt;p&gt;滿$10,000 折 1,300&lt;/p&gt;<br>              &lt;p&gt;折扣代碼: &lt;span class=&quot;vrsdk-color-yellow&quot;&gt;HAPPY996&lt;/span&gt;&lt;/p&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;discount-coupon-item&quot;&gt;<br>              &lt;p&gt;滿$15,000 折 2,000&lt;/p&gt;<br>              &lt;p&gt;折扣代碼: &lt;span class=&quot;vrsdk-color-yellow&quot;&gt;HAPPY998&lt;/span&gt;&lt;/p&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;discount-coupon-item&quot;&gt;<br>              &lt;p&gt;滿$20,000 折 3,000&lt;/p&gt;<br>              &lt;p&gt;折扣代碼: &lt;span class=&quot;vrsdk-color-yellow&quot;&gt;HAPPY999&lt;/span&gt;&lt;/p&gt;<br>            &lt;/div&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;</pre><p>css:</p><pre>/* coupon section */<br>.discount-coupon-section {<br>  position: relative;<br>  max-height: 100%;<br>  overflow: auto;<br>}</pre><pre>.discount-coupon-title {<br>  font-size: 18px;<br>  line-height: 25px;<br>  text-align: center;<br>}</pre><pre>.discount-coupon-section h2,<br>.discount-coupon-section p {<br>  color: #fff;<br>}</pre><pre>.discount-coupon-section hr {<br>  height: 1px;<br>  width: 100%;<br>  margin: 5px 0;<br>}</pre><pre>.discount-coupon-content {<br>  display: flex;<br>  flex-direction: column;<br>  align-items: center;<br>}</pre><pre>.discount-coupon-item {<br>  position: relative;<br>  text-align: center;<br>  padding-top: 15px;<br>  margin-bottom: 15px;<br>  min-width: 248px;<br>}<br>.discount-coupon-item p {<br>  font-size: 18px;<br>  line-height: 25px;<br>}</pre><pre>.discount-coupon-item + .discount-coupon-item::before {<br>  content: &#39;&#39;;<br>  position: absolute;<br>  top: 0;<br>  left: 0;<br>  right: 0;<br>  width: 100%;<br>  height: 1px;<br>  border-top-style: dashed;<br>  border-top-color: #fff;<br>  border-top-width: 1px;<br>}</pre><p>js:</p><pre>var customPopupSection = document.querySelector(&#39;.custom-popup-section&#39;)<br>var customPopupContentSections = document.querySelectorAll(&#39;.custom-popup-content-section&#39;)<br>customPopupContentSections.forEach(function (contentSection) {<br>  contentSection.classList.add(&#39;hide&#39;)<br>})</pre><pre>VRViewer.onMarkerClick = (marker) =&gt; {<br>  console.log(&#39;onMarkerClick callback: &#39;, marker)</pre><pre>// handle your custom tag in marker click callback function<br>  if (marker.type ===&#39;custom&#39;) {<br>    console.log(&#39;custom marker type: &#39;, marker.customTagInfo.type)<br>    switch (marker.customTagInfo.type) {<br>      case &#39;DiscountCoupon&#39;:<br>        // console.log(&#39;in DiscountCoupon handle&#39;)<br>        var discountCouponSection = document.querySelector(&#39;.discount-coupon-section&#39;);<br>        discountCouponSection.classList.remove(&#39;hide&#39;)<br>        break<br>      default:<br>        // console.log(&#39;in default handle&#39;)<br>        break<br>    }<br>    customPopupSection.classList.remove(&#39;hide&#39;)<br>    VRViewer.togglePanoramasList()<br>  }<br>}</pre><pre>var customPopupClose = document.querySelector(&#39;.custom-popup-section-close&#39;);<br>customPopupClose.addEventListener(&#39;click&#39;, function() {<br>  customPopupSection.classList.add(&#39;hide&#39;)<br>  customPopupContentSections.forEach(function (contentSection) {<br>    if (!contentSection.classList.contains(&#39;hide&#39;)) {<br>      contentSection.classList.add(&#39;hide&#39;)<br>    }<br>  })<br>  VRViewer.togglePanoramasList()<br>});</pre><p>然后您可以看到：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*cKKpXlfvrwRAWPcPnflsRw.png" /></figure><p>您可以进一步参考范例程式的examples/static/zh-cn/index.html, index.js, index.css 档案 (VRViewer SDK)。</p><p>下一个要介绍的是 <strong>标签</strong> (<strong>tag</strong>，第四个图示):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*o-xgamZFj6-To8P369GV7w.png" /></figure><p>您可以输入标题、物件描述、图片、价格、以及动作(例如，连结至商品贩售页)。</p><p>下一个要介绍的是 <strong>注记</strong>(<strong>memo</strong>，第5个):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*aYGdnkoINfSUU8dV_QLgPA.png" /></figure><p>最后一个为 <strong>视屏</strong>(<strong>vedio</strong>):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*J7as8clYE2zATR14PoP5Ig.png" /></figure><p>您可以输入任一视屏的网址，例如 youtube，可以点击“预览”，观看<strong>视屏(vedio)</strong>内容(视屏的网址需相容于iframe):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*4oM0HJ1ZNPlFZjidXepTMA.png" /></figure><p>最后，点击“储存”完成编辑。</p><h3><strong>步骤 4: 于VRViewer SDK观看创建内容</strong></h3><p>点击右上方的眼睛图示，进行内容的预览/观看:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*xx7G09wImzOIt1EvqVs40A.png" /></figure><p>为了预览/观看内容，您必须先使用VRViewer SDK架设一个网站，指向其網站位置: https://yourwebsite/panoCollectionId，您需将此网址加入`viewerPreviewHost`參考 <em>public/zh-cn/index.js</em>) 。</p><pre>&lt;script&gt;<br>  VREditor.init({<br>    clientURL: &#39;&#39;, // enter your viewer&#39;s host URL <br>    serverURL: &#39;http://localhost:3000&#39;, enter your API server, here we provide a sample node server.<br>    el: document.getElementById(&#39;#vreditor-sdk&#39;),<br>    lang: &#39;en&#39;,<br>    shouldGoToDetailsPage: true, // shouldGoToDetailsPage will auto go to panoCollection detail page if you have only one panoCollection              <br>    viewerPreviewHost: {<br>      url: &#39;xxx&#39;, // enter the website you host to make sure share function work.<br>      previewInSdk: true // default false<br>    }  })<br>&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*Wc5keFiFsU05iROySNrLYg.png" /></figure><p>您可以点击 <strong>站点(point)</strong>，进行<strong>全景图(panorama)</strong>的切换:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*Li1Q9eIHGXEhR2NJDS7Zkw.png" /></figure><p>若您点击任何一个<strong>标签(marker)</strong>，将会显示您于 VREditor SDK 编辑的资讯:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*Kw7zWpVH1oZKt8mVqJRJhg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*uzPYDQPdpXkjCOBxt-4gfg.png" /></figure><h3><strong>步骤 5: 根据物件id (panoCollection id)，为VRViewer SDK导入物件(panocollection)资料</strong></h3><p>携带<strong>物件id(panoCollection id)</strong>，呼叫iStaging的 <a href="https://evs-doc-test.istaging.com.cn/pages/api.html#get-public-open-panocollection-link">Public(open) Panorama Collection API</a> 捞取您的<strong>物件(panoCollection)</strong>资料。</p><p>变更范例程式内的<strong>物件id(panoCollection id)</strong>。</p><pre>GET <a href="https://evs-doc-test.istaging.com.cn/">https://evs-doc-test.istaging.com.cn/</a>api/v1/openlink/&lt;yourPanoCollectionId&gt;</pre><p>於范例程式中，我們由網址取得<strong>物件id(panoCollection id)。</strong>您可以將直接<strong>url</strong>更改為<strong>物件id(panoCollection id)</strong>，以下為范例程式 example/zh-cn/index.js(VRViewer SDK):</p><pre>const apiServerUrl = &#39;<a href="https://evs-test-api.istaging.com.cn&/#39;">https://evs-test-api.istaging.com.cn&#39;</a><br>const pathnameArray = location.pathname.split(&#39;/&#39;)<br>const collectionId = pathnameArray[pathnameArray.length - 1]<br>  axios({<br>    method: &#39;get&#39;,<br>    url: `${apiServerUrl}/api/v1/openlink/${collectionId}`<br>  }).then(resp =&gt; {<br>    const panoCollection = resp.data<br>    // <br>    let config = {<br>      el: &#39;#vrviewer-sdk&#39;,<br>      lang: &#39;zh-cn&#39;,<br>      setting: DEFAULT_SETTING,<br>      panoCollection<br>    }<br>    VRViewer.init(config)<br>  }).catch(error =&gt; {<br>    console.log(error)<br>  })</pre><p>导入物件(panoCollection)资料后，进行VRViewer 的初始化。</p><h3>最終結果</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*E1vFZIux0Ulywy2KKbMJ5g.gif" /></figure><h3><strong>Github 程式库</strong></h3><p>(包含范例程式)</p><p><a href="https://github.com/iStaging/vrmaker-sdk">iStaging/vrviewer-sdk</a></p><h3><strong>基本介绍:</strong></h3><ul><li><strong>物件</strong>(panoCollection)：全景图的集合(您可以视为一间房子，包含许多的房间)。</li><li><strong>全景图</strong>(panorama)：360环景照片(于此SDK，您可以视为房子内的一个房间)。</li><li><strong>标签</strong>(maker)：放置于全景图内，可点击与展示资讯的元件。</li><li>站点(point)：用来串连全景照，打造实境导览体验。</li><li>标签(tag)：用来增加特色叙述及图片，可连结至购买页面或特定网页。</li><li>产品标签(product tag)：用来导入既有的产品资讯。</li><li>自定义标签(custom tag)：可客制化您的专属活动。</li><li>注记(memo)：用来增加物件叙述。</li><li>视屏(vedio)：可嵌入网页，像是YouTube影片或Sketchfab 3D 模型。</li></ul><p><strong>设定视角(View angle)</strong>：调整浏览全景照时的初始视角。</p><p><strong>平面图(Floor plan)</strong>：可替VR实境加上平面图。</p><h3><strong>參考档案之路径:</strong></h3><ul><li><strong>VREditor: </strong><a href="https://github.com/iStaging/vreditor-sdk">https://github.com/iStaging/vreditor-sdk</a></li><li><strong>VRViewer: </strong><a href="https://github.com/iStaging/vrviewer-sdk">https://github.com/iStaging/vrviewer-sdk</a></li><li><strong>Document: </strong><a href="https://evs-doc-test.istaging.com.cn/">https://evs-doc-test.istaging.com.cn</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9681033f9f28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VRMaker SDK — create your virtual tour!]]></title>
            <link>https://medium.com/@istaging_RD/vrmaker-sdk-create-your-virtual-tour-c6b4d796da29?source=rss-9c85020ec5cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6b4d796da29</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[vr]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[istaging]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[iStaging]]></dc:creator>
            <pubDate>Thu, 28 Jun 2018 08:18:37 GMT</pubDate>
            <atom:updated>2018-07-25T03:26:03.471Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overview</h3><p>VRMaker SDK is the 360° virtual tour platform that allows you to capture professional-quality VR tours of any space with your smartphone. VRMaker SDK can be further integrated with your service system to create VR content in an existing service. The following are examples of application for various industries:</p><ul><li>E-commerce platforms can open virtual stores and publish exclusive events and product information.</li><li>Real estate can establish a VR watching house, allowing potential buyers to experience the visual shock of a 3D scene.</li><li>Teachers can create 3D teaching content, allowing students to breakthrough space limit and experience multiple ways of learning.</li><li>Travel agencies can produce 3D navigation features for tourist attractions. Customers can pre-visit the site, and go if they like it.</li></ul><p>Check the following resources:</p><ul><li><strong>VREditor: </strong><a href="https://github.com/iStaging/vreditor-sdk">https://github.com/iStaging/vreditor-sdk</a></li><li><strong>VRViewer: </strong><a href="https://github.com/iStaging/vrviewer-sdk">https://github.com/iStaging/vrviewer-sdk</a></li><li><strong>Document: </strong><a href="https://evs-doc-test.istaging.com.cn/">https://evs-doc-test.istaging.com.cn</a></li></ul><h4>VRMarker SDK consists of two SDKs:</h4><ul><li><strong>VREditor</strong>: It enables you to create 360/VR tours with their 3D content.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*1BhCNsU8_d9Lw7Nfrhxkpg.png" /></figure><ul><li><strong>VRViewer: </strong>It enables you to display the created content in both web and mobile devices.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*itaDT7GUeIllOqURYRg3OQ.png" /></figure><h4>Features:</h4><ul><li><strong>Panoramic tours</strong>: Generate 360/VR tours with your own content and settings.</li><li><strong>Virtual reality tours</strong>: Enable users to have a realistic experience using their phones and VR glasses.</li><li><strong>Complete number of settings</strong>: Customize your tours based on a series of configuration values.</li><li><strong>Editing capabilities</strong>: Create, update, and modify your panoramas in various ways.</li><li><strong>Clickable markers</strong>: Add points, memos, tags, links to other sites, and even videos to your tours.</li></ul><h3>Before starting …</h3><p>First, you need to sign up for a VRMaker SDK platform account by contacting iStaging: <a href="/service/mailto:benjamin@staging.com.tw">benjamin@staging.com.tw</a>. After that, you will get a platform account token. Use this token in the request header to create your tenant account.</p><p>Then check your Node.js version, we recommend you to use a version above 8.5.0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*KboifQzCStiMogd8XDQcFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*tqLR5-zUnqS37xVLd9wXbg.png" /></figure><p>With your tenant account ready, we can start.</p><h4>VREditor SDK</h4><p>1. Clone the SDK from the <a href="https://github.com/iStaging/vreditor-sdk">official repository</a> and install the dependencies.</p><pre>npm install // or yarn</pre><p>2. Login with your tenant account in <em>public/en/index.js.</em></p><pre>VREditor.init({<br>  username: &#39;&#39;, // enter the tenant account username you signup.<br>  password: &#39;&#39;,<br>  ...<br>})</pre><p>3. Start the Node server (it runs in port 3000):</p><pre>npm start // or yarn</pre><p>You will see the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*mtNQ61oVRPEmnxmjuFkCTA.png" /></figure><p><strong>Note: </strong>Don’t forget to import the webVR framework <a href="https://aframe.io/">A-Frame</a> (Use the 0.7.1 version and place it before <em>vreditor-sdk.js</em>):</p><pre>// By ES6:</pre><pre>// CSS<br><a href="http://twitter.com/import">@import</a> url(https://medium.com/&#39;vreditor-sdk/dist/vreditor-sdk.css&#39;)</pre><pre>//JS<br>import &#39;aframe&#39;<br>import VREditor from &#39;vreditor-sdk&#39;</pre><pre>// CDN:</pre><pre>// CSS<br>&lt;link href=&quot;<a href="https://github.com/iStaging/vrviewer-sdk/blob/master/dist/vreditor-sdk.css">https://github.com/iStaging/vrviewer-sdk/blob/master/dist/vreditor-sdk.css</a>&quot; rel=&quot;stylesheet&quot;&gt;&lt;/link&gt;</pre><pre>// JS<br>&lt;script src=&quot;https://aframe.io/releases/0.7.1/aframe.min.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;<a href="https://github.com/iStaging/vreditor-sdk/blob/master/dist/vreditor-sdk.js">https://github.com/iStaging/vreditor-sdk/blob/master/dist/vreditor-sdk.js</a>&quot;&gt;&lt;/script&gt;</pre><p>And initiate the VREditor object which will be added under the <em>window </em>object:</p><pre>&lt;body&gt;<br>  &lt;div id=&quot;vreditor-sdk&quot;&gt;&lt;/div&gt;<br>&lt;/body&gt;<br>​<br>&lt;script&gt;<br>  VREditor.init({<br>    serverURL: &#39;http://localhost:3000&#39;, // enter your API server, here we provide a sample node server.<br>    el: document.getElementById(&#39;#vreditor-sdk&#39;),<br>    lang: &#39;en&#39;<br>  })<br>&lt;/script&gt;</pre><h4>VRViewer SDK</h4><p>1. Clone the SDK from the <a href="https://github.com/iStaging/vrviewer-sdk">official repository</a> and install the dependencies.</p><pre>npm install // or yarn</pre><p>3. Start the Node server (it runs in port 3001)</p><pre>npm start // or yarn</pre><p>You will see this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*YL41Wlu3w0c2IzxMDExPGA.png" /></figure><p><strong>Note: </strong>Don’t forget to download the panorama viewer <a href="https://krpano.com/">KRPano </a>(use the latest 1x.x version and place if before <em>vrviewer-sdk.js</em>), and <a href="https://threejs.org/">Three.js</a> (use the latest 71 version or above and place it before KRPano). Also, KRPano doesn’t have CDN. You must purchase a license (we’re using the demo version in this sample).</p><pre>// By ES6:</pre><pre>// CSS<br><a href="http://twitter.com/import">@import</a> url(https://medium.com/&#39;vrviewer-sdk/dist/vrviewer-sdk.css&#39;)</pre><pre>// JS<br>import VRViewer from &#39;vrviewer-sdk&#39;</pre><pre>// CDN:</pre><pre>// CSS<br>&lt;link href=&quot;<a href="https://github.com/iStaging/vrviewer-sdk/blob/master/dist/vreditor-sdk.css">https://github.com/iStaging/vrviewer-sdk/blob/master/dist/vrviewer-sdk.css</a>&quot; rel=&quot;stylesheet&quot;&gt;&lt;/link&gt;</pre><pre>// JS<br>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/three.js/71/three.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;krpano.min.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;<a href="https://github.com/iStaging/vrviewer-sdk/blob/master/dist/vreditor-sdk.css">https://github.com/iStaging/vrviewer-sdk/blob/master/dist/vrviewer-sdk.</a>js&quot;&gt;&lt;/script&gt;</pre><p>Initialize the VRViewer object with your <em>panoCollection’s </em>id<em> </em>(don’t forget to create a div with an id), here we parse location.pathname to get panoCollection id:</p><pre>&lt;body&gt;<br>  &lt;div id=&quot;vrviewer-sdk&quot;&gt;&lt;/div&gt;<br>&lt;/body&gt;<br>​<br>&lt;script&gt;<br>const apiServerUrl = &#39;<a href="https://evs-test-api.istaging.com.cn&/#39;">https://evs-test-api.istaging.com.cn&#39;</a><br>const pathnameArray = location.pathname.split(&#39;/&#39;)<br>const collectionId = pathnameArray[pathnameArray.length - 1]<br>axios({<br>  method: &#39;get&#39;,<br>  url: `${apiServerUrl}/api/v1/openlink/${collectionId}`<br>}).then((response) =&gt; {<br>  if (response.status === 200) {<br>    const panoCollection = response.data<br>    console.log(&#39;panoCollection: &#39;, panoCollection)</pre><pre>VRViewer.init({<br>      el: &#39;#vrviewer-sdk&#39;,<br>      lang: &#39;en&#39;,<br>      panoCollection: panoCollection,<br>      setting: {<br>        .. check the document<br>      }<br>    })<br>  }<br>}).catch((error) =&gt; {<br>  console.log(error)<br>})<br><br>&lt;/script&gt;</pre><p><strong>Note: </strong>Since VREditor SDK and VRViewer SDK run in different ports, you can run them at the same time (3000 and 3001).</p><p>Now that everything is set up, let’s create a whole new <em>panoCollection, panorama, </em>and <em>markers </em>using the VREditor SDK.</p><h3>Step 1: Create a panoCollection</h3><p>In the main page (<em>panoCollection </em>list), click the “<em>Create panoCollection” </em>button on the top left.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*qwPhbuP0AwXAMWMVKnHxWw.png" /></figure><p>Enter a name and press the “Save”<em> </em>button:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*LLgJfBmR9rKdskUcvlr24w.png" /></figure><p>After that, check the network which will give you the <em>panoCollection’s </em>id<em>.</em> Remember, we will use this id to display the <em>panoCollection </em>in VRViewer SDK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*wYevLGR9mNl0i3vxhcY98Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*2odo0LZ_WtCc1aNfQQu4nw.png" /></figure><p>You can edit the <em>panoCollection </em>here<em>, </em>such<em> </em>as uploading a <em>profile </em>and <em>thumbnail </em>for it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*zpN3aMZRBsFC7cYMIjN7XQ.png" /></figure><p><strong>Note: </strong><em>name </em>is a required field, and some fields have word limit.</p><h3>Step 2: Create a panorama</h3><p>Now that you have a <em>panoCollection </em>it’s time to create a <em>panorama</em>. Click the “Panoramas” tab:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*HkyuNSg8v4tKAEQ6-QgD4Q.png" /></figure><p>After clicking the “Add panorama<em>” </em>button, you’ll see this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*fohEB5A3Qw5hHp3EPgF55g.png" /></figure><p>Click the “Browse” button, select one or more panoramas, and finally click the “Add panoramas” button. This will be the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*_sikXUqSr_t_Otn-9Fkrmg.png" /></figure><p><strong>Note: </strong>you can edit the <em>panorama </em>by clicking the edit icon on the right (and delete it by clicking the trash icon).</p><h3>Step 3: Create markers</h3><p>Now that we have a <em>panoCollection</em> with a <em>panorama</em>, let’s create a marker. Click the “Marker editor” tab:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*Rz_OSt-Z5jkZYg3G5TZKkg.png" /></figure><p>You’ll see this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*_gVYEN_KzUScwFG8CCtVFA.png" /></figure><p>Click the <strong>points </strong>icon (1st icon on the top left). You’ll see this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*5LqroT7hsGF-yNLIWYVe-w.png" /></figure><p>If you click on a <em>panorama </em>from the <em>panorama </em>list (left), you’ll see this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*lwP5hJnloYCdn1fRogOWLA.png" /></figure><p>If you click “Save rotation,”<em> </em>you’ll set the panorama and angle of the camera to be used when clicking the <strong>point</strong>.</p><p>Now, click the 2nd icon (from top to bottom). That’s a <strong>product tag</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*Hl3bY0QMcq1C0S42lLAo3g.png" /></figure><p>Here you can use the<strong> product tag</strong> to import your data to the marker. A product tag lets you import your data to a marker. However, you need to call iStaging’s <a href="https://evs-doc-test.istaging.com.cn/pages/api.html#create-product-tag">create product tag API</a> (use your platform account token in the request header) to import your data first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*cAwnBy6lU6WscLSXgYyO-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*0jIMRWysqjhUbRLYIN2wNw.png" /></figure><p>After that, you can fetch the data by entering your product ID and clicking “Import” in the marker editor. (Note: it will show the <strong>tag </strong>as default icon in the VRViewer SDK.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*w1rEjwFMMHJnrdr9hPTD1w.png" /></figure><p>To remove the product, click on the “X” on the right side of the input field. To save the product, click the “Save”<em> </em>button.</p><p>Next, click the <strong>custom </strong>marker icon (the 3rd icon from top to bottom):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*dzVszkGp3BezZfmPOJj0_w.png" /></figure><p>You can use the <strong>custom </strong>marker to handle any kind of event you want, by using the VRViewer SDK’s callback functions. But first, you need to call iStaging’s <a href="https://evs-doc-test.istaging.com.cn/pages/api.html#create-custom-tag">create custom tag API</a> (use the platform account token in the request header) to import your <strong>custom </strong>marker first. After that, you’ll be able to fetch your <strong>custom </strong>marker’s <em>type </em>and <em>photo</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*dKzOQxO9lfXe2Rd0oSybtA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*a7N8v1mQev1M48OJWkgP2g.png" /></figure><p>After that, you’ll be able to select an <em>icon</em> from the <em>icon </em>list. Choosing an icon, click “Save” to save the custom marker.</p><p><strong>Important: </strong>You must write the callback functions in the VRViewer SDK first. If you don’t, the <strong>custom </strong>marker won’t do anything. The following is a sample code for E-commerce which using pure javascript. Assuming you already created a <strong>custom </strong>tag <em>like ‘DiscountCoupon’:</em></p><p>html:</p><pre>&lt;!-- custom-popup-section --&gt;<br>    &lt;div class=&quot;custom-popup-section hide&quot;&gt;<br>      &lt;div class=&quot;custom-popup-section-inner&quot;&gt;<br>        &lt;div class=&quot;custom-popup-section-close&quot;&gt;<br>          &lt;i class=&quot;fas fa-times fa-2x&quot;&gt;&lt;/i&gt;<br>        &lt;/div&gt;<br>        &lt;!-- discount-coupon-section --&gt;<br>        &lt;div class=&quot;custom-popup-content-section discount-coupon-section&quot;&gt;<br>          &lt;h2 class=&quot;discount-coupon-title&quot;&gt;<br>            折價卷<br>          &lt;/h2&gt;<br>          &lt;hr&gt;<br>          &lt;div class=&quot;discount-coupon-content&quot;&gt;<br>            &lt;div class=&quot;discount-coupon-item&quot;&gt;<br>              &lt;p&gt;滿$1,000 折 100&lt;/p&gt;<br>              &lt;p&gt;折扣代碼: &lt;span class=&quot;vrsdk-color-yellow&quot;&gt;HAPPY99&lt;/span&gt;&lt;/p&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;discount-coupon-item&quot;&gt;<br>              &lt;p&gt;滿$10,000 折 1,300&lt;/p&gt;<br>              &lt;p&gt;折扣代碼: &lt;span class=&quot;vrsdk-color-yellow&quot;&gt;HAPPY996&lt;/span&gt;&lt;/p&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;discount-coupon-item&quot;&gt;<br>              &lt;p&gt;滿$15,000 折 2,000&lt;/p&gt;<br>              &lt;p&gt;折扣代碼: &lt;span class=&quot;vrsdk-color-yellow&quot;&gt;HAPPY998&lt;/span&gt;&lt;/p&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;discount-coupon-item&quot;&gt;<br>              &lt;p&gt;滿$20,000 折 3,000&lt;/p&gt;<br>              &lt;p&gt;折扣代碼: &lt;span class=&quot;vrsdk-color-yellow&quot;&gt;HAPPY999&lt;/span&gt;&lt;/p&gt;<br>            &lt;/div&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;</pre><p>css:</p><pre>/* coupon section */<br>.discount-coupon-section {<br>  position: relative;<br>  max-height: 100%;<br>  overflow: auto;<br>}</pre><pre>.discount-coupon-title {<br>  font-size: 18px;<br>  line-height: 25px;<br>  text-align: center;<br>}</pre><pre>.discount-coupon-section h2,<br>.discount-coupon-section p {<br>  color: #fff;<br>}</pre><pre>.discount-coupon-section hr {<br>  height: 1px;<br>  width: 100%;<br>  margin: 5px 0;<br>}</pre><pre>.discount-coupon-content {<br>  display: flex;<br>  flex-direction: column;<br>  align-items: center;<br>}</pre><pre>.discount-coupon-item {<br>  position: relative;<br>  text-align: center;<br>  padding-top: 15px;<br>  margin-bottom: 15px;<br>  min-width: 248px;<br>}<br>.discount-coupon-item p {<br>  font-size: 18px;<br>  line-height: 25px;<br>}</pre><pre>.discount-coupon-item + .discount-coupon-item::before {<br>  content: &#39;&#39;;<br>  position: absolute;<br>  top: 0;<br>  left: 0;<br>  right: 0;<br>  width: 100%;<br>  height: 1px;<br>  border-top-style: dashed;<br>  border-top-color: #fff;<br>  border-top-width: 1px;<br>}</pre><p>js:</p><pre>var customPopupSection = document.querySelector(&#39;.custom-popup-section&#39;)<br>var customPopupContentSections = document.querySelectorAll(&#39;.custom-popup-content-section&#39;)<br>customPopupContentSections.forEach(function (contentSection) {<br>  contentSection.classList.add(&#39;hide&#39;)<br>})</pre><pre>VRViewer.onMarkerClick = (marker) =&gt; {<br>  console.log(&#39;onMarkerClick callback: &#39;, marker)</pre><pre>// handle your custom tag in marker click callback function<br>  if (marker.type ===&#39;custom&#39;) {<br>    console.log(&#39;custom marker type: &#39;, marker.customTagInfo.type)<br>    switch (marker.customTagInfo.type) {<br>      case &#39;DiscountCoupon&#39;:<br>        // console.log(&#39;in DiscountCoupon handle&#39;)<br>        var discountCouponSection = document.querySelector(&#39;.discount-coupon-section&#39;);<br>        discountCouponSection.classList.remove(&#39;hide&#39;)<br>        break<br>      default:<br>        // console.log(&#39;in default handle&#39;)<br>        break<br>    }<br>    customPopupSection.classList.remove(&#39;hide&#39;)<br>    VRViewer.togglePanoramasList()<br>  }<br>}</pre><pre>var customPopupClose = document.querySelector(&#39;.custom-popup-section-close&#39;);<br>customPopupClose.addEventListener(&#39;click&#39;, function() {<br>  customPopupSection.classList.add(&#39;hide&#39;)<br>  customPopupContentSections.forEach(function (contentSection) {<br>    if (!contentSection.classList.contains(&#39;hide&#39;)) {<br>      contentSection.classList.add(&#39;hide&#39;)<br>    }<br>  })<br>  VRViewer.togglePanoramasList()<br>});</pre><p>Then you will see like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*cKKpXlfvrwRAWPcPnflsRw.png" /></figure><p>Check the <em>examples/static/en/index.</em>html, index.js, index.css file (VRViewer SDK).</p><p>The next marker is called <strong>tag</strong> (the 4th one):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*vX9WMoaiolUBsAyFQ4uazg.png" /></figure><p>You can give it a <em>title</em>, <em>price</em>, <em>description</em>, <em>thumbnail, </em>and an <em>action </em>(e.g. a link to the website that’s selling the product).</p><p>The next marker is called <strong>memo </strong>(the 5th one):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*ZbsODb6kwznbHWgt51OqKg.png" /></figure><p>The last marker is called <strong>video</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*XbfPLm0aWxK6mv1cqr9z3Q.png" /></figure><p>If you enter the <em>URL </em>of a video, for example from Vimeo, and click “Preview,” the video will show (the URL from the website must be iframe-friendly):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*bT4tPflmyGuCFzGU59wLoQ.png" /></figure><p>To save the marker click “Save.</p><h3>Step 4: See the created content on VRViewer SDK website</h3><p>To see the preview/see the end result, click the eye icon on the top right:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*sN1k2wm-teQjLwyiINREHw.png" /></figure><p>To preview/see your content, you must host a site powered by VRViewer SDK, following this format: <a href="https://yourwebsite/:panoCollectionId.)"><em>https://yourwebsite/:panoCollectionId</em></a><em>. </em>The base URL using by `viewerPreviewHost`, which you should add in <em>public/en/index.js:</em></p><pre>&lt;script&gt;<br>  VREditor.init({<br>    serverURL: &#39;http://localhost:3000&#39;, enter your API server, here we provide a sample node server.<br>    el: document.getElementById(&#39;#vreditor-sdk&#39;),<br>    lang: &#39;en&#39;,<br>    shouldGoToDetailsPage: true, // shouldGoToDetailsPage will auto go to panoCollection detail page if you have only one panoCollection<br>    viewerPreviewHost: {<br>      url: &#39;xxx&#39;, // enter the website you host to make sure share function work.<br>      previewInSdk: true // default false<br>    }<br>})<br>&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*E1NX6vQYBTXwd3EIpvUlqg.png" /></figure><p>If you click on the <strong>point </strong>marker<strong>, </strong>you’ll be taken to the panorama assigned to it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*973C2GECuwnEQH5xg6Qr-w.png" /></figure><p>If you click on any other marker, you’ll see the information that you entered in VREditor SDK:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*EjWDFH3q21DrxrRC7ntVIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BXL66_VSTot9p3WY3YDwTQ.png" /></figure><h3>Step 5: Fetch your panoCollection data by id in VRViewer SDK</h3><p>Fetch your <em>panoCollection</em>’s data with iStaging’s <a href="https://evs-doc-test.istaging.com.cn/pages/api.html#get-public-open-panocollection-link">Public/Open Panorama Collection API</a> by id.</p><p>Change the sample <em>panoCollection </em>id to your <em>panoCollection </em>id.</p><pre>GET <a href="https://evs-doc-test.istaging.com.cn/">https://evs-doc-test.istaging.com.cn/</a>api/v1/openlink/&lt;yourPanoCollectionId&gt;</pre><p>Here we parse location pathname to get the panoCollection id. Change the url to your panoCollection id. Check the <em>examples/static/en/index.js</em> file for examples (VRViewer SDK):</p><pre>const apiServerUrl = &#39;<a href="https://evs-test-api.istaging.com.cn&/#39;">https://evs-test-api.istaging.com.cn&#39;</a><br>const pathnameArray = location.pathname.split(&#39;/&#39;)<br>const collectionId = pathnameArray[pathnameArray.length - 1]<br>  axios({<br>    method: &#39;get&#39;,<br>    url: `${apiServerUrl}/api/v1/openlink/${collectionId}`<br>  }).then(resp =&gt; {<br>    const panoCollection = resp.data<br>    // <br>    let config = {<br>      el: &#39;#vrviewer-sdk&#39;,<br>      lang: &#39;zh-cn&#39;,<br>      setting: DEFAULT_SETTING,<br>      panoCollection<br>    }<br>    VRViewer.init(config)<br>  }).catch(error =&gt; {<br>    console.log(error)<br>  })</pre><p>After the <em>panoCollection </em>has been fetched, initiate the VRViewer with the <em>panoCollection’s </em>data.</p><h3>Final result</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*Zbp_ikwMiaFniIHEqlxDIQ.gif" /></figure><h3>Github repository</h3><p>(Sample code is included inside.)</p><p><a href="https://github.com/iStaging/vrmaker-sdk">iStaging/vrviewer-sdk</a></p><h3>Basic concepts:</h3><ul><li><strong>Panorama collection</strong>: It’s the element that contains all the panoramas (think of it as the building of many rooms).</li><li><strong>Panorama</strong>: a photo which can be rotated 360 degrees (in this SDK, you can think of them as the rooms of a building).</li><li><strong>Marker:</strong> They are clickable elements you can include in your 360/VR tour.</li><li><em>Points</em>: A marker to link panoramas.</li><li><em>Tag</em>: A marker to add a photo, description, along with a buy link.</li><li><em>Product tag</em>: A marker containing information about an existing product.</li><li><em>Custom tag</em>: A marker with your own custom icon.</li><li><em>Video</em>: A marker that enables you to embed a website, like a YouTube video or a Sketchfab 3D model.</li></ul><p><strong>View angle</strong>: The default orientation of the panoramas.</p><p><strong>Floor plan: </strong>Think of it as the floor plan of a building.</p><h3>Recources:</h3><ul><li><strong>VREditor: </strong><a href="https://github.com/iStaging/vrviewer-sdk">https://github.com/iStaging/vreditor-sdk</a></li><li><strong>VRViewer: </strong><a href="https://github.com/iStaging/vrviewer-sdk">https://github.com/iStaging/vrviewer-sdk</a></li><li><strong>Document: </strong><a href="https://evs-doc-test.istaging.com.cn/">https://evs-doc-test.istaging.com.cn</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6b4d796da29" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>