I want to add a map to the pop-up window, which will be displayed when clicking on a specific address in the text. For example, Yandex.Mail can allocate addresses. Like that:

enter image description here

How to do it?

    1 answer 1

    In the JS API, Yandex.Maps has a Geo - link — a Geolink module that allows you to select an address, coordinates, or organization name in the text of a page. When clicking, a static map will be opened with the ability to go to Yandex.Maps.

    How to add:

    Upload the API code with the Geolink module to the page. To do this, insert the line in the header of the HTML page:

    <script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU&load=Geolink" type="text/javascript"></script> 

    Wrap the desired text into an HTML element with the “ymaps-geolink” CSS class:

     <span class="ymaps-geolink"> Москва, ул. Крылатские холмы, 26 </span> 

    Documentation | Examples

    • let's say .... how then to be if this is not a house but just a street? square for example, a fountain? - Denis Rodionov
    • @DenisRodionov you can also specify the address accurate to the street. The fountain can also be specified, but the whole question here is whether it will be found on Yandex.Maps upon request, wrapped in a link. - Reni
    • I say it again. I’m not talking about a house that has a street and a house number, I’m talking about objects on the streets that don’t have a street ... you can specify a fountain ... in order to accurately indicate this only through geography. coordinates ... I hope now you understand what I mean ... - Denis Rodionov
    • @DenisRodionov let's not rude. I repeat once again, you can wrap any text into a geo-link, but the result will be only if you can find the object on Yandex maps with this query. Once the words you do not understand, here is an example - Reni
    • @Reni how to set the direction of appearance of a mini-window with a map? Now it is in the footer and flies down, shifting the whole style of the basement .. ! [enter here the description of the image ] ( i.stack.imgur.com/D9lKP.jpg ) - Dmitry Nikitin