<script src="https://maps.googleapis.com/maps/api/js?key=[MY_API_KEY]"></script>
<template>
<div id="map"></div>
</template>
<script>
import GoogleMapsLoader from 'google-maps'
export default {
name: "Map",
mounted: function () {
GoogleMapsLoader.KEY = 'AIzaSyCreM63W1kHeozDLz0WohGhVAC2-PE8vv8';
GoogleMapsLoader.load(function(google) {
let map = new google.maps.Map(document.getElementById('map'), {
zoom: 14,
center: new google.maps.LatLng(59.93, 30.32)
})
})
}
}
</script>
<style scoped>
#map {
height:300px;
width: 100%;
}
</style>
var textTo = document.getElementById('lermontov');
var poesi = textTo.innerHTML;
var xhr = new XMLHttpRequest;
var key ='Ваш ключ -35d211642e6820a07c07d47303a';
var api = 'https://translate.yandex.net/api/v1.5/tr.json/translate';
var textTo = document.getElementById('lermontov');
var poesi = textTo.innerHTML;
var language ='&lang=ru-en';
var url = api+'?';
url += 'key=' + key;
url += '&text='+ encodeURIComponent(textTo.innerHTML);
url += language;
xhr.open('GET',url,true);
xhr.onreadystatechange= function(){
if(xhr.readyState == 4){
if(xhr.status == 200){
console.log(JSON.parse(this.responseText))
document.getElementById('result').innerHTML += this.responseText;
}
}
}
xhr.send()