Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. <script type="text/javascript">
  2. var myMap;
  3. ymaps.ready(function () {
  4. myMap = new ymaps.Map("YMapsID", {
  5. center: [55.76, 37.64],
  6. zoom: 10
  7. });
  8. var myCollection = new ymaps.GeoObjectCollection();
  9. myCollection.add(new ymaps.Placemark([37.61, 55.75]));
  10. myCollection.add(new ymaps.Placemark([13.38, 52.51]));
  11. myCollection.add(new ymaps.Placemark([30.30, 50.27]));
  12. myCollection.events
  13. .add("mouseenter", function () {
  14. myCollection.options.set("preset", "twirl#redIcon");
  15. })
  16. .add("mouseleave", function () {
  17. myCollection.options.unset("preset");
  18. });
  19. myMap.geoObjects.add(myCollection);
  20. myMap.setBounds(myCollection.getBounds());
  21. });
  22.  
  23. </script>
  24. <div id="YMapsID" style="width: 450px; height: 350px;"></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement