N
N
Nikki1612017-06-19 15:17:31
JavaScript
Nikki161, 2017-06-19 15:17:31

How to make a link from one page to another page with a specific yandex map tag?

Good afternoon!
I have store addresses on one page
. On the other page, a Yandex map with tags
. Is it possible to make a link from an address to a specific link?

ymaps.ready(function () {
    var myMap = new ymaps.Map('map', {
            center: [47.228332,39.714797],
            zoom: 14
        }, {
            searchControlProvider: 'yandex#search'
        }),

        // Создаём макет содержимого.
        MyIconContentLayout = ymaps.templateLayoutFactory.createClass(
            '<div style="color: #FFFFFF; font-weight: bold;">$[properties.iconContent]</div>'
        ),
        myPlacemark1 = new ymaps.Placemark([47.226417,39.722424],{
            hintContent: 'г. Ростов-на-Дону, ул. Чехова 53',
            balloonContent: 'г. Ростов-на-Дону, ул. Чехова 53'
        }, {
            iconLayout: 'default#imageWithContent',
            iconImageHref: 'http://dev01my7.beget.tech/img/loc.png',
            iconImageSize: [30, 42],
            iconImageOffset: [0, 0],
        }),

        myPlacemark2 = new ymaps.Placemark([47.226692,39.717196], {
            hintContent: 'г. Ростов-на-Дону, проспект Ворошиловский 36',
            balloonContent: 'г. Ростов-на-Дону, проспект Ворошиловский 36'}, {
            iconLayout: 'default#imageWithContent',
            iconImageHref: 'http://dev01my7.beget.tech/img/loc.png',
            iconImageSize: [30, 42],
            iconImageOffset: [0, 0]
        });

    myMap.geoObjects
        .add(myPlacemark1)
        .add(myPlacemark2);
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2017-06-19
@freeExec

Of course, in the link you pass a parameter (your own, whatever your heart desires), and on the second page, parse the URL, find this parameter and, based on it, show the desired marker and center the map on it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question