Zum Hauptinhalt springen

Kaleidr AI an eine Google-Karte anhängen

Erfordert einen Publishable Key mit ai-Scope auf Pro oder höher. Der Origin deiner Seite muss in der Allowlist des Schlüssels stehen und über HTTP(S) ausgeliefert werden — siehe API-Schlüssel erhalten.

<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>

Das Chat-Bundle erkennt Google Maps automatisch und stellt aufgelöste Orte als Google-Marker dar. Die Nutzung wird über den ai-Scope abgerechnet. Dein Google-Maps-Schlüssel und dein Kaleidr-Schlüssel sind getrennt — Google berechnet Map-Tiles, Kaleidr berechnet AI.