Я пытался внедрить карты ЗДЕСЬ на свой веб-сайт, но столкнулся с проблемой. Когда я монтирую карту, внизу слева отображается только логотип HERE, но область, где должна быть карта, пуста. Я не получаю ошибок. Я также использую Vue.JS, но монтирую карту методом mounted()
(см. Код ниже).
`
<template>
<div class="here-map">
<div ref="map" id="mapContainer" v-bind:style="{ width: width, height: height }"></div>
</div>
</template>
<script>
export default {
name: "HereMap",
data() {
return {
map: {},
platform: {}
}
},
props: {
lat: String,
lng: String,
width: String,
height: String
},
created() {
this.platform = new H.service.Platform({
apikey: "myApiKey"
});
},
mounted() {
const maptypes = this.platform.createDefaultLayers();
this.map = new H.Map(
document.getElementById('mapContainer'),
maptypes.vector.normal.map,
{
center: {lat:50, lng:5},
zoom: 4,
pixelRatio: window.devicePixelRatio || 1
});
}
}
</script>
`