跳到主要内容

Viewer

Viewer 产品通过 share id 嵌入已发布的 Kaleidr 地图。它 无需密钥 — share 本身就是授权,因此不需要 publishable 密钥, 也不会进行会话交换。

决定其能否正常工作的三个关键因素

要素说明
接入方式iframe — 地图在 Kaleidr 自身 CSP 下的 map-embed.kaleidr.com 中加载。
所需作用域无 — 不交换任何密钥。
最低套餐Free — 任何拥有 share id 的用户都可以在任何套餐中嵌入 Viewer。

向 Viewer embed 传递密钥会以 product_not_allowed 拒绝,因为 Viewer 从不需要密钥。share-id必填项 — 省略时会在 bundle 加载时抛出错误。

各组件的位置

唯一需要的代码片段

最小可用 Viewer embed:

<script src="https://cdn.kaleidr.com/embed/v1/kaleidr.js"></script>
<kaleidr-map product="viewer"
share-id="YOUR_SHARE_ID"
style="height:480px"></kaleidr-map>