Kaleidr AI を Google マップにアタッチ
Pro 以上で ai scope を持つ publishable key が必要です。ページの
origin は key の allowlist に登録され、HTTP(S) で配信されている必要があります —
APIキーを取得 を参照してくだ さい。
<div id="mapHost" style="height:520px;position:relative">
<div id="map" style="position:absolute;inset:0"></div>
<div id="chat" style="position:absolute;inset:0;z-index:1;pointer-events:none"></div>
</div>
<script src="https://cdn.kaleidr.com/embed/v1/kaleidr.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_GOOGLE_KEY&callback=initMap&loading=async&v=weekly" async></script>
<script>
function initMap() {
const map = new google.maps.Map(document.getElementById('map'), {
center: { lat: 51.5, lng: -0.12 },
zoom: 11,
});
Kaleidr.mount('#chat', {
product: 'chat',
publishableKey: 'kld_pk_live_…',
map,
contained: true, // dock inside #chat, not on document.body
});
}
</script>
chat bundle は Google Maps を自動検出し、特定された場所を
Google marker として表示します。ai scope に課金されます。Google Maps key と
Kaleidr key は別です — Google は map tile に、Kaleidr は AI に課金します。