The page with the built-in map from Yandex is loaded. From the database I get the address of the house and pass it on to a script that finds this house on the map and places the baloon in its place. Is there any ready-made solution to this problem?

    1 answer 1

    It turned out something like this:

    ymaps.ready(function(){ $.getJSON('http://geocode-maps.yandex.ru/1.x/?format=json&geocode=' + "{{ settings.address }}", function(data) { var gobj = data.response.GeoObjectCollection.featureMember[0]; var gobj_name = gobj.GeoObject.description + ' - '+ gobj.GeoObject.name; var gobj_pos = gobj.GeoObject.Point.pos.split(' ').reverse(); var map = new ymaps.Map("map", { center: gobj_pos, zoom: 16 }); var balloon = map.balloon.open(map.getCenter(), { content: gobj_name } ); }); }); 

    Where {{settings.address}} is the address from the database.