本页由英文原文机器翻译而成。
嵌入
把 Space Radar 放进你的网页
复制一行 HTML,一个天体、一段导览旅程或整张地图的实时三维视图就会出现在你的网页里。它是免费的,不用注册,也不在读者的设备上保存任何东西:没有 cookie,没有跟踪器。
生成代码
三个现成的例子
一个实时天体
<iframe src="https://www.spaceradar.ai/?embed=1&at=sat-25544" title="International Space Station, live on Space Radar" width="600" height="400" loading="lazy" allow="fullscreen" style="border:0;max-width:100%"></iframe> <p>Live view by <a href="https://www.spaceradar.ai/?from=embed">Space Radar</a></p>
一段导览旅程:我们在月球上着陆的地方
<iframe src="https://www.spaceradar.ai/?embed=1&trip=moon-landings" title="Where we have landed on the Moon, a guided trip on Space Radar" width="600" height="400" loading="lazy" allow="fullscreen" style="border:0;max-width:100%"></iframe> <p>Live view by <a href="https://www.spaceradar.ai/?from=embed">Space Radar</a></p>
整张地图
<iframe src="https://www.spaceradar.ai/?embed=1" title="Space Radar, a live 3D map of space" width="600" height="400" loading="lazy" allow="fullscreen" style="border:0;max-width:100%"></iframe> <p>Live view by <a href="https://www.spaceradar.ai/?from=embed">Space Radar</a></p>
值得知道
- 按你的栏宽修改
width和height。视图会填满给它的框,最窄可以到约 280 像素宽。请保留title:没有它的框,屏幕阅读器读不出名字。 loading="lazy"会让地图等读者滚动到附近时才启动。一个星球或载人空间站启动的是轻量版本(约 2 MB);其他东西启动的是完整地图,有好几 MB。- 读者的镜头由读者自己控制:拖动、滚动、双指缩放。框里的任何东西都不会抢走你网页的按键。
- 如果你的网站设置了内容安全策略(Content Security Policy),请用
frame-src https://www.spaceradar.ai允许这个框。 - 完整的说明和每一个参数,见 docs/EMBEDDING.md。
框里画出的东西是根据公开的测量数据模拟的:位置是在浏览器里根据公布的轨道根数和星历表推算的,框里天体的标签会说明它的数字是怎么推算的。哪个视图是艺术想象图,它会注明。来源列在来源页面和 CREDITS.md 里。
嵌入了它的网站
暂时还没有。如果你已经把 Space Radar 放进了某个网页,并希望它列在这里,请在 Show and tell 里告诉我们。
根据项目的登记表和应用自己的地址规则生成;上面的代码,就是应用的“嵌入”按钮写出的代码。