There is a Yandex.Maps code on the site:

<script type="text/javascript"> ymaps.ready(function () { var myMap = new ymaps.Map('map', { center: [lng, lat], zoom: 2 }), myPlacemark = new ymaps.Placemark(myMap.getCenter(), { hintContent: '<a href="#" class="savedata" style="font-family: ddd;" onclick="goJs()">Π‘ΠΎΡ…Ρ€Π°Π½ΠΈΡ‚ΡŒ Π½Π° стСну VK</a>' }, { // ΠžΠΏΡ†ΠΈΠΈ. // НСобходимо ΡƒΠΊΠ°Π·Π°Ρ‚ΡŒ Π΄Π°Π½Π½Ρ‹ΠΉ Ρ‚ΠΈΠΏ ΠΌΠ°ΠΊΠ΅Ρ‚Π°. iconLayout: 'default#image', // Π‘Π²ΠΎΡ‘ ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ ΠΈΠΊΠΎΠ½ΠΊΠΈ ΠΌΠ΅Ρ‚ΠΊΠΈ. iconImageHref: 'mail.png', // Π Π°Π·ΠΌΠ΅Ρ€Ρ‹ ΠΌΠ΅Ρ‚ΠΊΠΈ. iconImageSize: [100, 100], // Π‘ΠΌΠ΅Ρ‰Π΅Π½ΠΈΠ΅ Π»Π΅Π²ΠΎΠ³ΠΎ Π²Π΅Ρ€Ρ…Π½Π΅Π³ΠΎ ΡƒΠ³Π»Π° ΠΈΠΊΠΎΠ½ΠΊΠΈ ΠΎΡ‚Π½ΠΎΡΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎ // Π΅Ρ‘ "Π½ΠΎΠΆΠΊΠΈ" (Ρ‚ΠΎΡ‡ΠΊΠΈ привязки). iconImageOffset: [-3, -42] }); myMap.geoObjects.add(myPlacemark); }); </script> 

After executing the function, the coordinates lng and lat change, and no changes occur on the map. What better way to do?

  • These variables change, but how do you pass in new values? If not, then it is clear that the card will not change, because you change the value of the variable and not the properties of the map object. PS Give more information about the script. How do you change the values ​​of these variables - Victor Halauko
  • In Json I get the coordinates and that's it. Maybe just reload the div with the map? If so, how to do it on jquery? - Korobok

0