Вот так можно.
Code:
<style>
.player {
width: 100%;
height: 400px;
margin: 0;
padding: 0;
}
</style>
<script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU&apikey=********************"></script>
<div id="player" class="player"></div>
<script language="javascript" type="text/javascript">
ymaps.ready(function () {
if (!ymaps.panorama.isSupported()) {
return;
}
ymaps.panorama.locate([XX.XXXXXX, XX.XXXXXX]).done(
function (panoramas) {
if (panoramas.length > 0) {
var player = new ymaps.panorama.Player(
'player',
panoramas[0],
{ direction: [12, 17] }
);
}
},
function (error) {
alert(error.message);
}
);
});
</script>