剛開(kāi)始學(xué)習(xí)photo sphere viewer插件,在大神博客都會(huì)看到toggleDeviceOrientation():是否開(kāi)啟重力感應(yīng)方向控制,toggleStereo():是否開(kāi)啟立體效果(可用于WebVR哦)。兩個(gè)可以用于重力感應(yīng)和vr功能的方法,但是在官方文檔中并沒(méi)有看到相關(guān)的案例。自己在PSV配置上添加了 gyroscope選項(xiàng) 在移動(dòng)端也沒(méi)有起作用。至于兩個(gè)方法,我使用psv.toggleDeviceOrientation();也是顯示并沒(méi)有這個(gè)方法。請(qǐng)問(wèn)此插件是否能實(shí)現(xiàn)這個(gè)功能?怎么實(shí)現(xiàn)。十分感謝。
var div = document.getElementById('your-pano');
var x = $('.container').css('width');
var PSV = new PhotoSphereViewer({
panorama: 'images/0600.jpg',
container: div,
// 啟用陀螺儀
gyroscope:true,
navbar: true,
size: {
width:x,
height:'400px'
},
// list of markers
markers: [
{
// image marker that opens the panel when clicked
id: 'image',
longitude: 0.2,
latitude: -0.13770,
image: 'images/2.jpg',
width: 32,
height: 32,
anchor: 'bottom center',
tooltip: 'A image marker. <b>Click me!</b>',
content: 'Custom',
onClick: function() {
console.log('aaaaaaa');
}
},
{
// image marker that opens the panel when clicked
id: 'image1',
longitude: 0.6,
latitude: -0.13770,
image: 'images/2.jpg',
width: 32,
height: 32,
tooltip: 'A image marker. <b>Click me!</b>',
},
{
// html marker with custom style
id: 'text',
longitude: 0,
latitude: 0,
html: 'HTML <b>marker</b> ♥',
anchor: 'bottom right',
scale: [0.5, 1.5],
style: {
maxWidth: '100px',
color: 'white',
fontSize: '20px',
fontFamily: 'Helvetica, sans-serif',
textAlign: 'center'
},
tooltip: {
content: document.getElementById('lorem-content').innerHTML,
position: 'right'
}
},
{
// polygon marker
id: 'polygon',
polygon_px: [
[3184, 794], [3268, 841], [3367, 1194],
[3327, 1307], [3065, 1221], [3097, 847]
],
svgStyle: {
fill: 'rgba(200, 0, 0, 0.2)',
stroke: 'rgba(200, 0, 50, 0.8)',
strokeWidth: '2px'
},
tooltip: {
content: 'A dynamic polygon marker',
position: 'right bottom'
}
},
{
// polyline marker
id: 'polyline',
polyline_rad: [
[5.924, 0.064], [5.859, -0.061], [5.710, -0.132],
[5.410, -0.287], [4.329, -0.490], [3.838, -0.370], [3.725, -0.241]
],
svgStyle: {
stroke: 'rgba(140, 190, 10, 0.8)',
strokeLinecap: 'round',
strokeLinejoin: 'round',
strokeWidth: '10px'
},
tooltip: 'A dynamic polyline marker'
},
{
// circle marker
id: 'circle',
circle: 20,
x: 2500,
y: 1000,
tooltip: 'A circle marker'
}
]
});
`
var PSV = new PhotoSphereViewer({
container: photosphere,
panorama: 'image',
size: {
width: window.innerWidth,
height: window.innerHeight
},
autoload: true,
allow_scroll_to_zoom: false,
markers: [{
// 多邊形標(biāo)記
id: 'polygon',
polygon_px: [3184, 794, 3268, 841, 3367, 1194, 3327, 1307, 3065, 1221, 3097, 847],
svgStyle: {
fill: 'rgba(200, 0, 0, 0.2)',
stroke: 'rgba(200, 0, 50, 0.8)',
'stroke-width': '2px'
},
tooltip: {
content: 'A dynamic polygon marker',
position: 'right bottom'
}
}],
onready: function(){
PSV.toggleDeviceOrientation()
}
})
`
這樣應(yīng)該可以,但是在安卓機(jī)上效果很差
北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
北大青鳥(niǎo)中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過(guò)二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_(kāi)發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
曾工作于聯(lián)想擔(dān)任系統(tǒng)開(kāi)發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開(kāi)發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開(kāi)發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開(kāi)發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問(wèn),美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。