Прибережный: Карта Проклятых Мест

// Attach mousemove on map only ONCE to check proximity to cursed spots map.on("mousemove", function (e) { var cursorLatLng = e.latlng; var found = false; for (var key in cursedSpots) { var spot = cursedSpots[key]; var distance = cursorLatLng.distanceTo(spot.coords); if (distance <= hoverRadiusMeters) { hideAllImages(); document.getElementById(spot.imgId).style.display = "block"; found = true; break; } } if (!found) { hideAllImages(); } }); map.on("mouseout", function () { hideAllImages(); });