如何在网站中嵌入光球? [英] How to embed a photosphere in a website?

查看:96
本文介绍了如何在网站中嵌入光球?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我尝试将代码嵌入到网站中时(点击共享或整合选项,当我在浏览器上可视化时),我只能选择共享链接。如何获取HTML代码以嵌入它?



以下是指向photosphere的链接:
https://www.google.com/maps /@45.3189037,5.605167,3a,75y,109.64h,85.35t/data=!3m8!1e1!3m6!1s-xnB-GGXEh-Q%2FVv0xzYTJj5I%2FAAAAAAAAHnY%2Fgt_bfWvfbrUUkkA04-jtntYU4PZXuzR9w!2e4!3e11!6s%2F%2Flh4 .ggpht.com%2F-xnB-GGXEh-Q%2FVv0xzYTJj5I%2FAAAAAAAAAAA%2Fut7S6Ntzdyg%2Fno%2Fphoto.jpg!7i12800!8i3206

解决方案

基本上,您可以通过创建 StreetViewPanorama 来嵌入这些全景图, a>



您必须提供l通过位置 -property

(将会是 {lat:45.318904,lng:5.605167}



或全景ID通过 pano - 属性。
(将 F:-xnB-GGXEh-Q / Vv0xzYTJj5I / AAAAAAAAHng / _boZWR43M0QLwPNphf-ROOJLOqaPUEeQw

对于给定的photosphere,它只适用于我(不要问我为什么),当我设置(仍未公开) google.maps.streetViewViewer -property为 photosphere



google.maps.event.addDomListener(window,'load',function() {google.maps.streetViewViewer ='photosphere'; new google.maps.StreetViewPanorama(document.getElementById('pano'),{pano:'F:-xnB-GGXEh-Q / Vv0xzYTJj5I / AAAAAAAAHng / _boZWR43M0QLwPNphf-ROOJLOqaPUEeQw'}) ;});

html,body,#pano {margin :0;填充:0; height:100%;}

< script src = http://maps.google.com/maps/api/js?v=3\"></script><div id =pano>< / div>


I took a photosphere with google street view app and shared it on google maps.

When I try to get the code to embed it on a website (clicking "share or integrate" option when I visualise it on a browser), I only have the option to share the link. How can I get the HTML code to embed it ?

Here is the link to the photosphere : https://www.google.com/maps/@45.3189037,5.605167,3a,75y,109.64h,85.35t/data=!3m8!1e1!3m6!1s-xnB-GGXEh-Q%2FVv0xzYTJj5I%2FAAAAAAAAHnY%2Fgt_bfWvfbrUUkkA04-jtntYU4PZXuzR9w!2e4!3e11!6s%2F%2Flh4.ggpht.com%2F-xnB-GGXEh-Q%2FVv0xzYTJj5I%2FAAAAAAAAAAA%2Fut7S6Ntzdyg%2Fno%2Fphoto.jpg!7i12800!8i3206

解决方案

Basically you may embed these panoramas by creating a StreetViewPanorama

You must provide either the location via the position-property
( would be {lat: 45.318904,lng:5.605167})

or the panorama-ID via the pano-property. ( would be F:-xnB-GGXEh-Q/Vv0xzYTJj5I/AAAAAAAAHng/_boZWR43M0QLwPNphf-ROOJLOqaPUEeQw)

For the given photosphere it only works for me(don't ask me why) when I set the (still undocumented) google.maps.streetViewViewer-property to photosphere

 google.maps.event.addDomListener(window, 'load', function() {

   google.maps.streetViewViewer = 'photosphere';
   new google.maps.StreetViewPanorama(document.getElementById('pano'), {

     pano: 'F:-xnB-GGXEh-Q/Vv0xzYTJj5I/AAAAAAAAHng/_boZWR43M0QLwPNphf-ROOJLOqaPUEeQw'
   });
 });

html,
body,
#pano {
  margin: 0;
  padding: 0;
  height: 100%;
}

<script src="http://maps.google.com/maps/api/js?v=3"></script>
<div id="pano"></div>

这篇关于如何在网站中嵌入光球?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆